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

Ability to clone context #192

Closed
tim-field opened this issue Jul 25, 2024 · 3 comments
Closed

Ability to clone context #192

tim-field opened this issue Jul 25, 2024 · 3 comments

Comments

@tim-field
Copy link

My use case here applying polyfills to a context ( which can be slow ). Then cloning this context as required to avoid the polyfill initiation time.

A possible approach is discussed here #152

I'm wondering if this approach would make sense in a context.clone() method ?

@justjake
Copy link
Owner

What would the context.clone() method do?

@tim-field
Copy link
Author

I was thinking give me an instance of context at a given point(er) ( ie post polyfil )

@justjake
Copy link
Owner

You can already pass a contextPointer as part of the module.createContext(options) or runtime.createContext(options) methods. These options are public as far as Typesript is concerned, but may not be documented. If you need a change to related APIs, h passing arbitrary runtime pointers to module.createRuntime, I'd be happy to accept such a PR

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

No branches or pull requests

2 participants