-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(track): don't throw on revoked proxies @W-17739481 (#5192)
- Loading branch information
Showing
6 changed files
with
52 additions
and
1 deletion.
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
Empty file.
5 changes: 5 additions & 0 deletions
5
packages/@lwc/engine-server/src/__tests__/fixtures/track-revoked-proxy-fails/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,5 @@ | ||
<x-component> | ||
<template shadowrootmode="open"> | ||
I should render! | ||
</template> | ||
</x-component> |
3 changes: 3 additions & 0 deletions
3
packages/@lwc/engine-server/src/__tests__/fixtures/track-revoked-proxy-fails/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-component'; | ||
export { default } from 'x/component'; | ||
export * from 'x/component'; |
3 changes: 3 additions & 0 deletions
3
...erver/src/__tests__/fixtures/track-revoked-proxy-fails/modules/x/component/component.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,3 @@ | ||
<template> | ||
I should render! | ||
</template> |
26 changes: 26 additions & 0 deletions
26
...-server/src/__tests__/fixtures/track-revoked-proxy-fails/modules/x/component/component.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,26 @@ | ||
import { LightningElement, track } from 'lwc'; | ||
import tmpl from './component.html'; | ||
|
||
const { revoke, proxy } = Proxy.revocable({}, {}); | ||
revoke(); | ||
|
||
export default class Rehydration extends LightningElement { | ||
// Doesn't need to be used, just needs to be tracked; see W-17739481 | ||
@track reactive = proxy; | ||
|
||
connectedCallback() { | ||
Promise.resolve().then(() => { | ||
this.reactive = 1; | ||
}); | ||
} | ||
|
||
render() { | ||
if (!this.rendered) { | ||
this.rendered = true; | ||
} else { | ||
throw new Error('Reactivity should be disabled on SSR.'); | ||
} | ||
|
||
return tmpl; | ||
} | ||
} |