Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into nolan/synthetic-in-…
Browse files Browse the repository at this point in the history
…hydration
  • Loading branch information
nolanlawson committed Feb 5, 2024
2 parents 8594611 + 65d6fb1 commit 2356991
Show file tree
Hide file tree
Showing 300 changed files with 5,279 additions and 1,821 deletions.
203 changes: 117 additions & 86 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,16 @@
"sourceType": "module"
},

"plugins": [
"jest",
"@lwc/lwc-internal",
"@typescript-eslint",
"import"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended"
],
"plugins": ["jest", "@lwc/lwc-internal", "@typescript-eslint", "import", "header"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/eslint-recommended"],

"env": {
"es6": true
},

"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_" }
],
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],

"block-scoped-var": "error",
"no-alert": "error",
Expand All @@ -41,77 +30,121 @@
"no-proto": "error",
"no-prototype-builtins": "error",
"no-new-require": "error",
"no-restricted-properties": ["error", {
"object": "arguments",
"property": "callee",
"message": "arguments.callee is deprecated"
}, {
"object": "global",
"property": "isFinite",
"message": "Please use Number.isFinite instead"
}, {
"object": "self",
"property": "isFinite",
"message": "Please use Number.isFinite instead"
}, {
"object": "window",
"property": "isFinite",
"message": "Please use Number.isFinite instead"
}, {
"object": "global",
"property": "isNaN",
"message": "Please use Number.isNaN instead"
}, {
"object": "self",
"property": "isNaN",
"message": "Please use Number.isNaN instead"
}, {
"object": "window",
"property": "isNaN",
"message": "Please use Number.isNaN instead"
}, {
"property": "__defineGetter__",
"message": "Please use Object.defineProperty instead."
}, {
"property": "__defineSetter__",
"message": "Please use Object.defineProperty instead."
}, {
"object": "Math",
"property": "pow",
"message": "Use the exponentiation operator (**) instead."
}, {
"object": "globalThis",
"property": "lwcRuntimeFlags",
"message": "Use the bare global lwcRuntimeFlags instead."
}],
"no-restricted-properties": [
"error",
{
"object": "arguments",
"property": "callee",
"message": "arguments.callee is deprecated"
},
{
"object": "global",
"property": "isFinite",
"message": "Please use Number.isFinite instead"
},
{
"object": "self",
"property": "isFinite",
"message": "Please use Number.isFinite instead"
},
{
"object": "window",
"property": "isFinite",
"message": "Please use Number.isFinite instead"
},
{
"object": "global",
"property": "isNaN",
"message": "Please use Number.isNaN instead"
},
{
"object": "self",
"property": "isNaN",
"message": "Please use Number.isNaN instead"
},
{
"object": "window",
"property": "isNaN",
"message": "Please use Number.isNaN instead"
},
{
"property": "__defineGetter__",
"message": "Please use Object.defineProperty instead."
},
{
"property": "__defineSetter__",
"message": "Please use Object.defineProperty instead."
},
{
"object": "Math",
"property": "pow",
"message": "Use the exponentiation operator (**) instead."
},
{
"object": "globalThis",
"property": "lwcRuntimeFlags",
"message": "Use the bare global lwcRuntimeFlags instead."
}
],
"no-self-compare": "error",
"no-undef-init": "error",
"no-useless-computed-key": "error",
"no-useless-return": "error",
"prefer-const": ["error", {
"destructuring": "any",
"ignoreReadBeforeAssign": true
}],
"prefer-const": [
"error",
{
"destructuring": "any",
"ignoreReadBeforeAssign": true
}
],
"template-curly-spacing": "error",
"yoda": "error",

"@lwc/lwc-internal/no-invalid-todo": "error",
"import/order": [
"error",
{ "groups": ["builtin", "external", "internal", "parent", "index", "sibling", "object", "type"] }
{
"groups": [
"builtin",
"external",
"internal",
"parent",
"index",
"sibling",
"object",
"type"
]
}
],
"no-restricted-imports": [
"error",
{
"name": "@lwc/features",
"importNames": ["lwcRuntimeFlags", "runtimeFlags", "default"],
"message": "Do not directly import runtime flags from @lwc/features. Use the global lwcRuntimeFlags variable instead."
}
],
"no-restricted-imports": ["error", {
"name": "@lwc/features",
"importNames": ["lwcRuntimeFlags", "runtimeFlags", "default"],
"message": "Do not directly import runtime flags from @lwc/features. Use the global lwcRuntimeFlags variable instead."
}]
"header/header": [
2,
"block",
[
"",
{
"pattern": "^ \\* Copyright \\(c\\) \\d{4}, ([sS]alesforce.com, inc|Salesforce, Inc)\\.$",
// This copyright text should match the text used in the rollup config
"template": " * Copyright (c) 2024, Salesforce, Inc."
},
" * All rights reserved.",
" * SPDX-License-Identifier: MIT",
" * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT",
" "
]
]
},

"overrides": [
{
"files": [
"**/packages/lwc/**"
],
"files": ["**/packages/lwc/**"],
"rules": {
"no-restricted-imports": "off"
}
Expand All @@ -129,11 +162,7 @@
}
},
{
"files": [
"**/__tests__/**",
"**/__mocks__/**",
"**/@lwc/integration-karma/**"
],
"files": ["**/__tests__/**", "**/__mocks__/**", "**/@lwc/integration-karma/**"],

"env": {
"jest": true,
Expand All @@ -149,21 +178,15 @@
}
},
{
"files": [
"**/@lwc/integration-tests/**"
],
"files": ["**/@lwc/integration-tests/**"],

"globals": {
"$": true,
"browser": true
}
},
{
"files": [
"./*.js",
"**/scripts/**",
"**/jest.config.js"
],
"files": ["./*.js", "**/scripts/**", "**/jest.config.js"],

"env": {
"node": true,
Expand All @@ -175,16 +198,24 @@
}
},
{
"files": [
"**/perf-benchmarks/**"
],
"files": ["**/perf-benchmarks/**"],

"globals": {
"after": true,
"before": true,
"benchmark": true,
"run": true
}
},
{
"files": [
"packages/@lwc/integration-tests/src/**/!(*.spec.js)",
"packages/@lwc/integration-karma/test/**",
"packages/@lwc/integration-karma/test-hydration/**"
],
"rules": {
"header/header": "off"
}
}
]
}
2 changes: 0 additions & 2 deletions .github/workflows/karma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ jobs:
- run: DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: LEGACY_BROWSERS=1 yarn sauce:ci
- run: FORCE_NATIVE_SHADOW_MODE_FOR_TEST=1 yarn sauce:ci
- run: ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 yarn sauce:ci
- run: ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: API_VERSION=58 yarn sauce:ci
- run: API_VERSION=58 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: API_VERSION=59 yarn sauce:ci
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ jobs:
- name: Install chromedriver v119
run: yarn add -W chromedriver@^119

- name: Check missing file headers
run: node ./scripts/tasks/check-license-headers.js
- name: Check package.json integrity
run: node ./scripts/tasks/check-and-rewrite-package-json.js --test
- name: Verify @lwc/shared is tree-shakable
Expand All @@ -64,5 +62,15 @@ jobs:
run: yarn bundlesize
- name: Run Jest tests
run: yarn test:ci
- name: Upload Jest coverage report
uses: actions/upload-artifact@v3
with:
name: jest-coverage-report
path: coverage/
- name: Run benchmark smoke tests
run: CHROME_BINARY=${{ steps.setup-chrome.outputs.chrome-path }} BENCHMARK_SMOKE_TEST=1 yarn test:performance
- name: Add step summary
# 1. Remove leading/trailing "border" lines from output
# 2. Wrap file names in backticks
# 3. Convert leading whitespace to non-breaking to approximate plaintext output
run: sed -E '$d;1d;4,$s/^( ?)([^ ]+)/\1`\2`/g;4,$s/^ /\ \ /g' coverage/coverage.txt >> "$GITHUB_STEP_SUMMARY"
31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lwc-monorepo",
"version": "5.2.0",
"version": "6.1.0",
"private": true,
"description": "Lightning Web Components",
"repository": {
Expand Down Expand Up @@ -32,37 +32,38 @@
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
"@commitlint/cli": "^18.4.3",
"@commitlint/cli": "^18.6.0",
"@lwc/eslint-plugin-lwc-internal": "link:./scripts/eslint-plugin",
"@lwc/jest-utils-lwc-internals": "link:./scripts/jest/utils",
"@rollup/plugin-commonjs": "^25.0.2",
"@rollup/plugin-inject": "^5.0.3",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-typescript": "^11.1.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/babel__core": "^7.20.5",
"@types/jest": "^29.5.11",
"@types/node": "^20.10.4",
"@types/node": "^20.11.14",
"@types/prettier": "^2.7.3",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"bytes": "^3.1.2",
"es-module-lexer": "^1.4.1",
"eslint": "^8.55.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jest": "^27.6.0",
"eslint": "^8.56.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.6.3",
"glob": "^10.3.10",
"husky": "^8.0.2",
"isbinaryfile": "^5.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^15.2.0",
"magic-string": "^0.30.4",
"nx": "17.2.0",
"lint-staged": "^15.2.1",
"magic-string": "^0.30.6",
"nx": "17.2.6",
"prettier": "^2.8.8",
"rollup": "^4.8.0",
"terser": "^5.26.0",
"ts-jest": "^29.1.1",
"rollup": "^4.9.6",
"terser": "^5.27.0",
"ts-jest": "^29.1.2",
"tslib": "^2.6.1",
"typescript": "5.3.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@lwc/aria-reflection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
],
"name": "@lwc/aria-reflection",
"version": "5.2.0",
"version": "6.1.0",
"description": "ARIA element reflection polyfill for strings",
"keywords": [
"aom",
Expand Down
6 changes: 3 additions & 3 deletions packages/@lwc/babel-plugin-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
],
"name": "@lwc/babel-plugin-component",
"version": "5.2.0",
"version": "6.1.0",
"description": "Babel plugin to transform a LWC module",
"keywords": [
"lwc"
Expand Down Expand Up @@ -43,8 +43,8 @@
},
"dependencies": {
"@babel/helper-module-imports": "7.22.15",
"@lwc/errors": "5.2.0",
"@lwc/shared": "5.2.0",
"@lwc/errors": "6.1.0",
"@lwc/shared": "6.1.0",
"line-column": "~1.0.2"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 2356991

Please sign in to comment.