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

fix: Ensure that text effects get disposed #647

Merged
merged 2 commits into from
Jan 12, 2025

Conversation

jviide
Copy link
Contributor

@jviide jviide commented Jan 11, 2025

This pull request fixes a case in the Preact bindings where effects created for optimized text updates didn't get disposed. This in turn could cause intermediate computeds to never get garbage collected as long as their dependencies didn't get garbage collected.

There's a new test for this scenario. The test passes after applying this PR.

There is also an additional modification to mangle.json: The pure_effects option is now set to false, because .value accesses for signals are not pure. This caused the minifier to remove and reorder important .value accesses in a way that internal effects weren't always depending on them properly, causing the production tests to fail.

Copy link

netlify bot commented Jan 11, 2025

Deploy Preview for preact-signals-demo ready!

Name Link
🔨 Latest commit e3c4a26
🔍 Latest deploy log https://app.netlify.com/sites/preact-signals-demo/deploys/67836f727969980008bc4660
😎 Deploy Preview https://deploy-preview-647--preact-signals-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jviide jviide force-pushed the dispose-text-effects branch from dae6f51 to e2ab081 Compare January 11, 2025 21:55
Copy link

changeset-bot bot commented Jan 11, 2025

🦋 Changeset detected

Latest commit: e3c4a26

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

This PR includes changesets to release 1 package
Name Type
@preact/signals Patch

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

@jviide jviide marked this pull request as ready for review January 11, 2025 22:14
@jviide jviide force-pushed the dispose-text-effects branch from e2ab081 to 8438477 Compare January 11, 2025 23:11
@JoviDeCroock JoviDeCroock merged commit 655905b into preactjs:main Jan 12, 2025
6 checks passed
@github-actions github-actions bot mentioned this pull request Jan 12, 2025
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.

2 participants