-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: release v8.12.2 @W-17485572 (#5078)
* test(ssr): add tests for nested elements in slots (#5048) * fix(compiler): log warning for missing name/namespace (#4825) * test(karma): remove unnecessary IE11-related code (#5054) * fix: replace barrel exports from `lwc` with `@lwc/ssr-runtime` (#5034) * fix: replace barrel from `lwc` package with '@lwc/ssr-runtime' * fix: handle * barrel case and corresponding tests * fix: function naming * fix: barrel import test parity * fix: include optional exported alias for export all declaration replacement, tests * chore: explain function name massaging in test * fix: deep clone objects and optimize tests * fix: remove unused shared file * test(karma): add test for for:each issue #4889 (#5053) * fix(ssr): missing bookends for slotted lwc:if not at the top-level (#5027) Co-authored-by: Nolan Lawson <[email protected]> * fix(ssr): fix HTML comment bookends for if blocks (#5055) Co-authored-by: Will Harney <[email protected]> * fix(ssr-compiler): namespace and name should be optional in ComponentTransformOptions (#5058) * test(ssr): test `if` with adjacent text (#5056) * test(karma): reduce #4889 even further (#5060) * fix(ssr): fix `style` attribute rendering (#5061) * fix(ssr-compiler): harmonize some wire errors (#5062) Co-authored-by: Will Harney <[email protected]> * fix: only call callback when needed @W-17420330 (#5064) * fix: only call callback when needed @W-17420330 * chore: simplify test * fix: use correct class check * fix(ssr): render from superclass (#5063) Co-authored-by: Nolan Lawson <[email protected]> * test(ssr): add more superclass tests (#5065) * fix: use correct shadow root @W-17441501 (#5070) * fix: use correct shadow root @W-17441501 * chore: yagni i guess * chore: 🛩️📦 * If you read this, tell me so! * fix(ssr): align csr and ssr reflective behavior (#5050) * chore: release v8.12.2 @W-17485572 (#5075) --------- Co-authored-by: Nolan Lawson <[email protected]> Co-authored-by: jhefferman-sfdc <[email protected]> Co-authored-by: Matheus Cardoso <[email protected]> Co-authored-by: Nolan Lawson <[email protected]> Co-authored-by: Eugene Kashida <[email protected]>
- Loading branch information
1 parent
bfbc24b
commit 839c8bf
Showing
300 changed files
with
2,058 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
packages/@lwc/babel-plugin-component/src/__tests__/warnings.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright (c) 2024, salesforce.com, 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 | ||
*/ | ||
import { afterEach, beforeEach, expect, vi, test } from 'vitest'; | ||
import { transformSync } from '@babel/core'; | ||
import plugin from '../index'; | ||
|
||
let spy; | ||
|
||
beforeEach(() => { | ||
spy = vi.spyOn(console, 'warn'); | ||
}); | ||
|
||
afterEach(() => { | ||
spy!.mockReset(); | ||
}); | ||
|
||
test('warns on missing name/namespace', () => { | ||
const source = ` | ||
import { LightningElement } from 'lwc'; | ||
export default class extends LightningElement {}; | ||
`; | ||
|
||
const { code } = transformSync(source, { | ||
babelrc: false, | ||
configFile: false, | ||
filename: `foo.js`, | ||
plugins: [ | ||
[ | ||
plugin, | ||
{ | ||
namespace: '', | ||
name: '', | ||
}, | ||
], | ||
], | ||
})!; | ||
|
||
// compilation works successfully | ||
expect(code).toBeTypeOf('string'); | ||
|
||
expect(spy!).toHaveBeenCalledOnce(); | ||
expect(spy!).toHaveBeenCalledWith( | ||
'The namespace and name should both be non-empty strings. You may get unexpected behavior at runtime. Found: namespace="" and name=""' | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* 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 | ||
*/ | ||
|
||
import { getOwnPropertyDescriptors } from '@lwc/shared'; | ||
|
||
// Like @lwc/shared, but for DOM APIs | ||
|
||
export const ElementDescriptors = getOwnPropertyDescriptors(Element.prototype); | ||
|
||
export const ElementAttachShadow = ElementDescriptors.attachShadow.value!; | ||
export const ElementShadowRootGetter = ElementDescriptors.shadowRoot.get!; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
.../__tests__/fixtures/adjacent-text-nodes/preserve-comments-off/if-as-sibling/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<x-comments-text> | ||
<template shadowrootmode="open"> | ||
<div> | ||
| ||
</div> | ||
<div> | ||
| ||
</div> | ||
</template> | ||
</x-comments-text> |
3 changes: 3 additions & 0 deletions
3
...r/src/__tests__/fixtures/adjacent-text-nodes/preserve-comments-off/if-as-sibling/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const tagName = 'x-comments-text'; | ||
export { default } from 'x/comments-text'; | ||
export * from 'x/comments-text'; |
16 changes: 16 additions & 0 deletions
16
...text-nodes/preserve-comments-off/if-as-sibling/modules/x/comments-text/comments-text.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<template> | ||
<div> | ||
{empty}{empty} | ||
<template if:true={isTrue}> | ||
{empty}{empty} | ||
</template> | ||
{empty}{empty} | ||
</div> | ||
<div> | ||
{empty}{empty} | ||
<template if:true={isFalse}> | ||
{empty}{empty} | ||
</template> | ||
{empty}{empty} | ||
</div> | ||
</template> |
6 changes: 6 additions & 0 deletions
6
...t-text-nodes/preserve-comments-off/if-as-sibling/modules/x/comments-text/comments-text.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
isTrue = true; | ||
isFalse = false; | ||
} |
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
...tests__/fixtures/adjacent-text-nodes/preserve-comments-off/lwcIf-as-sibling/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<x-comments-text> | ||
<template shadowrootmode="open"> | ||
<div> | ||
| ||
<!----> | ||
| ||
<!----> | ||
| ||
</div> | ||
<div> | ||
| ||
</div> | ||
</template> | ||
</x-comments-text> |
3 changes: 3 additions & 0 deletions
3
...rc/__tests__/fixtures/adjacent-text-nodes/preserve-comments-off/lwcIf-as-sibling/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const tagName = 'x-comments-text'; | ||
export { default } from 'x/comments-text'; | ||
export * from 'x/comments-text'; |
Oops, something went wrong.