Kiho / react-form-builder

A complete react form builder that interfaces with a json endpoint to load and save generated forms. The toolbox contains 16 items for gathering data. Everything from star ratings to signature boxes!
MIT License
466 stars 344 forks source link

remove node-sass (slow-deps) to speed up npm install #290

Closed theshadow27 closed 9 months ago

theshadow27 commented 10 months ago

The node-sass library is very slow to install in ci/cd environment and most of the functions are available through the plain sass package. Here, the only usage was in the post-install script which could easily be changed. This should shave 2-10 minutes of npm ci time.

Background info on root cause is here: https://dev.to/limal/node-sass-considered-harmful-4fjb

slow-deps Before this change

8901 react-form-builder ±(master)  ➜ slow-deps              [20231120 02:33:37]
Analyzing 52 dependencies...
[====================] 100% 0.0s
------------------------------------------------------------------------
| Dependency                              | Time     | Size   | # Deps |
------------------------------------------------------------------------
| node-sass                               | 2m 19.9s | 151 MB | 215    |
| date-fns                                | 8.4s     | 7.4 MB | 3      |
| eslint-config-airbnb                    | 6.3s     | 27 MB  | 215    |
| webpack-dev-server                      | 5.9s     | 30 MB  | 215    |
| eslint-plugin-react                     | 5.4s     | 17 MB  | 186    |
| eslint-plugin-jsx-a11y                  | 5.2s     | 21 MB  | 184    |
| eslint                                  | 4.9s     | 19 MB  | 115    |
| eslint-plugin-import                    | 4.8s     | 18 MB  | 172    |
| babel-loader                            | 4.4s     | 28 MB  | 87     |
...

After this change

8902 react-form-builder ±(master)  ➜ slow-deps              [20231120 02:38:40]
Analyzing 51 dependencies...
[====================] 100% 0.0s
---------------------------------------------------------------------
| Dependency                              | Time  | Size   | # Deps |
---------------------------------------------------------------------
| date-fns                                | 18.7s | 7.4 MB | 3      |
| webpack-dev-server                      | 9s    | 30 MB  | 215    |
| eslint-config-airbnb                    | 7.2s  | 27 MB  | 215    |
| eslint-plugin-react                     | 6.5s  | 17 MB  | 186    |
| eslint-plugin-jsx-a11y                  | 6.1s  | 21 MB  | 184    |
| @babel/preset-env                       | 5.9s  | 15 MB  | 52     |
| eslint-plugin-import                    | 5.5s  | 18 MB  | 172    |
| webpack-cli                             | 5.5s  | 21 MB  | 92     |
| eslint                                  | 5.1s  | 19 MB  | 115    |
...
Kiho commented 9 months ago

Thanks for PR.