Anber / wyw-in-js

MIT License
191 stars 8 forks source link

feat(transform): allow non-usage of WeakRef in Module conditionally #71

Closed brijeshb42 closed 2 months ago

brijeshb42 commented 2 months ago

Motivation

This PR tries to address this issue conditionally when it occurs too frequently. This is not a proper fix but a work around at the cost of memory consumption.

Summary

This works by introducing a new feature flag useWeakRefInEval that is true by default. If someone wants, they can set it to false in their wyw-in-js config to disable the usage of WeakRef.

Test plan

I tested locally in a fairly moderate example Pigment CSS repo. I can add tests on guidance.

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: d000257720a0b8563b1ee9cc8c9a5a0a76561ec4

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Anber commented 2 months ago

Thank you @brijeshb42!