Open Bug 1608273 Opened 4 years ago Updated 2 years ago

Experiment with using a proxy to lazify imports

Categories

(Firefox :: General, task, P5)

task

Tracking

()

People

(Reporter: mossop, Unassigned)

References

(Blocks 1 open bug)

Details

The defineLazy(Module|Service)Getters? can be switched to instead return a proxy import to see if that works. Should test perf too.

This is going to be handled after the first phase of in-tree migration with direct conversion without semantic change.

The API design depends on what kind of interface people want with more standardized ES module style (instead of for JSM style).
The current possible choice is to make the namespace object a proxy, so that no special operation is done on it and just handling the get is sufficient.
Making the imported symbol lazy is too difficult to handle in general. because the symbol can be primitive, or class, that a regular proxy cannot handle properly.

The other option is to look into making the similar thing specced: https://github.com/tc39/proposal-defer-import-eval

Blocks: 1776174
No longer blocks: esm-ification
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.