occiware / OCCInterface

OCCI API developer online playground
MIT License
3 stars 1 forks source link

[QA] reduce dependencies when frontend only mode #4

Closed jeanparpaillon closed 8 years ago

jeanparpaillon commented 8 years ago

When built as erocci frontend, OCCInterface pulls a lot of unneeded dependancies (server side, I suppose).

frontend mode should get rid of server side deps (and maybe some others).

Reducing deps implies:

From a fresh install and build:

$ du -hs node_modules/
150M    node_modules/
$ ls node_modules/ | wc -l
764

-> problems of maintainability / security...

Unacceptable weight for a simple frontend:

$ du -hs dist/
2,8M    dist/
Romathonat commented 8 years ago

Well, it does not really depends on me, node project are often super heavy with node_modules (dependencies require other dependencies...). OCCinterface needs some dependencies because it is not a "simple" frontend (like an HTML page...), but a complete app ! I'll check what I can do but I am not sure I can do way better :/

jeanparpaillon commented 8 years ago

At least, you can remove server-side deps (maybe in a specific frontend-only mode ?) And maybe the problem comes from the build tool ? gulp, grunt or other instead of npm ?

I'm working on similar in technology (react.js, webpack, etc), but much more consequent in term of pages and components, projects where size is at max 1/3rd from this

Concrete issues are:

Romathonat commented 8 years ago

For the user the download size is not 2.8MB, it is ~280kB (look at firebug) for bundle.js. With --production flag on npm install, we can go down to 116MB. Removing server side (express) : 114 MB. (nearly nothing to gain seeing the work needed to change the project). We'll look at it later, but I am quite pessimistic.

Romathonat commented 8 years ago

I managed to reduce to ~77MB. Next improvement could let us go down to 55M.

jeanparpaillon commented 8 years ago

:+1: You can do it ;)

Romathonat commented 8 years ago
du -hs deps/erocci_frontend/node_modules/
53M deps/erocci_frontend/node_modules/

Does it seems acceptable? If yes, you can close :)

jeanparpaillon commented 8 years ago

Nice :)