-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Supporting redirected URL for dependency normalization #1754
Comments
Ok, so the reason for this is we don't support "catching" redirects in the fetch component of SystemJS. Supporting this is important for spec alignment so let's aim to get this feature in soon. Basically we'd need something along the following lines:
This should be relatively straightforward to implement, so I will aim to get to this, although it won't be very soon unfortunately. |
#1772 needs the same functionality when resolving dependencies. The difference is that the "redirectURL" is returned during the plugin's |
This is still a tricky one to support in SystemJS 2.0. Leaving open, but its nature is a wontfix. |
(although I'm always open to bright ideas too) |
It should be possible to support with the translate loader though, just not the script loader. Removing the wontfix label for the translate loader support. |
I implemented this in es-module-shims in guybedford/es-module-shims@a811843 and it was pretty straightforward. The hardest part is just figuring out how to pipe this information in the System loader internals. |
So it turns out the translate loader is not really being focused on. Given this I think we can go back to the wontfix scenario here. |
So this works in the latest version of Chrome, which is freaking awesome:
Chrome has no tree-shaking and downloads 300+ dependencies (one for every function exported from lodash)... but it works.
Here is what I have for a SystemJS equivalent:
And it has the 302 redirect resolution issue explained in ModuleLoader/es-module-loader#538
At the moment, I'm "solving" this by manually mapping module identifiers to their final URL, which basically means adding a line of config for every deep dependency in my project. (And that became so burdensome I started using the UMD builds of my dependencies instead of their native ES6 source code.) I'm building a client-side IDE so I need to be able to dynamically load npm modules, which is why I'm not just using Webpack or something.
Any idea how I can get around this? Is there a hook where I could mangle the resolving algorithm in SystemJS to use the post-302 location?
The text was updated successfully, but these errors were encountered: