Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module Types Extra #2006

Merged
merged 13 commits into from Aug 27, 2019
Merged

Module Types Extra #2006

merged 13 commits into from Aug 27, 2019

Conversation

guybedford
Copy link
Member

@guybedford guybedford commented Aug 26, 2019

This implements the fallback approach as discussed in #2005 (comment), while abstracting all module types into their own extra.

This replaces the Web Assembly feature with a single module types extra, removing .json support in the s.js loader too so that it would need this extra for JSON support.

This gets the s.js loader footprint back down to 1.5KiB.

The hardest part was testing it, which required a custom server harness for the tests. Nice to have this finally though :)

@guybedford guybedford changed the title Eval fallback for application/javascript on non-JS module types Module Types Extra Aug 27, 2019
@guybedford
Copy link
Member Author

I've updated this PR to also bring all the different module types into a dedicated module-types extra that is not included in s.js by default. This allows s.js to get Web Assembly support too now!

Copy link
Collaborator

@joeldenning joeldenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I think it's a little weird that we support js fallback for wasm and html, but not for json or css. But I like that this is pulled out into an extra.

@@ -0,0 +1,92 @@
/*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 I think that this is better as an extra than baked into s.js and script-load. And am also glad that the module-types extra is included by default into system.js

@guybedford
Copy link
Member Author

Thanks for the review, merging to prep for the composition PR, then hopefully we're getting there on v6.

I think it's a little weird that we support js fallback for wasm and html, but not for json or css

We support the fallback of application/javascript for all the fetch types.

@guybedford guybedford merged commit 36854be into 6.x Aug 27, 2019
@guybedford guybedford deleted the eval-module-type-fallback branch August 27, 2019 17:54
@joeldenning
Copy link
Collaborator

We support the fallback of application/javascript for all the fetch types.

Ah I see that now -- misread the code earlier. 👍 this looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants