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

Audit code and reduce build size #386

Closed
4 tasks
brylie opened this issue Jan 26, 2022 · 11 comments · Fixed by #468
Closed
4 tasks

Audit code and reduce build size #386

brylie opened this issue Jan 26, 2022 · 11 comments · Fixed by #468
Assignees
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing feature good first issue New-contributor friendly help wanted Open to participation from the community 🟨 priority: medium Not blocking but should be fixed soon 🏁 status: ready for work Ready for work

Comments

@brylie
Copy link
Contributor

brylie commented Jan 26, 2022

While building the Chooser as a component, there are several asset size limit warnings, such as the following:

warning

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
license-chooser.min.js (1.75 MiB)

warning

entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
license-chooser (2.51 MiB)
license-chooser.js

Task

  • audit the chooser codebase to look for any code or dependencies that can be removed to reduce the bundle size
  • determine if an alternative project configuration, such as tree-shaking, might be implemented to reduce bundle size
  • discuss findings to determine which changes to make
  • make desired changes to reduce bundle size
@brylie brylie added 🟩 priority: low Low priority and doesn't need to be rushed 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work ✨ goal: improvement Improvement to an existing feature 💻 aspect: code Concerns the software code in the repository good first issue New-contributor friendly help wanted Open to participation from the community 🟧 priority: high Stalls work on the project or its dependents and removed 🟩 priority: low Low priority and doesn't need to be rushed 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Jan 26, 2022
@brylie brylie changed the title Audit and reduce build size Audit code and reduce build size Jan 26, 2022
@cc-open-source-bot cc-open-source-bot added 🏷 status: label work required Needs proper labelling before it can be worked on and removed 🏷 status: label work required Needs proper labelling before it can be worked on labels Jan 27, 2022
@cc-open-source-bot cc-open-source-bot added 🏷 status: label work required Needs proper labelling before it can be worked on and removed 🏷 status: label work required Needs proper labelling before it can be worked on labels Feb 5, 2022
@cc-open-source-bot cc-open-source-bot added the 🏷 status: label work required Needs proper labelling before it can be worked on label Feb 13, 2022
@cc-open-source-bot cc-open-source-bot added 🏷 status: label work required Needs proper labelling before it can be worked on and removed 🏷 status: label work required Needs proper labelling before it can be worked on labels Feb 11, 2023
@cc-open-source-bot cc-open-source-bot added 🏷 status: label work required Needs proper labelling before it can be worked on and removed 🏷 status: label work required Needs proper labelling before it can be worked on labels Feb 18, 2023
@Cronus1007
Copy link
Member

@possumbilities @TimidRobot Shall I pick up this issue?

@TimidRobot TimidRobot added 🏁 status: ready for work Ready for work 🟨 priority: medium Not blocking but should be fixed soon and removed 🏷 status: label work required Needs proper labelling before it can be worked on 🟧 priority: high Stalls work on the project or its dependents labels Feb 23, 2023
@possumbilities
Copy link
Contributor

@Cronus1007 feel free to tackle it, and thankyou! ❤️

@Cronus1007
Copy link
Member

Cronus1007 commented Mar 12, 2023

@possumbilities Unused dependencies which I was able to find are

  1. bulma
  2. core-js
  3. sass
  4. clipboardy
  5. eslint-plugin-prettier

While running npm run build-component it gives

warning

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
license-chooser.min.js (1.25 MiB)

warning

entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
license-chooser (1.79 MiB)
license-chooser.js

Screenshots

Screenshot from 2023-03-12 21-47-47

@possumbilities
Copy link
Contributor

@Cronus1007 I could be wrong, but could you provide more info. It seems like several of those are in use in the dependency chain somewhere.

I thought clipboardy was how the clipboard copy works within the Chooser. I thought the sass and bulma dependencies are necessary for the app/site since it's utilizing Vocabulary.

The other two I'm not sure on. Is there some kind of output or report indicating that they are indeed not used at all?

@Cronus1007
Copy link
Member

@possumbilities I used the npm dependency i.e. depcheck for checking the unused dependencies. It listed several dependencies and then I went through the codebase checking out the dependencies used which took me to this conclusion. Also when I ran the project after removing these dependencies it went well. Both the serve script and build script were working as previously. I don't think any functionality has been broken due to this.

I have a solution for this let me create a branch and commit my changes you could have a look at the build of that branch and if you feel that some functionality has been broken then we can revert everything. Right now I am working on treeshaking in order to reduce the build size as well.

@possumbilities
Copy link
Contributor

@Cronus1007 that's a good idea, I'm happy to test the branch

@Cronus1007
Copy link
Member

@possumbilities Sure I am on it.

@Pursottam6003
Copy link

I would like to work on it @possumbilities if its possible please assign me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing feature good first issue New-contributor friendly help wanted Open to participation from the community 🟨 priority: medium Not blocking but should be fixed soon 🏁 status: ready for work Ready for work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants