Skip to content

Revert react integration to tracking current dispatcher - #335

Merged
andrewiggins merged 13 commits into
mainfrom
react-adapter-update
Apr 6, 2023
Merged

Revert react integration to tracking current dispatcher#335
andrewiggins merged 13 commits into
mainfrom
react-adapter-update

Conversation

@andrewiggins

@andrewiggins andrewiggins commented Mar 30, 2023

Copy link
Copy Markdown
Member

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

changeset-bot Bot commented Mar 30, 2023

Copy link
Copy Markdown

🦋 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

netlify Bot commented Mar 30, 2023

Copy link
Copy Markdown

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

github-actions Bot commented Mar 30, 2023

Copy link
Copy Markdown
Contributor

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

Comment thread packages/react/src/index.ts Outdated
@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

This is really good job

Comment thread packages/react/src/index.ts Outdated
@XantreDev

Copy link
Copy Markdown
Contributor

When it will be merged?

@ShivamJoker

Copy link
Copy Markdown

Hoping it fixes some of my issues as well.

@andrewiggins

Copy link
Copy Markdown
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
Copy Markdown

@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