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

Lazy load #270

Merged
merged 13 commits into from
Jun 7, 2020
Merged

Lazy load #270

merged 13 commits into from
Jun 7, 2020

Conversation

aminya
Copy link
Contributor

@aminya aminya commented May 5, 2020

  • Using Rollup and dynamic imports:
  • I separated/refactored the part that checks if package-deps are installed from the part that installs the package-deps
  • the whole check part is bundled into a single file and will be always loaded
  • the install/prompt part is only loaded on demand.

Because many packages depend on package-deps, I think this optimization will benefit the whole Atom ecosystem.

This is tested and works as expected. It reduces the load time of a test package by 12ms (using require("atom-package-deps").install):
before
2020-05-05 22_33_27-Timecop — C__Users_yahyaaba_Documents_GitHub_JavaScript_atom-ide-community_atom-
after
2020-05-05 22_37_29-Timecop — C__Users_yahyaaba_Documents_GitHub_JavaScript_atom-ide-community_atom-

Small other changes:

  • I did not change any of the helper codes. I just moved them to separate files.
  • use files in package.json instead of putting every folder in npmignore
  • renamed compile in scripts to debug

@aminya aminya marked this pull request as ready for review May 5, 2020 19:16
@aminya
Copy link
Contributor Author

aminya commented May 12, 2020

Any feedback on this? This is ready

@steelbrain
Copy link
Owner

Thank you for working on this, looks good, I'll review/merge this weekend

@steelbrain steelbrain self-requested a review May 12, 2020 22:50
@aminya
Copy link
Contributor Author

aminya commented May 29, 2020

By targeting electron 5, package-deps is now even faster.

@aminya
Copy link
Contributor Author

aminya commented Jun 7, 2020

@steelbrain Any update on this? This is a small change. I just moved the code to different files, and I used dynamic import in the main file.

@steelbrain
Copy link
Owner

I'll review within the next 24 hours :)

@steelbrain steelbrain changed the base branch from master to integrate-rollup June 7, 2020 17:24
@steelbrain steelbrain merged commit 003a4fd into steelbrain:integrate-rollup Jun 7, 2020
@steelbrain
Copy link
Owner

Applied some touchups in #281

@aminya
Copy link
Contributor Author

aminya commented Jun 8, 2020

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants