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

feat: use hoisted yarn install in binary build #17285

Merged
merged 28 commits into from
Nov 20, 2021

Conversation

tgriesser
Copy link
Member

@tgriesser tgriesser commented Jul 12, 2021

Second attempt of #17132, which was reverted due to failure bundling for mac & windows

Additional details

Runs the "yarn install" from the root of the packages to de-duplicate node requires via hoisting. Reduces the overall bundle size by a considerable margin ~80mb, and the compressed app by ~30mb.

Main changes:

  • Moved install path to path.join(os.tmpdir(), 'cypress-build', PLATFORM) with a symlink to build in the root for convenience (per @brian-mann request)
  • Loosen semver ranges from pinned to ^ for better deduplication of dependencies
  • Copy yarn.lock from the root before yarn --production to ensure we are building with the same dependencies we have in the lockfile for develop/testing (allows us to use the ^ rather than pinned versions with more confidence)
  • Removes additional unused directories or files demo / test that are taking up space, primarily in image libraries

How has the user experience changed?

  • Smaller bundle
  • Faster install time

Before:

Screen Shot 2021-06-28 at 2 12 53 PM

After:

Screen Shot 2021-06-28 at 2 13 03 PM

PR Tasks

  • Have tests been added/updated?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 12, 2021

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Jul 12, 2021



Test summary

4241 0 47 0Flakiness 0


Run details

Project cypress
Status Passed
Commit a2c3255
Started Nov 20, 2021 7:14 PM
Ended Nov 20, 2021 7:24 PM
Duration 09:49 💡
OS Linux Debian - 10.10
Browser Chrome beta 96

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

* develop: (329 commits)
  chore: Update Chrome (stable) to 96.0.4664.45 (#18931)
  fix: Loading of specs with % in the filename (#18877)
  chore: refactor `create` into class `$Cy` (#18715)
  chore: Update Chrome (beta) to 96.0.4664.45 (#18891)
  fix: flaky `system-tests-firefox` job (#18848)
  release 9.0.0
  feat: ensure major release
  have conduit app wait on localhost:3000
  fix install-required-node
  use --legacy-peer-deps
  feat: ensure major release
  fix darwin node install
  chore(driver): fix integration test retry configuration (#18643)
  feat(deps): update dependency electron to v15 🌟 (#18317)
  chore: Bind this correctly when setting response headers with cy.route() (#18859)
  feat: create config package for config validation (#18589)
  chore: patch `winston` to suppress `padLevels` warning (#18824)
  chore: test out major release build
  fix: remove outdated npm registry links (#18727)
  fix: Adding an existing command with `Cypress.Commands.add()` will throw an error (#18587)
  ...
@tgriesser tgriesser marked this pull request as ready for review November 19, 2021 14:57
@tgriesser tgriesser requested a review from a team as a code owner November 19, 2021 14:57
@tgriesser tgriesser requested review from jennifer-shehane and a team and removed request for a team and jennifer-shehane November 19, 2021 14:57
cli/package.json Outdated Show resolved Hide resolved
@tgriesser tgriesser changed the title chore: use hoisted yarn install in build binary feat: use hoisted yarn install in build binary Nov 19, 2021
mjhenkes
mjhenkes previously approved these changes Nov 19, 2021
@tgriesser tgriesser changed the title feat: use hoisted yarn install in build binary feat: use hoisted yarn install in binary build Nov 20, 2021
@tgriesser tgriesser merged commit e4f5b10 into develop Nov 20, 2021
@tgriesser tgriesser deleted the tgriesser/build/root-yarn-install branch November 20, 2021 19:19
tgriesser added a commit that referenced this pull request Nov 20, 2021
* develop: (52 commits)
  feat: use hoisted yarn install in binary build (#17285)
  fix: compile npm packages for node 12 (#18989)
  fix: show call count even if `cy.stub().log(false)`. (#18907)
  chore: Update TypeScript to 4.4.4 (#18930)
  fix: wrap playground selectors in double quotes if not included (#18442)
  fix: flaky settings_spec test (#18979)
  chore: Update Chrome (stable) to 96.0.4664.45 (#18931)
  fix: Loading of specs with % in the filename (#18877)
  chore: refactor `create` into class `$Cy` (#18715)
  chore: Update Chrome (beta) to 96.0.4664.45 (#18891)
  fix: flaky `system-tests-firefox` job (#18848)
  chore: release @cypress/webpack-preprocessor-v5.10.0
  chore: release @cypress/vue-v3.0.5
  chore: release @cypress/schematic-v1.6.0
  chore: release create-cypress-tests-v1.2.0
  release 9.0.0
  feat: ensure major release
  have conduit app wait on localhost:3000
  fix install-required-node
  use --legacy-peer-deps
  ...
tgriesser added a commit that referenced this pull request Nov 21, 2021
* 10.0-release: (56 commits)
  chore: post-merge cleanup
  feat: use hoisted yarn install in binary build (#17285)
  fix: fix spec list header, "Create specs" prompt, add workspace recommended apollo extension (#18993)
  feat(unify): reporter settings (#18946)
  feat: add devServer to config file (#18962)
  fix: compile npm packages for node 12 (#18989)
  fix: show call count even if `cy.stub().log(false)`. (#18907)
  chore: Update TypeScript to 4.4.4 (#18930)
  fix: wrap playground selectors in double quotes if not included (#18442)
  fix: flaky settings_spec test (#18979)
  chore: Update Chrome (stable) to 96.0.4664.45 (#18931)
  fix: Loading of specs with % in the filename (#18877)
  chore: refactor `create` into class `$Cy` (#18715)
  chore: Update Chrome (beta) to 96.0.4664.45 (#18891)
  fix: flaky `system-tests-firefox` job (#18848)
  chore: release @cypress/webpack-preprocessor-v5.10.0
  chore: release @cypress/vue-v3.0.5
  chore: release @cypress/schematic-v1.6.0
  chore: release create-cypress-tests-v1.2.0
  release 9.0.0
  ...
tgriesser added a commit that referenced this pull request Nov 21, 2021
…e-data-clean-refactor

* tgriesser/chore/e2e-data-clean: (76 commits)
  chore: post-merge cleanup
  feat: use hoisted yarn install in binary build (#17285)
  fix: fix spec list header, "Create specs" prompt, add workspace recommended apollo extension (#18993)
  feat(unify): reporter settings (#18946)
  feat: add devServer to config file (#18962)
  fix: compile npm packages for node 12 (#18989)
  fix: show call count even if `cy.stub().log(false)`. (#18907)
  chore: Update TypeScript to 4.4.4 (#18930)
  feat: use fuzzy search (#18966)
  fix: onUnmounted warning in topnav (#18988)
  fix: wrap playground selectors in double quotes if not included (#18442)
  fix: flaky settings_spec test (#18979)
  fix: CYPRESS_INTERNAL_VITE_DEV for development
  feat: Create default config file (#18943)
  feat(app): support editor preference (#18932)
  chore: Update Chrome (stable) to 96.0.4664.45 (#18931)
  fix: Loading of specs with % in the filename (#18877)
  feat: improve vite DX (#18937)
  chore: refactor `create` into class `$Cy` (#18715)
  feat: Use plugins on config files (#18798)
  ...
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.

4 participants