Skip to content
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

Feature/freezer source map support #1743

Draft
wants to merge 56 commits into
base: main
Choose a base branch
from

Conversation

merryman
Copy link
Member

@merryman merryman commented Mar 6, 2025

Extends the source map support from #1684 to also cover frozen bundles. Cannot be merged before.

@merryman merryman linked an issue Mar 6, 2025 that may be closed by this pull request
@merryman merryman force-pushed the feature/freezer-source-map-support branch from 39bf8be to e6485f8 Compare March 11, 2025 13:20
merryman added 28 commits March 11, 2025 18:02
Merge the var and ref replacement and the import export traversal into single passes.
The key is here to make the node functions parametrized, so that depending on the underlying AST system different nodes can be created by the same transform.
Was needed due to to the changes in the class transform that preserves the class name as a binding during class initialization.
Since babel.js has a bunch of circular imports it has weird importing specific code that checks if modules have been already initialized. We introduce a method called bulletProofNamespace() which helps us to adjust these error checking codes such that they work in split bundles.
The transpiler initialization needed to be adjusted.
Apparently there is javascript code that manually freezes the classes/prototypes after they have been defined, which makes the in place re-initialization crash.
We now add an additional check in the transformed class that avoids running into that conflict.
merryman added 27 commits March 11, 2025 18:02
Previously we would recycle the module url to pkg cache to allow us to retrieve the correct import map, which failed. We now use a dedicated import map cache, that takes care of merging overlapping import maps between different packages.
Parsing would sometimes fail in order to generate the needed ast nodes, due to variables defined outside of the parsed block.
Some of the previous changes caused crashes in the runtime source transform for lively.modules.
Source maps make the prettification unnessecary.
It appears it breaks the source maps on the per module basis.
@merryman merryman force-pushed the feature/freezer-source-map-support branch from edc2903 to a6f6e60 Compare March 12, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Debugging Worlds
1 participant