-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Bug: Lazy loading components causes unnecessary webpack chunks #360
Comments
This is one of the breaking changes. |
The reasoning behind the change is that those resources are not mandatory for the dialog to function. |
Perfect 👍 I'm only using a subset of the resources anyway (attachFocus mostly). I tried removing the |
Btw, what is the correct path to be using to include just some resources, ie |
I found out. What you can't learn by looking at the tests of the project :D (For those whose looking, use the local name of the resource ie |
HOWEVER, this does not bundle it into the production build. My guess is that the bundling magic happens in the When I try to add SolutionAdd
on your |
The sole purpose of all the changes around the resources was to drop the usage of
|
Also the docs have been updated, but are not published to aurelia.io. |
Makes sense to be independent of the PLATFORM-syntax, but as you see it has consequences. Not using the CLI and merely a plain and simple webpack config, this change makes it necessary to do the changes written in my above post to avoid both the default import of the chunks and explicit import of other resources. |
Some thoughts:
import resources from "aurelia-dialog/default-resources";
dialogConfig.useResources(resources); |
For @jods4 with that said do you think we can go with |
If you go with Then users who want to drop them will have to resort to some Webpack plugin (does that count as black magic?) Note that you can avoid mappings if you publish those modules at the root of your npm module instead of |
@jods4 I don't see how they can be moved to the root, we do have different builds What I want to understand is which case would require less work/be more simple:
|
Right... silly me, I was in a context where I just deliver standard ES to everyone. Having mutliple distributions make things more complicated of course. I guess merging chunks would be a plugin, too. |
I'm submitting a bug report
2.0.0-rc.x
Please tell us about your environment:
Operating System:
Ubuntu Linux
Node Version:
9.11.1
6.1.0
webpack 4.17.1
Browser:
all
Language:
TypeScript 3.X
Current behavior:
Upon production build we receive lazyloaded chunks for all dialog components. This is most likely due to the change made in https://github.com/aurelia/dialog/pull/354/files#diff-0ba886733b618be0416988ba431fb6f1L9
Expected/desired behavior:
What is the expected behavior?
The 1.x version automatically bundled within the app.js-chunk due to the loading mechanisms used.
What is the motivation / use case for changing the behavior?
Adding five minimal chunks adds unnecessary overhead and roundtrips to the server and should by default be unlazy.
The text was updated successfully, but these errors were encountered: