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

Why survey.jquery.js is so big (6.54 MiB)? #3075

Closed
stephane-klein opened this issue Jul 10, 2021 · 10 comments · Fixed by #5737
Closed

Why survey.jquery.js is so big (6.54 MiB)? #3075

stephane-klein opened this issue Jul 10, 2021 · 10 comments · Fixed by #5737
Assignees
Labels
Milestone

Comments

@stephane-klein
Copy link

Hi,

When I build survey-jquery in my survey-jquery-webpack-playground I see:

$ yarn build:js
yarn run v1.22.10
$ webpack --mode=production
Webpack Bundle Analyzer is started at http://127.0.0.1:8888
Use Ctrl+C to close it
Hash: f8b2894639b5cbdb3923
Version: webpack 4.46.0
Time: 1027ms
Built at: 10/07/2021 21:42:48
  Asset      Size  Chunks                    Chunk Names
main.js  1.43 MiB       0  [emitted]  [big]  main
Entrypoint main [big] = main.js
[0] ./node_modules/jquery/dist/jquery.js 282 KiB {0} [built]
[1] ./node_modules/survey-jquery/survey.jquery.js 6.54 MiB {0} [built]
[2] ./node_modules/css-loader/dist/runtime/api.js 2.46 KiB {0} [built]
[3] ./src/main.js 1.06 KiB {0} [built]
[4] ./node_modules/survey-jquery/survey.min.css 498 bytes {0} [built]
[5] ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js 6.67 KiB {0} [built]
[6] ./node_modules/css-loader/dist/cjs.js!./node_modules/survey-jquery/survey.min.css 23.4 KiB {0} [built]

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  main.js (1.43 MiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  main (1.43 MiB)
      main.js


WARNING in webpack performance recommendations:
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

Question: why survey.jquery.js 6.54 MiB is so big? 🤔

Best regards,
Stéphane

@stephane-klein
Copy link
Author

Do you have any idea why it ? @andrewtelnov @dmitrykurmanov

@andrewtelnov
Copy link
Member

@stephane-klein It is with debug info. You can make it smaller by removing questions like matrices, in fact grids, and localizations files from entry files.
SurveyJS is one of the most powerfull survey/form JavaScript library, if not the most.

Thank you,
Andrew

@stephane-klein
Copy link
Author

It is with debug info

@andrewtelnov how can I disable it?

You can make it smaller by removing questions like matrices, in fact grids, and localizations files from entry files.

I looked all around… but I have not found, can you show me the way?

SurveyJS is one of the most powerfull survey/form JavaScript library, if not the most.

Yes, I know, thanks 💪🤗

@tsv2013
Copy link
Member

tsv2013 commented Jul 12, 2021

@stephane-klein You can use minified version - survey.jquery.min.js

@frimmy
Copy link

frimmy commented Feb 13, 2023

related - survey-core is very large -- anyway to reduce the size?

@andrewtelnov
Copy link
Member

Please use minimized version.

Thank you,
Andrew

@frimmy
Copy link

frimmy commented Feb 13, 2023

thank you, @andrewtelnov .
is the minified version available on npm? I'm using the react client.

@dmitry-kurmanov
Copy link
Member

thank you, @andrewtelnov . is the minified version available on npm? I'm using the react client.

yes of course, you could find the minified version here https://unpkg.com/browse/survey-core/survey.core.min.js
and here is the all package content: https://unpkg.com/browse/survey-core/

Thank you,
Dmitry

@frimmy
Copy link

frimmy commented Feb 15, 2023

thank you, @andrewtelnov . is the minified version available on npm? I'm using the react client.

yes of course, you could find the minified version here https://unpkg.com/browse/survey-core/survey.core.min.js and here is the all package content: https://unpkg.com/browse/survey-core/

Thank you, Dmitry

@dmitrykurmanov This is not quite what I'm looking for since I'm bundling survey-js dependencies as part of a single-page web app.

For the npm registry, is there a minified version for use in node-based projects?

Currently, the survey-core dependency is over ~6 MBs. this combined with using survey-creator-core (5.46MB) + survey-creator-react and survey-react-ui (.5MB and 1.24MB) makes including these dependencies expensive from a bundling perspective.

@tsv2013 tsv2013 self-assigned this Feb 16, 2023
@OlgaLarina OlgaLarina modified the milestones: v1.9.75, v1.9.76 Feb 16, 2023
@OlgaLarina OlgaLarina modified the milestones: v1.9.76, v1.9.77 Feb 28, 2023
@OlgaLarina OlgaLarina self-assigned this Feb 28, 2023
OlgaLarina pushed a commit that referenced this issue Mar 6, 2023
@OlgaLarina OlgaLarina linked a pull request Mar 6, 2023 that will close this issue
@tsv2013
Copy link
Member

tsv2013 commented Mar 6, 2023

We extracted map files from unminified build results. For survey-jquery right now script became 2.5M, map file - 3.5M. This should help to some extent. If you need to reduce bundle size more, you can clone this repo and create a custom build.

tsv2013 pushed a commit that referenced this issue Mar 6, 2023
Co-authored-by: OlgaLarina <olga.larina.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants