lwc
lwc copied to clipboard
[SSR] Make dynamic `import()`s no-ops
In the SSR compiler, dynamic import()s should (probably) be no-ops because we run in sync mode so you wouldn't be able to do anything with the constructor you import anyway.
We also need to strip these import()s anyway because core will complain if it sees them after compilation.
This issue has been linked to a new work item: W-17248485
If we're moving forward with sync mode, do we need to block more flavors of async operations?
No, they just won't work. We already have a test for Promise.resolve().
This seems fixed by:
- https://github.com/salesforce/lwc/pull/4887
Or does this also need to be fixed in @lwc/engine-server?
Long-term, yes. And for engine-dom too. But for now we still have many internal customers who are relying on this API.