Skip to content

chore: switch to Yarn 3 - #3819

Merged
rjsparks merged 6 commits into
ietf-tools:mainfrom
NGPixel:yarn-berry
Apr 25, 2022
Merged

chore: switch to Yarn 3#3819
rjsparks merged 6 commits into
ietf-tools:mainfrom
NGPixel:yarn-berry

Conversation

@NGPixel

@NGPixel NGPixel commented Apr 13, 2022

Copy link
Copy Markdown
Member

Replaces NPM with Yarn 3 as the package manager.

This new setup enables zero-install and PNP capabilities:

  • Nothing to install (no npm install) for new users or when fetching new code. Enables fully offline use.
  • Precompiled dependencies for any combination of macOS, Linux, Windows + x64, arm64 are included.
  • No node_modules black hole:
    image

@phitattoo phitattoo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ngpixel:yarn-berry

@@ -1 +1,2039 @@
import "bootstrap-datepicker/js/bootstrap-datepicker.js";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This diff seems to pull in the entire source, rather than include by reference?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as it's been causing issues in some scenarios.

Because that package is being fetched directly from GitHub, it uses ssh when cloning the repo. That process sometime fails because of incorrect ssh settings on the host.

There's also the issue that there's no versioning as it always fetch whatever is currently on GitHub. A change there could easily break the build.

So while not ideal, including the source directly is the best option for now to address both issues. These files will eventually go away once we get rid of jquery.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are planning to get rid of jquery?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point yes, as pages get refactored to more modern frameworks like Vue.js.

There's really no reason nowadays to use jquery. All browsers implement the querySelector methods. In fact, Bootstrap 5 no longer relies on jquery either.

Other bits that we currently use like scroll to element and scroll spy have native implementations now via scrollIntoView() and the IntersectionObserver class. Both offers much better performance than their jquery counterparts.

@NGPixel NGPixel changed the title Switch to Yarn 3 chore: switch to Yarn 3 Apr 14, 2022
@NGPixel
NGPixel changed the base branch from feat/bs5 to main April 14, 2022 19:31
@rjsparks
rjsparks merged commit 8ea883c into ietf-tools:main Apr 25, 2022
@NGPixel
NGPixel deleted the yarn-berry branch April 25, 2022 21:13
@larseggert

Copy link
Copy Markdown
Collaborator

I just realized that this commit removed the caret from the version numbers in package.json. @NGPixel, how do we now upgrade the assets? A bunch of them had bugfix releases in the meantime.

@NGPixel

NGPixel commented May 12, 2022

Copy link
Copy Markdown
Member Author

@larseggert You can upgrade packages using the command yarn upgrade-interactive, which will display something similar to:

image

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants