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

Removed difference in behaviour of @preact/signals and @preact/signal… #387

Conversation

XantreDev
Copy link
Contributor

@XantreDev XantreDev commented Jul 15, 2023

Resolves ##383

When we return a VNode in a signal/computed we would incorrectly try to treat this as a text-node, which would result in us incorrectly triggering changes

@changeset-bot
Copy link

changeset-bot bot commented Jul 15, 2023

🦋 Changeset detected

Latest commit: 7d5ad6e

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 Minor

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

@netlify
Copy link

netlify bot commented Jul 15, 2023

Deploy Preview for preact-signals-demo ready!

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

@XantreDev
Copy link
Contributor Author

@andrewiggins i think it has no performance overhead in case of rendering string into Text nodes directly, but adds oprtunity to render jsx inside signal.
Researching preact source code was fun.

There are oprtunity when chaning signal type jsx -> string, to directly create Text node and replace it in this.base and this.__v.__e, but i am not sure will it give real performance boost

@XantreDev
Copy link
Contributor Author

I will add changeset after review

@XantreDev
Copy link
Contributor Author

@JoviDeCroock please check this PR 🙏🙏🙏

packages/preact/test/index.test.tsx Outdated Show resolved Hide resolved
packages/preact/test/index.test.tsx Show resolved Hide resolved
packages/preact/src/index.ts Show resolved Hide resolved
Copy link
Contributor Author

@XantreDev XantreDev left a comment

Choose a reason for hiding this comment

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

Thanks for review

@XantreDev
Copy link
Contributor Author

Fixed comments @JoviDeCroock

@JoviDeCroock
Copy link
Member

This also needs a changeset and probably a rebase/merge so the netlify checks start succeeding

@XantreDev
Copy link
Contributor Author

@JoviDeCroock please check)

we don't need to talk about these to the outside world
packages/preact/src/index.ts Show resolved Hide resolved
@JoviDeCroock JoviDeCroock merged commit 6e4dab4 into preactjs:main Jul 31, 2023
@github-actions github-actions bot mentioned this pull request Jul 26, 2023
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