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

feat: v2 of the closure serializer #17

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

feat: v2 of the closure serializer #17

wants to merge 23 commits into from

Conversation

sam-goodwin
Copy link
Contributor

Total re-write of the closure serializer as a single recursive pass.

For visual context, refer to this diagram of Prototypical Inheritance:
image

Outstanding tasks:

  • support recursive references in properties
  • serialize classes as Functions (not classes)
  • detect augmented globals
  • detect references to modules or a module's exports and emit as an import/require
  • run esbuild on the serialized closure + imports to create a tree-shaken bundle with minimal usage of the closure serializer and maximal usage of esbuild

* vn.prop = valueN;
* ```
*
* ## Algorithm
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still working out the exact algorithm, but making great progress thanks to this visualization.
image

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.

1 participant