Skip to content

Revert react integration to tracking current dispatcher #335

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

Merged
merged 13 commits into from
Apr 6, 2023

Conversation

andrewiggins
Copy link
Member

@andrewiggins andrewiggins commented Mar 30, 2023

Revert our react integration back to setting up signal subscription tracking by watching changes in the ReactCurrentDispatcher instead of proxying function Component calls in createElement so it works with more ecosystem libraries such as react-router-dom.

Check the comment in the source for a deeper discussion of the implementation details and choices.

Fixes #251
Fixes #330

@changeset-bot
Copy link

changeset-bot bot commented Mar 30, 2023

🦋 Changeset detected

Latest commit: 465cc0c

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-react 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 Mar 30, 2023

Deploy Preview for preact-signals-demo ready!

Name Link
🔨 Latest commit 465cc0c
🔍 Latest deploy log https://app.netlify.com/sites/preact-signals-demo/deploys/64261c2b57355400086e9609
😎 Deploy Preview https://deploy-preview-335--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 settings.

@andrewiggins andrewiggins force-pushed the react-adapter-update branch from 96f680e to 8415b8a Compare March 30, 2023 06:20
@github-actions
Copy link
Contributor

github-actions bot commented Mar 30, 2023

Size Change: +121 B (0%)

Total Size: 68.5 kB

Filename Size Change
docs/dist/assets/client.********.js 46.4 kB +13 B (0%)
docs/dist/nesting-********.js 1.13 kB +1 B (0%)
docs/dist/react-********.js 239 B +1 B (0%)
packages/react/dist/signals.js 1.08 kB +44 B (+4%)
packages/react/dist/signals.mjs 1.01 kB +62 B (+7%) 🔍
ℹ️ View Unchanged
Filename Size
docs/dist/assets/index.********.js 835 B
docs/dist/assets/jsxRuntime.module.********.js 282 B
docs/dist/assets/preact.module.********.js 4 kB
docs/dist/assets/signals-core.module.********.js 1.42 kB
docs/dist/assets/signals.module.********.js 1.97 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.35 kB
packages/core/dist/signals-core.js 1.48 kB
packages/core/dist/signals-core.mjs 1.5 kB
packages/preact/dist/signals.js 1.2 kB
packages/preact/dist/signals.mjs 1.15 kB

compressed-size-action

@andrewiggins andrewiggins force-pushed the react-adapter-update branch from 8415b8a to b158661 Compare March 30, 2023 06:25
@andrewiggins andrewiggins marked this pull request as ready for review March 30, 2023 06:33

import { signal } from "@preact/signals-react";
import { createElement } from "react";
import { Route, Routes, MemoryRouter } from "react-router-dom";
Copy link
Member Author

Choose a reason for hiding this comment

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

I was lazy and just pulled in react-router-dom to write the test for the current issue. I could instead write a minimal reproduction if people would like lol

@@ -0,0 +1,5 @@
---
"@preact/signals-react": minor
Copy link
Member Author

Choose a reason for hiding this comment

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

Making this a minor bump since it is a non-trivial but also non-breaking change to the react package

@XantreDev
Copy link
Contributor

This is really good job

@XantreDev
Copy link
Contributor

When it will be merged?

@ShivamJoker
Copy link

Hoping it fixes some of my issues as well.

@andrewiggins
Copy link
Member Author

Gonna go ahead and merge this now. Happy to address any feedback afterwards though. Just @-mention in any comments :)

@andrewiggins andrewiggins merged commit b37a223 into main Apr 6, 2023
@andrewiggins andrewiggins deleted the react-adapter-update branch April 6, 2023 20:13
@github-actions github-actions bot mentioned this pull request Apr 6, 2023
@salamaashoush
Copy link

@andrewiggins Thanks a lot for fixing that issue :D

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.

How to make Signals work with Routes Using signals package with react router results in a wierd jsx error
5 participants