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

Remove auto tracking using React internals from signals-react package #467

Merged
merged 8 commits into from
Dec 18, 2023

Conversation

andrewiggins
Copy link
Member

Before this change, importing @preact/signals-react would invoke side effects that hook into React internals to automatically track signals. This change removes those side effects and requires consumers to update their code to continue using signals in React.

To continue the "auto-tracking" mechanism, users can import @preact/signals-react/auto to keep the previous mechanism in place.

I'm also adding support for the comment @useSignals and @noUseSignals to be consistent with the hook people can use to track signals: useSignals().

Copy link

changeset-bot bot commented Dec 15, 2023

🦋 Changeset detected

Latest commit: 46ef04a

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

This PR includes changesets to release 2 packages
Name Type
@preact/signals-react Major
@preact/signals-react-transform 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

Copy link

netlify bot commented Dec 15, 2023

Deploy Preview for preact-signals-demo ready!

Name Link
🔨 Latest commit 46ef04a
🔍 Latest deploy log https://app.netlify.com/sites/preact-signals-demo/deploys/657cfa7c68dd660008636e03
😎 Deploy Preview https://deploy-preview-467--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
Contributor

Size Change: -3.14 kB (-4%)

Total Size: 81 kB

Filename Size Change
docs/dist/assets/client.********.js 46.3 kB -481 B (-1%)
docs/dist/nesting-********.js 1.13 kB -2 B (0%)
docs/dist/react-********.js 242 B +4 B (+2%)
packages/react-transform/dist/signals-*********.js 4.76 kB +7 B (0%)
packages/react-transform/dist/signals-transform.mjs 4 kB +6 B (0%)
packages/react-transform/dist/signals-transform.umd.js 4.87 kB +7 B (0%)
packages/react/dist/signals.js 189 B -1.34 kB (-88%) 🏆
packages/react/dist/signals.mjs 150 B -1.34 kB (-90%) 🏆
ℹ️ View Unchanged
Filename Size
docs/dist/assets/index.********.js 1.07 kB
docs/dist/assets/jsxRuntime.module.********.js 281 B
docs/dist/assets/preact.module.********.js 4.02 kB
docs/dist/assets/signals-core.module.********.js 1.46 kB
docs/dist/assets/signals.module.********.js 2.02 kB
docs/dist/assets/style.********.js 21 B
docs/dist/assets/style.********.css 1.21 kB
docs/dist/basic-********.js 244 B
docs/dist/demos-********.js 3.41 kB
packages/core/dist/signals-core.js 1.54 kB
packages/core/dist/signals-core.mjs 1.56 kB
packages/preact/dist/signals.js 1.27 kB
packages/preact/dist/signals.mjs 1.22 kB

compressed-size-action

@andrewiggins andrewiggins merged commit d7f43ef into main Dec 18, 2023
6 checks passed
@andrewiggins andrewiggins deleted the react-signals-v2 branch December 18, 2023 23:25
@github-actions github-actions bot mentioned this pull request Dec 18, 2023
@mimiqkz
Copy link

mimiqkz commented Jan 16, 2024

Need documentation and examples on this

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.

4 participants