Open Juice10 opened 3 weeks ago
Latest commit: 54e33aef89d600c1c452db308fd98db5a150c47e
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
I've asked a SO question here to see if there are any ideas on how we might achieve the goals of this PR with less invasive code changes: https://stackoverflow.com/questions/78633141/typescript-transform-property-to-function-call
Could we add a new (optional) output target, which pulls in the added functions, and also includes a rollup plugin to find/replace all the needed property accesses?
From SO, the first replier mentions https://www.npmjs.com/package/ts-patch I haven't looked at it, but maybe would work better than a regex solution
I've asked a SO question here to see if there are any ideas on how we might achieve the goals of this PR with less invasive code changes: https://stackoverflow.com/questions/78633141/typescript-transform-property-to-function-call
Could we add a new (optional) output target, which pulls in the added functions, and also includes a rollup plugin to find/replace all the needed property accesses?
I agree that it would be really nice if we could use some sort of general purpose solution to rewrite this out of the box. Currently we have a couple things that make this difficult:
childNodes
reference, and those should not go via the rewrite
childNodes(NODE)
is actually a dom node.instanceof Node
won't work as it has to support iframes, so checks become more complicatedchildNodes(NODE)
as the errors are pretty harsh and unforgiving.
LWC monkey patches a lot of built in methods.
This PR gets around that issue by pulling new references from a temporary iframe, which hasn't been monkey patched yet.