Closed m4dz closed 8 years ago
@m4dz Could you remove the build files? It makes the review hard to do.
@frankrousseau I've suppressed the build removing from the PR. I'll open another PR for the clean (build and locales) as long as we don't push build and locales to other branches than master anymore.
Thank you for removing the build. About the folder name change, I prefer we stick to our current convention. Including too many changes at the same time will create more chaos. Introducing webpack already brings enough changes.
About static folder convention, Webpack will copy assets only if are referenced by a module (there's a "copy plugon" but it wll introduce mess in our files management if we mix in the same folder assets used by modules and those whose aren't). So, I think we'll need to keep those assets separately. We can continue to produce a client/public
folder for hosting assets (instead of my static
choice) but where can we keep assets not refercned (like favicons or fonts)? I suggest:
public
folder at root that contain them (same as now, just rename static
to public
)client/vendor
folder from which all assets
folder(s) will be copied directly to the build/public
(a-la-brunch) (maybe using the copy plugin).I think the 2. is a little bit more complicated but is the more reliable from our current use in _brunch_ed projects. @frankrousseau, any pref?
I want to keep everything related to browser in the client folder. Subfolders can organized the way you want, but please keep the client and server separation.
Currently, I don't have much time to review the full thing. But from what I understand the second solution looks to follow our current convention. If that's the case, ok for it.
Done!
Looks good to me.
Before: 367K (87K for app.js + 280K for vendor.js) After: 244K for app.[hash].js
Nice size reduction. Thanks @m4dz!
Nice size reduction
I also ask myself to enable compression using gzip in proxy server part, but as long as proxy serves all apps responses, it means enable it for all apps at one time. Should be ok, but I'll try it later in another PR to check if it's really good :smile:.
This PR introduces Webpack for frontend build. It supports in this current configuration:
production
build modePros:
Cons:
My thoughs: even with their efforts, Brunch@2.x is still unstable with NPM deps, and sometimes make corrupted builds on watch mode. I didn't encounter this kind of issues with webpack (very fast and stable) and I think the final codebase is more robust (all deps declared, splitted code, etc). The config stay verbose, but can be easily deployed across our apps in a standard base config and can be customized after.
This PR is fully functionnal but serves as a POC for next ideations :smiley:.