Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/theoretically-non-…
Browse files Browse the repository at this point in the history
…breaking-943a6c8de4
  • Loading branch information
wjhsf committed Mar 7, 2025
2 parents 5d798a6 + 5463f8f commit ab31e52
Show file tree
Hide file tree
Showing 95 changed files with 988 additions and 392 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ jobs:
run: yarn test:types
- name: Run unit tests
run: yarn test:ci
- name: Run unit tests in production mode
run: yarn test:production --no-watch
- name: Upload unit test coverage report
uses: actions/upload-artifact@v4
with:
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lwc-monorepo",
"version": "8.14.0",
"version": "8.16.0",
"private": true,
"description": "Lightning Web Components",
"repository": {
Expand All @@ -19,6 +19,7 @@
"copy-fork": "./scripts/tasks/unsafe-external-contributor-ci-workaround.sh",
"dev": "nx run-many --target=dev --all --parallel=999 --exclude=@lwc/perf-benchmarks,@lwc/perf-benchmarks-components,@lwc/integration-tests",
"test": "vitest --workspace vitest.workspace.mjs",
"test:production": "VITE_NODE_ENV=production vitest --workspace vitest.workspace.mjs",
"test:bespoke": "nx run-many --target=test",
"test:debug": "vitest --workspace vitest.workspace.mjs --inspect-brk --no-file-parallelism",
"test:ci": "vitest run --workspace vitest.workspace.mjs --coverage",
Expand Down Expand Up @@ -79,7 +80,7 @@
"*.{css,js,json,md,mjs,ts,yaml,yml}": "prettier --write",
"{packages/**/package.json,scripts/tasks/check-and-rewrite-package-json.js}": "node ./scripts/tasks/check-and-rewrite-package-json.js",
"{LICENSE-CORE.md,**/LICENSE.md,yarn.lock,scripts/tasks/generate-license-files.js,scripts/shared/bundled-dependencies.js}": "node ./scripts/tasks/generate-license-files.js",
"*.{only,skip}": "eslint --cache --no-eslintrc --plugin '@lwc/eslint-plugin-lwc-internal' --rule '@lwc/lwc-internal/forbidden-filename: error'"
"*.{only,skip}": "eslint --cache --plugin '@lwc/eslint-plugin-lwc-internal' --rule '@lwc/lwc-internal/forbidden-filename: error'"
},
"workspaces": [
"packages/@lwc/*",
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": "8.14.0",
"version": "8.16.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": "8.14.0",
"version": "8.16.0",
"description": "Babel plugin to transform a LWC module",
"keywords": [
"lwc"
Expand Down Expand Up @@ -47,8 +47,8 @@
},
"dependencies": {
"@babel/helper-module-imports": "7.25.9",
"@lwc/errors": "8.14.0",
"@lwc/shared": "8.14.0",
"@lwc/errors": "8.16.0",
"@lwc/shared": "8.16.0",
"line-column": "~1.0.2"
},
"devDependencies": {
Expand Down
14 changes: 7 additions & 7 deletions packages/@lwc/compiler/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/compiler",
"version": "8.14.0",
"version": "8.16.0",
"description": "LWC compiler",
"keywords": [
"lwc"
Expand Down Expand Up @@ -52,11 +52,11 @@
"@babel/plugin-transform-class-properties": "7.25.9",
"@babel/plugin-transform-object-rest-spread": "7.25.9",
"@locker/babel-plugin-transform-unforgeables": "0.22.0",
"@lwc/babel-plugin-component": "8.14.0",
"@lwc/errors": "8.14.0",
"@lwc/shared": "8.14.0",
"@lwc/ssr-compiler": "8.14.0",
"@lwc/style-compiler": "8.14.0",
"@lwc/template-compiler": "8.14.0"
"@lwc/babel-plugin-component": "8.16.0",
"@lwc/errors": "8.16.0",
"@lwc/shared": "8.16.0",
"@lwc/ssr-compiler": "8.16.0",
"@lwc/style-compiler": "8.16.0",
"@lwc/template-compiler": "8.16.0"
}
}
8 changes: 4 additions & 4 deletions packages/@lwc/engine-core/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/engine-core",
"version": "8.14.0",
"version": "8.16.0",
"description": "Core LWC engine APIs.",
"keywords": [
"lwc"
Expand Down Expand Up @@ -46,9 +46,9 @@
}
},
"dependencies": {
"@lwc/features": "8.14.0",
"@lwc/shared": "8.14.0",
"@lwc/signals": "8.14.0"
"@lwc/features": "8.16.0",
"@lwc/shared": "8.16.0",
"@lwc/signals": "8.16.0"
},
"devDependencies": {
"observable-membrane": "2.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function checkVersionMismatch(
) {
const versionMatcher = func.toString().match(LWC_VERSION_COMMENT_REGEX);
if (!isNull(versionMatcher) && !warned) {
if (process.env.SKIP_LWC_VERSION_MISMATCH_CHECK === 'true') {
if (typeof process === 'object' && process.env.SKIP_LWC_VERSION_MISMATCH_CHECK === 'true') {
warned = true; // skip printing out version mismatch errors when env var is set
return;
}
Expand Down
7 changes: 6 additions & 1 deletion packages/@lwc/engine-core/src/framework/hydration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,12 @@ function hydrateElement(elm: Node, vnode: VElement, renderer: RendererAPI): Node

patchElementPropsAndAttrsAndRefs(vnode, renderer);

if (!isDomManual) {
// When <lwc-style> tags are initially encountered at the time of HTML parse, the <lwc-style> tag is
// replaced with an empty <style> tag. Additionally, the styles are attached to the shadow root as a
// constructed stylesheet at the same time. So, the shadow will be styled correctly and the only
// difference between what's in the DOM and what's in the VDOM is the string content inside the
// <style> tag. We can simply ignore that during hyration.
if (!isDomManual && vnode.elm.tagName !== 'STYLE') {
const { getFirstChild } = renderer;
hydrateChildren(getFirstChild(elm), vnode.children, elm, owner, false);
}
Expand Down
8 changes: 4 additions & 4 deletions packages/@lwc/engine-dom/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/engine-dom",
"version": "8.14.0",
"version": "8.16.0",
"description": "Renders LWC components in a DOM environment.",
"keywords": [
"lwc"
Expand Down Expand Up @@ -46,9 +46,9 @@
}
},
"devDependencies": {
"@lwc/engine-core": "8.14.0",
"@lwc/shared": "8.14.0",
"@lwc/features": "8.14.0"
"@lwc/engine-core": "8.16.0",
"@lwc/shared": "8.16.0",
"@lwc/features": "8.16.0"
},
"lwc": {
"modules": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { LOWEST_API_VERSION } from '@lwc/shared';

// it needs to be imported from the window, otherwise the checks for associated vms is done against "@lwc/engine-core"
const LightningElementFormatter = (globalThis as any)['devtoolsFormatters'].find((f: any) => {
const LightningElementFormatter = (globalThis as any)['devtoolsFormatters']?.find((f: any) => {
return f.name === 'LightningElementFormatter';
});

Expand All @@ -33,8 +33,9 @@ class WireAdapter {
disconnect() {}
}

describe('Lightning Element formatter', () => {
const { header } = LightningElementFormatter;
// LightningElementFormatter is not exposed in prod mode
describe.skipIf(process.env.NODE_ENV === 'production')('Lightning Element formatter', () => {
const header = LightningElementFormatter?.header;

it('should not contain body', () => {
expect(LightningElementFormatter.hasBody()).toBe(false);
Expand Down
10 changes: 5 additions & 5 deletions packages/@lwc/engine-server/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/engine-server",
"version": "8.14.0",
"version": "8.16.0",
"description": "Renders LWC components in a server environment.",
"keywords": [
"lwc"
Expand Down Expand Up @@ -46,10 +46,10 @@
}
},
"devDependencies": {
"@lwc/engine-core": "8.14.0",
"@lwc/rollup-plugin": "8.14.0",
"@lwc/shared": "8.14.0",
"@lwc/features": "8.14.0",
"@lwc/engine-core": "8.16.0",
"@lwc/rollup-plugin": "8.16.0",
"@lwc/shared": "8.16.0",
"@lwc/features": "8.16.0",
"@rollup/plugin-virtual": "^3.0.2",
"parse5": "^7.2.1"
}
Expand Down
8 changes: 7 additions & 1 deletion packages/@lwc/engine-server/src/__tests__/fixtures.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { testFixtureDir, formatHTML, pluginVirtual } from '@lwc/test-utils-lwc-i
import { setFeatureFlagForTest } from '../index';
import type { LightningElementConstructor } from '@lwc/engine-core/dist/framework/base-lightning-element';
import type { RollupLwcOptions } from '@lwc/rollup-plugin';
import type { FeatureFlagName } from '@lwc/features/dist/types';

vi.mock('lwc', async () => {
const lwcEngineServer = await import('../index');
Expand All @@ -33,6 +34,9 @@ interface FixtureConfig {

/** Props to provide to the root component. */
props?: Record<string, string>;

/** Feature flags to enable for the test. */
features: FeatureFlagName[];
}

async function compileFixture({
Expand Down Expand Up @@ -102,6 +106,7 @@ function testFixtures(options?: RollupLwcOptions) {
testFixtureDir<FixtureConfig>(
{
root: path.resolve(__dirname, 'fixtures'),
ssrVersion: 1,
pattern: '**/config.json',
},
async ({ dirname, config }) => {
Expand Down Expand Up @@ -161,7 +166,8 @@ function testFixtures(options?: RollupLwcOptions) {
);
}

describe.concurrent('fixtures', () => {
// TODO [#5134]: Enable these tests in production mode
describe.skipIf(process.env.NODE_ENV === 'production').concurrent('fixtures', () => {
beforeAll(() => {
// ENABLE_WIRE_SYNC_EMIT is used because this mimics the behavior for LWR in SSR mode. It's also more reasonable
// for how both `engine-server` and `ssr-runtime` behave, which is to use sync rendering.
Expand Down
Loading

0 comments on commit ab31e52

Please sign in to comment.