Skip to content

Commit

Permalink
[PC-828] Update to Yarn2 (no PnP yet)
Browse files Browse the repository at this point in the history
Summary:
Upgrades Yarn to version 2 following [these instructions](https://yarnpkg.com/getting-started/migration). Doesn't add PnP just yet since that's big enough for its own diff.
Results: a noticeably faster but not lightning-fast install; slightly faster build; bundle runs a bit smoother in the browser too (this is partly due to dropping `@pixie-labs/components` earlier).

Test Plan: `yarn install && yarn dev`. `yarn test`. Everything should work as it did before, but a bit faster and smoother.

Reviewers: michelle, vihang, #third_party_approvers

Reviewed By: michelle, #third_party_approvers

JIRA Issues: PC-828

Differential Revision: https://phab.corp.pixielabs.ai/D8897

GitOrigin-RevId: 0ba438c
  • Loading branch information
NickLanam authored and copybaranaut committed Jun 10, 2021
1 parent 4f85e7a commit 2c39ba8
Show file tree
Hide file tree
Showing 12 changed files with 19,308 additions and 14,132 deletions.
1 change: 1 addition & 0 deletions .arclint
Expand Up @@ -13,6 +13,7 @@
"(^experimental/users/)",
"(^src/stirling/bpf_tools/bcc_bpf/system-headers)",
"(^src/stirling/mysql/testing/.*\\.json$)",
"(^src/ui/.yarn/)",
"(^src/ui/offline_package_cache)",
"(^src/ui/src/segment.js$)",
"(^src/ui/src/types/generated/)",
Expand Down
3 changes: 2 additions & 1 deletion .idea/pixielabs.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bazel/ui.bzl
Expand Up @@ -48,7 +48,7 @@ def _pl_webpack_deps_impl(ctx):

cmd = ui_shared_cmds_start + [
"export OUTPUT_PATH=" + ctx.outputs.out.path,
"yarn install --prefer_offline &> build.log",
"yarn install --immutable &> build.log",
"tar -czf ${BASE_PATH}/${OUTPUT_PATH} node_modules .",
] + ui_shared_cmds_finish

Expand Down
1 change: 1 addition & 0 deletions codecov.yml
@@ -1,5 +1,6 @@
---
ignore:
- "src/ui/.yarn"
- "src/ui/src/testing"
- "src/ui/src/types/generated"
- "third_party"
1 change: 1 addition & 0 deletions src/ui/.eslintignore
Expand Up @@ -2,3 +2,4 @@ __snapshots__
node_modules
src/types/generated
src/segment.js
.yarn
7 changes: 7 additions & 0 deletions src/ui/.gitignore
Expand Up @@ -10,3 +10,10 @@ junit.xml
# Yarn/npm files.
node_modules
yarn-error.log
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
55 changes: 55 additions & 0 deletions src/ui/.yarn/releases/yarn-2.4.2.cjs

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions src/ui/.yarnrc

This file was deleted.

3 changes: 3 additions & 0 deletions src/ui/.yarnrc.yml
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-2.4.2.cjs
16 changes: 6 additions & 10 deletions src/ui/BUILD.bazel
Expand Up @@ -28,10 +28,10 @@ UI_DEP_PACKAGES = [
"yarn.lock",
"package.json",
".babelrc.json",
".yarnrc",
".yarnrc.yml",
] + glob([
"offline_package_cache/**",
"patches/**",
"node_modules/**",
".yarn/**",
])

UI_SRCS = glob([
Expand All @@ -41,23 +41,19 @@ UI_SRCS = glob([
"src/**",
])

COMPONENT_SRCS = glob([
"packages/**",
])

LICENSES_SRCS = [
"tools/licenses/npm_license_extractor.py",
]

pl_webpack_deps(
name = "ui-deps",
srcs = UI_DEP_PACKAGES + COMPONENT_SRCS,
srcs = UI_DEP_PACKAGES,
uilib_base = "src/ui",
)

pl_webpack_library(
name = "ui-bundle",
srcs = UI_SRCS + COMPONENT_SRCS,
srcs = UI_SRCS,
licenses = "//tools/licenses:all_licenses",
stamp = select({
"//bazel:stamped": True,
Expand All @@ -69,7 +65,7 @@ pl_webpack_library(

pl_ui_test(
name = "ui-tests",
srcs = UI_SRCS + COMPONENT_SRCS,
srcs = UI_SRCS,
uilib_base = "src/ui",
deps = ":ui-deps",
)
Expand Down
2 changes: 1 addition & 1 deletion src/ui/package.json
Expand Up @@ -126,7 +126,7 @@
"moment": "^2.24.0",
"monaco-editor": "0.20.0",
"numeral": "^2.0.6",
"oidc-client":"^1.11.5",
"oidc-client": "^1.11.5",
"postinstall-postinstall": "^2.1.0",
"prism-react-renderer": "^1.0.2",
"prop-types": "^15.5.4",
Expand Down

0 comments on commit 2c39ba8

Please sign in to comment.