Having lighter bundle alongside catching libraries in separated bundle file(s).
See original GitHub issueAfter many searches and studying a lot of ReactJS starters, I find out this Starter is awesome and scalable. but I have some questions/sights about bundling.
I implemented a starter and when I run yarn build
in my starter, these files are built:
- server.js: a bundled file just for the node in the server-side
- vendor.js: a vendor bundle that contains
react
,react-dom
,redux
, … and etc. - client.js: a bundle file that contains just the application code.
Number One: in the react-cool-starter
the ts-node
read the server.tsx
at the production moment and there isn’t a bundled file for running codes from the node server.
- suggestion: It could be better we have a server-side bundle that contains the whole application, so it will be clean JavaScript and there is no need to have
ts-node
in server and it will be easier to havepm2
for large scale projects
Number Two: It could be awesome, that we have a bundle that contains the libraries which we used in our project, we could use service worker to cache until the next version, when we have the next version? _when we update or add/remove packages. Even we can split the vendor.js
file to several files, but still, all of them should be cached until the next version. this way could help us to have a lighter bundle of application because the application continuously is changing but the vendor changes happen over time.
Number three: by describing number two, this part became obvious. now with the decoupled application codes from vendors, we have a very light application bundle. and it will be great. because when we develop new features the application bundles will update in client service worker but the vendors remain and user have a better experience in interacting with the website.
So, Dear @wellyshen, what’s your opinion about these concepts? Are you agreed, if yes I’m ready to make some critical changes to have these concepts in react-cool-starter
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
@amerllica Sorry for typo I mean the v5. Sure, go ahead for your idea. If you can give me a minimal POC, I can better to understand it.
@amerllica We can keep it for features reference.