Skip to content

Commit

Permalink
chore: release v2.14.1 (#2866) @W-7258582 (#2867)
Browse files Browse the repository at this point in the history
* fix: only remove slot children in synthetic shadow (#2843)

* fix: only remove slot children in synthetic shadow

* fix: use case block

* fix: only add version mismatch test code in karma (#2852)

* test(integration-karma): ensure constructable stylesheets are re-used (#2844)

* test(integration-karma): ensure constructable stylesheets are re-used

* test: add test for shared style

* chore(nucleus): remove more downstreams (#2855)

* chore(nucleus): remove another downstream (#2857)

* docs: fix typo in template compiler readme (#2848)

* docs: fix typo in template compiler readme

* docs: rewording usage of lwc dynamic directive

Co-authored-by: Eugene Kashida <ekashida@gmail.com>

Co-authored-by: Eugene Kashida <ekashida@gmail.com>

* test(integration-karma): update ACT components (#2862)

* fix(engine-core): revert "optimize computation of transitive shadow mode" (#2859)

* fix(engine-core): correctly compute shadowMode

* fix: fix comment

* fix: update packages/integration-karma/test/mixed-shadow-mode/dual-component/index.spec.js

Co-authored-by: Eugene Kashida <ekashida@gmail.com>

* fix: fix another one

* fix: improve tests

* fix: improve tests

* fix: improve test

* fix: revert

* Revert "refactor(engine): optimize computation of transitive shadow mode (#2803)"

This reverts commit 95ce4c3.

Co-authored-by: Eugene Kashida <ekashida@gmail.com>

* chore: release v2.14.1 (#2866)

Co-authored-by: Nolan Lawson <nolan@nolanlawson.com>
Co-authored-by: Mohan Raj Rajamanickam <1509984+mohanraj-r@users.noreply.github.com>
Co-authored-by: Eugene Kashida <ekashida@gmail.com>
Co-authored-by: Ravi Jayaramappa <ravi.jayaramappa@salesforce.com>
  • Loading branch information
5 people authored Jun 3, 2022
1 parent 7ca7a5f commit 518ab2e
Show file tree
Hide file tree
Showing 76 changed files with 411 additions and 168 deletions.
3 changes: 0 additions & 3 deletions .nucleus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ branches:
auto-start-from-forks: false
merge-method: disabled # do not auto-merge; we'll do it ourselves
required-downstream-deps:
- communities/microsite-template-marketing
- communities/shared-experience-components
- communities/ui-b2b-components
- communities/ui-cms-components
- communities/ui-feeds-components
- communities/ui-lightning-community
- lwc/lwc-platform
- salesforce/lwr
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"exact": true,
"npmClient": "yarn",
"useWorkspaces": true,
"version": "2.14.0"
"version": "2.14.1"
}
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 @@ -10,7 +10,7 @@
"bugs": {
"url": "https://github.com/salesforce/lwc/issues"
},
"version": "2.14.0",
"version": "2.14.1",
"main": "src/index.js",
"typings": "src/index.d.ts",
"license": "MIT",
Expand All @@ -21,8 +21,8 @@
],
"dependencies": {
"@babel/helper-module-imports": "~7.16.7",
"@lwc/errors": "2.14.0",
"@lwc/shared": "2.14.0",
"@lwc/errors": "2.14.1",
"@lwc/shared": "2.14.1",
"line-column": "~1.0.2"
},
"peerDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions packages/@lwc/compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lwc/compiler",
"version": "2.14.0",
"version": "2.14.1",
"description": "LWC compiler",
"homepage": "https://lwc.dev/",
"repository": {
Expand All @@ -26,11 +26,11 @@
"@babel/core": "~7.17.10",
"@babel/plugin-proposal-class-properties": "~7.16.7",
"@babel/plugin-proposal-object-rest-spread": "~7.17.3",
"@lwc/babel-plugin-component": "2.14.0",
"@lwc/errors": "2.14.0",
"@lwc/shared": "2.14.0",
"@lwc/style-compiler": "2.14.0",
"@lwc/template-compiler": "2.14.0"
"@lwc/babel-plugin-component": "2.14.1",
"@lwc/errors": "2.14.1",
"@lwc/shared": "2.14.1",
"@lwc/style-compiler": "2.14.1",
"@lwc/template-compiler": "2.14.1"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 3 additions & 3 deletions packages/@lwc/engine-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lwc/engine-core",
"version": "2.14.0",
"version": "2.14.1",
"description": "Core LWC engine APIs.",
"homepage": "https://lwc.dev/",
"repository": {
Expand All @@ -25,8 +25,8 @@
"types/"
],
"dependencies": {
"@lwc/features": "2.14.0",
"@lwc/shared": "2.14.0"
"@lwc/features": "2.14.1",
"@lwc/shared": "2.14.1"
},
"devDependencies": {
"observable-membrane": "2.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { LightningElementConstructor } from './base-lightning-element';

let warned = false;

if (process.env.NODE_ENV === 'development') {
// @ts-ignore
if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
// @ts-ignore
window.__lwcResetWarnedOnVersionMismatch = () => {
warned = false;
Expand Down
8 changes: 6 additions & 2 deletions packages/@lwc/engine-core/src/framework/rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,15 @@ function unmount(vnode: VNode, parent: ParentNode, doRemove: boolean = false) {
removeNode(elm!, parent);
}

const removeChildren = sel === 'slot'; // slot content is removed to trigger slotchange event when removing slot
switch (type) {
case VNodeType.Element:
case VNodeType.Element: {
// Slot content is removed to trigger slotchange event when removing slot.
// Only required for synthetic shadow.
const removeChildren =
sel === 'slot' && vnode.owner.shadowMode === ShadowMode.Synthetic;
unmountVNodes(vnode.children, elm as ParentNode, removeChildren);
break;
}

case VNodeType.CustomElement: {
const { vm } = vnode;
Expand Down
39 changes: 27 additions & 12 deletions packages/@lwc/engine-core/src/framework/vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,8 @@ export interface VM<N = HostNode, E = HostElement> {
/** Whether or not the VM was hydrated */
readonly hydrated: boolean;
/** Rendering operations associated with the VM */
readonly renderMode: RenderMode;
renderMode: RenderMode;
shadowMode: ShadowMode;
/** Transitive support for native Shadow DOM. A component in native mode
* transitively opts all of its descendants into native. */
readonly nearestShadowMode: ShadowMode | null;
/** The component creation index. */
idx: number;
/** Component state, analogous to Element.isConnected */
Expand Down Expand Up @@ -258,6 +255,14 @@ export function removeVM(vm: VM) {
resetComponentStateWhenRemoved(vm);
}

function getNearestShadowAncestor(vm: VM): VM | null {
let ancestor = vm.owner;
while (!isNull(ancestor) && ancestor.renderMode === RenderMode.Light) {
ancestor = ancestor.owner;
}
return ancestor;
}

export function createVM<HostNode, HostElement>(
elm: HostElement,
ctor: LightningElementConstructor,
Expand Down Expand Up @@ -292,8 +297,6 @@ export function createVM<HostNode, HostElement>(
hydrated: Boolean(hydrated),

renderMode: def.renderMode,
shadowMode: computeShadowMode(def, owner),
nearestShadowMode: owner?.shadowRoot ? owner.shadowMode : owner?.nearestShadowMode ?? null,

context: {
stylesheetToken: undefined,
Expand All @@ -308,6 +311,7 @@ export function createVM<HostNode, HostElement>(

// Properties set right after VM creation.
tro: null!,
shadowMode: null!,

// Properties set by the LightningElement constructor.
component: null!,
Expand All @@ -319,6 +323,7 @@ export function createVM<HostNode, HostElement>(
getHook,
};

vm.shadowMode = computeShadowMode(vm);
vm.tro = getTemplateReactiveObserver(vm);

if (process.env.NODE_ENV !== 'production') {
Expand All @@ -341,7 +346,9 @@ export function createVM<HostNode, HostElement>(
return vm;
}

function computeShadowMode(def: ComponentDef, owner: VM | null) {
function computeShadowMode(vm: VM) {
const { def } = vm;

let shadowMode;
if (isSyntheticShadowDefined) {
if (def.renderMode === RenderMode.Light) {
Expand All @@ -355,11 +362,19 @@ function computeShadowMode(def: ComponentDef, owner: VM | null) {
if (def.shadowSupportMode === ShadowSupportMode.Any) {
shadowMode = ShadowMode.Native;
} else {
// Transitive support for native Shadow DOM. A component in native mode
// transitively opts all of its descendants into native.
// Synthetic if neither this component nor any of its ancestors are configured
// to be native.
shadowMode = owner?.nearestShadowMode ?? ShadowMode.Synthetic;
const shadowAncestor = getNearestShadowAncestor(vm);
if (
!isNull(shadowAncestor) &&
shadowAncestor.shadowMode === ShadowMode.Native
) {
// Transitive support for native Shadow DOM. A component in native mode
// transitively opts all of its descendants into native.
shadowMode = ShadowMode.Native;
} else {
// Synthetic if neither this component nor any of its ancestors are configured
// to be native.
shadowMode = ShadowMode.Synthetic;
}
}
} else {
shadowMode = ShadowMode.Synthetic;
Expand Down
6 changes: 3 additions & 3 deletions packages/@lwc/engine-dom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lwc/engine-dom",
"version": "2.14.0",
"version": "2.14.1",
"description": "Renders LWC components in a DOM environment.",
"homepage": "https://lwc.dev/",
"repository": {
Expand All @@ -25,8 +25,8 @@
"types/"
],
"devDependencies": {
"@lwc/engine-core": "2.14.0",
"@lwc/shared": "2.14.0"
"@lwc/engine-core": "2.14.1",
"@lwc/shared": "2.14.1"
},
"lwc": {
"modules": [
Expand Down
6 changes: 3 additions & 3 deletions packages/@lwc/engine-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lwc/engine-server",
"version": "2.14.0",
"version": "2.14.1",
"description": "Renders LWC components in a server environment.",
"homepage": "https://lwc.dev/",
"repository": {
Expand All @@ -25,8 +25,8 @@
"types/"
],
"devDependencies": {
"@lwc/engine-core": "2.14.0",
"@lwc/shared": "2.14.0"
"@lwc/engine-core": "2.14.1",
"@lwc/shared": "2.14.1"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/@lwc/errors/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lwc/errors",
"version": "2.14.0",
"version": "2.14.1",
"description": "LWC Error Utilities",
"homepage": "https://lwc.dev/",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/@lwc/features/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lwc/features",
"version": "2.14.0",
"version": "2.14.1",
"description": "LWC Features Flags",
"homepage": "https://lwc.dev/",
"repository": {
Expand All @@ -25,7 +25,7 @@
"types/"
],
"dependencies": {
"@lwc/shared": "2.14.0"
"@lwc/shared": "2.14.1"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/@lwc/module-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"bugs": {
"url": "https://github.com/salesforce/lwc/issues"
},
"version": "2.14.0",
"version": "2.14.1",
"main": "dist/commonjs/index.js",
"typings": "dist/types/index.d.ts",
"scripts": {
Expand Down
10 changes: 5 additions & 5 deletions packages/@lwc/rollup-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lwc/rollup-plugin",
"version": "2.14.0",
"version": "2.14.1",
"description": "Rollup plugin to compile LWC",
"homepage": "https://lwc.dev/",
"repository": {
Expand All @@ -23,12 +23,12 @@
"dist/"
],
"devDependencies": {
"@lwc/compiler": "2.14.0",
"@lwc/engine-dom": "2.14.0",
"@lwc/errors": "2.14.0"
"@lwc/compiler": "2.14.1",
"@lwc/engine-dom": "2.14.1",
"@lwc/errors": "2.14.1"
},
"dependencies": {
"@lwc/module-resolver": "2.14.0",
"@lwc/module-resolver": "2.14.1",
"@rollup/pluginutils": "~4.2.1"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@lwc/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lwc/shared",
"version": "2.14.0",
"version": "2.14.1",
"description": "Utilities and methods that are shared across packages",
"homepage": "https://lwc.dev/",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/@lwc/style-compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lwc/style-compiler",
"version": "2.14.0",
"version": "2.14.1",
"description": "Transform style sheet to be consumed by the LWC engine",
"homepage": "https://lwc.dev/",
"repository": {
Expand All @@ -23,7 +23,7 @@
"dist/"
],
"dependencies": {
"@lwc/shared": "2.14.0",
"@lwc/shared": "2.14.1",
"postcss": "~8.4.13",
"postcss-selector-parser": "~6.0.9",
"postcss-value-parser": "~4.2.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/@lwc/synthetic-shadow/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lwc/synthetic-shadow",
"version": "2.14.0",
"version": "2.14.1",
"description": "Synthetic Shadow Root for LWC",
"homepage": "https://lwc.dev/",
"repository": {
Expand Down Expand Up @@ -37,7 +37,7 @@
"access": "public"
},
"devDependencies": {
"@lwc/features": "2.14.0",
"@lwc/shared": "2.14.0"
"@lwc/features": "2.14.1",
"@lwc/shared": "2.14.1"
}
}
2 changes: 1 addition & 1 deletion packages/@lwc/template-compiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const { code, warnings } = compile(`<template><h1>Hello World!</h1></template>`,
**Options:**

- `experimentalComputedMemberExpression` (boolean, optional, `false` by default) - set to `true` to enable computed member expression in the template, eg: `{list[0].name}`.
- `experimentalDynamicDirective` (boolean, optional, `false` by default) - set to `true` to allow useges of `lwc:dynamic` directive in the template.
- `experimentalDynamicDirective` (boolean, optional, `false` by default) - set to `true` to allow the usage of `lwc:dynamic` directives in the template.
- `preserveHtmlComments` (boolean, optional, `false` by default) - set to `true` to disable the default behavior of stripping HTML comments.

**Return:**
Expand Down
6 changes: 3 additions & 3 deletions packages/@lwc/template-compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lwc/template-compiler",
"version": "2.14.0",
"version": "2.14.1",
"description": "Template compiler package",
"homepage": "https://lwc.dev/",
"repository": {
Expand All @@ -26,8 +26,8 @@
},
"//": "Currently can't upgrade estree-walker to v3.0.0 because it dropped CommonJS support: https://git.io/JXguS",
"dependencies": {
"@lwc/errors": "2.14.0",
"@lwc/shared": "2.14.0",
"@lwc/errors": "2.14.1",
"@lwc/shared": "2.14.1",
"acorn": "~8.7.1",
"astring": "~1.8.3",
"estree-walker": "~2.0.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/@lwc/wire-service/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lwc/wire-service",
"version": "2.14.0",
"version": "2.14.1",
"description": "@wire service",
"homepage": "https://lwc.dev/",
"repository": {
Expand All @@ -25,8 +25,8 @@
"types/"
],
"devDependencies": {
"@lwc/engine-core": "2.14.0",
"@lwc/shared": "2.14.0"
"@lwc/engine-core": "2.14.1",
"@lwc/shared": "2.14.1"
},
"lwc": {
"modules": [
Expand Down
Loading

0 comments on commit 518ab2e

Please sign in to comment.