-
Notifications
You must be signed in to change notification settings - Fork 783
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
Improve External Module Bundling and Load Through ES Module Imports #162
Comments
So what to do until this issue is resolved? Any recommendations? |
I think this is already implied by the description, but I'll write it out just in case.... Hopefully the ultimate goal here is effective sharing of library code across multiple separately developed Stencil components and further across Stencil consuming code:
This should be implementable today for current browsers using ES modules; fallback to static bundling would need to happen at the highest (application) level to get correct results for all browsers. I don't see a way to get correct results for all browsers if the Stencil build does the fallback bundling. You would end up with (my in my example) more than one copy of RxJS on the page. |
Any update on this? |
@felschr Yup, we've got a branch going and actively workin on it. |
Just wanted to post an update here as this issue is getting a decent amount of traction on the stencil slack. The team is actively working on this and we are pretty close to having it working. This is probably our biggest refactoring of the internals of the Stencil compiler to date, or atleast one of the biggest, so its taking some time. |
Is this solved now? |
@JGW This is likely the most anticipated update as well. Not using Stencil until this critical issue is resolved. What is the timeline? Before end of January? Alpha, Beta? |
@kristianmandrup I might be mistaken, but it seems like the built files do not contain the imports that I have in my components. That leads me to believe that this is partially solved? At least the part where it used to bundle all the imported libs together with the components seems to be solved ... not sure if importing the components works now. |
What is the expected timeline on this? You expect to have a beta release of this critical feature/improvement end of January 2018? Thanks :) |
@jthoms1 is actively working on a branch. The actual ES module part of it is working, the remaining bits is the alternate build for ie11. I just moved this to the 0.3.0 so we can ship other features in the 0.2.0 and not let this hold anything else up. Thanks |
Great! Please don't let IE support hold it back ;) IE is a minor browser these days |
That said, maybe we can ship some test versions full well knowing legacy modules won't work. @jthoms1 thoughts? |
The esmodule code splitting is within rollup PR rollup/rollup#1841. I have been working with it locally and it works really well. I am not comfortable shipping this until rollup actually does a release with the feature. There is a lot activity so I would assume it should be soon. |
So it looks like it was recently merged and available from release I'm super excited to finally use this feature/improvement on my next project. Cheers! :) |
Now waiting on this PR top get merged. rollup/rollup-plugin-commonjs#283 |
@jthoms1 could you provide with an example maybe I'm missing something here... Because when I try to import Any idea ? |
Looks like this is a known issue. rollup/rollup-plugin-commonjs#255 According to the comments this might warn but should still work. Is this what you are experiencing? |
I confirm that |
rollup/rollup-plugin-commonjs#283 is now merged, what about this proposal? |
Build a graph of all the shared modules and rollup each bundle as far down as possible. Then use ES module imports to load the shared bundles. For browsers that do no support ES modules it'll fallback to the current process.
The text was updated successfully, but these errors were encountered: