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(core): Restore stricter effect callback & cleanup function types #558

Merged
merged 3 commits into from Apr 13, 2024

Conversation

jviide
Copy link
Contributor

@jviide jviide commented Apr 13, 2024

This pull request restores the stricter types for effect callbacks and effect cleanup functions introduced in #249. Core tests needed to be modified slightly to accommodate these typing changes.

These stricter types were later changed back to allowing both effect callbacks and effect cleanup functions return unknown. It is convenient to allow anything to be returned, especially when writing tests like effect(() => s.value++). On the other hand stricter types can be useful for catching e.g. attempts to have asynchronous effect handlers, which the core does not support (effect(async () => { ... })).

It's debatable whether this change would warrant a patch or major release. I've tentatively chosen a patch changeset, as the previous related changes were also patch changes.

Copy link

changeset-bot bot commented Apr 13, 2024

🦋 Changeset detected

Latest commit: c8c95ac

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-core 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

Copy link

netlify bot commented Apr 13, 2024

Deploy Preview for preact-signals-demo ready!

Name Link
🔨 Latest commit c8c95ac
🔍 Latest deploy log https://app.netlify.com/sites/preact-signals-demo/deploys/661aea4b40bfc100087e0cc4
😎 Deploy Preview https://deploy-preview-558--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.

Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for improving this 💯

@marvinhagemeister marvinhagemeister merged commit bd5c4d8 into preactjs:main Apr 13, 2024
6 checks passed
@github-actions github-actions bot mentioned this pull request Apr 13, 2024
@jviide jviide deleted the patch-01 branch April 13, 2024 20:44
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.

None yet

2 participants