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

The library builds need optimization fix #58

Closed
birdofpreyru opened this issue Feb 15, 2020 · 5 comments
Closed

The library builds need optimization fix #58

birdofpreyru opened this issue Feb 15, 2020 · 5 comments
Labels
P1 High priority. Important thing to focus on.

Comments

@birdofpreyru
Copy link
Owner

The way these libraries are used afterwards, they only rely on Webpack compiled bundles.

@birdofpreyru birdofpreyru added the P2 Important. Nice to have improvements and optimizations. label Feb 15, 2020
@birdofpreyru
Copy link
Owner Author

My bad, only client-side uses the webpack bundle, and the server-side uses the compiled modules

@birdofpreyru
Copy link
Owner Author

But, do what extend the webpack bundles are used? Probably, the Webpack build just serves to compile SCSS...

@birdofpreyru birdofpreyru reopened this Feb 15, 2020
@birdofpreyru birdofpreyru changed the title Check, why compiled modules are included into library builds The library builds need optimization fix Feb 15, 2020
@birdofpreyru birdofpreyru added P1 High priority. Important thing to focus on. and removed P2 Important. Nice to have improvements and optimizations. labels Feb 15, 2020
@birdofpreyru
Copy link
Owner Author

The current understanding:

  • At some point, only Webpack bundles were created and used both by the front- and back-end imports;
  • Later it was changed with intention to rely on modules server-side, but the changed flawed, resulting in both library modules, and webbundle being bundled in the end-apps.
  • It seems, it may be possible to not bundle JS in the libraries by webpack at all, but the problem is CSS - the current setup relies on library compilation by Webpack to correctly compile SCSS > CSS, and handling of CSS modules.

@birdofpreyru birdofpreyru added the On Hold Blocked by another ticket / issue / etc. label Feb 16, 2020
@birdofpreyru
Copy link
Owner Author

This needs to wait for the release of Webpack@5 and support of ES5 modules as library target in there. Then it will be possible to update the build process to bundle client-side code in a better way. Still need a separate server-side build.

@birdofpreyru birdofpreyru removed the On Hold Blocked by another ticket / issue / etc. label Feb 16, 2020
@birdofpreyru
Copy link
Owner Author

After some more testing, this should not be a problem, if the entry point of a library is written in a very specific way, which allows Webpack to drop unnecessary code compile time in each particular case, and also allows Node to load the server-side version of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority. Important thing to focus on.
Projects
None yet
Development

No branches or pull requests

1 participant