-
Notifications
You must be signed in to change notification settings - Fork 422
feat: add support for ElementInternals in synthetic shadow #5519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
31414f3
0b3148a
b6d2452
71eb0c5
32b2606
318abed
c337695
1a8b40b
aafc70f
af6b605
fbb2123
dbea0e4
6d5987f
ed96b9f
86b5b19
92bc0ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { LightningElement as Component } from "lwc"; | ||
|
||
export default class Test extends Component {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"enableSyntheticElementInternals": true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import _tmpl from "./test.html"; | ||
import { LightningElement as Component, registerComponent as _registerComponent } from "lwc"; | ||
class Test extends Component { | ||
/*LWC compiler vX.X.X*/ | ||
} | ||
const __lwc_component_class_internal = _registerComponent(Test, { | ||
tmpl: _tmpl, | ||
sel: "lwc-test", | ||
apiVersion: 9999999, | ||
enableSyntheticElementInternals: true | ||
}); | ||
export default __lwc_component_class_internal; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ const TEMPLATE_KEY = 'tmpl'; | |
const COMPONENT_NAME_KEY = 'sel'; | ||
const API_VERSION_KEY = 'apiVersion'; | ||
const COMPONENT_CLASS_ID = '__lwc_component_class_internal'; | ||
const SYNTHETIC_ELEMENT_INTERNALS_KEY = 'enableSyntheticElementInternals'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 if this were written 8 years ago, we'd probably call it |
||
|
||
export { | ||
DECORATOR_TYPES, | ||
|
@@ -46,4 +47,5 @@ export { | |
COMPONENT_NAME_KEY, | ||
API_VERSION_KEY, | ||
COMPONENT_CLASS_ID, | ||
SYNTHETIC_ELEMENT_INTERNALS_KEY, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,7 @@ hijackGlobal('afterEach', (afterEach) => { | |
// Ensure the DOM is in a clean state | ||
document.body.replaceChildren(); | ||
document.head.replaceChildren(); | ||
window.__lwcResetGlobalStylesheets(); | ||
|
||
}); | ||
}); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<template></template> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { LightningElement, api } from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
internals; | ||
|
||
connectedCallback() { | ||
this.internals = this.attachInternals(); | ||
} | ||
|
||
@api | ||
callAttachInternals() { | ||
this.internals = this.attachInternals(); | ||
} | ||
|
||
@api | ||
hasElementInternalsBeenSet() { | ||
return Boolean(this.internals); | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.