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

[React]: Preact Signals Dependency Update #188

Open
ps73 opened this issue Mar 4, 2024 · 11 comments · May be fixed by #191
Open

[React]: Preact Signals Dependency Update #188

ps73 opened this issue Mar 4, 2024 · 11 comments · May be fixed by #191
Assignees
Labels
enhancement New feature or request priority This has priority

Comments

@ps73
Copy link

ps73 commented Mar 4, 2024

I am using preact signals in my react app und currently using v2. This lib uses v1.
It would be great if @preact/signals could be upgraded to v2.

@ps73 ps73 changed the title [REACT]: Preact Signals Dependency Update [React]: Preact Signals Dependency Update Mar 4, 2024
@fabian-hiller
Copy link
Owner

Thank you for the info. I will investigate v2 in the next days and publish a new version.

@fabian-hiller fabian-hiller self-assigned this Mar 4, 2024
@fabian-hiller fabian-hiller added enhancement New feature or request priority This has priority labels Mar 4, 2024
@fabian-hiller
Copy link
Owner

What happens if you ignore the peer dependency warning? Does Modular Forms still work as expected in development and production mode?

@ps73
Copy link
Author

ps73 commented Mar 6, 2024

I think a babel plugin is needed to get v2 working correctly.

https://github.com/preactjs/signals/tree/main/packages/react#babel-transform

@fabian-hiller
Copy link
Owner

Does Modular Forms still work as expected if you ignore the peer dependency warning? I am asking to find out if this is only necessary for end users.

@ps73
Copy link
Author

ps73 commented Mar 6, 2024

It didn't work for me. For example {field.error.value} didn't rerender on validation error.

@fabian-hiller
Copy link
Owner

After you added the Bable plugin?

@ps73
Copy link
Author

ps73 commented Mar 6, 2024

Yeah added babel plugin to vite config inside the react plugin and couldn't make it work fastly. But I had not that much time to debug it.

@fabian-hiller
Copy link
Owner

Ok. Feel free to add the Bable plugin to this repo in packages/react and see if it works.

@awhitford
Copy link

I updated the @preact/signals-react dependency from ^1.3.4 to ^2.0.0. and the pnpm install gave the following warnings:

WARN  Issues with peer dependencies found
playgrounds/qwik
└─┬ vite-tsconfig-paths 4.3.1
  └─┬ tsconfck 3.0.1
    └── ✕ unmet peer typescript@^5.0.0: found 4.9.5

playgrounds/solid
└─┬ solid-start 0.2.26
  └── ✕ unmet peer vite@^4.1.4: found 3.2.5

website
└─┬ solid-start 0.2.26
  └── ✕ unmet peer vite@^4.1.4: found 3.2.5

However, the React Playground seems to be working fine. I don't see a problem with field errors.

@awhitford awhitford linked a pull request Mar 11, 2024 that will close this issue
@ps73
Copy link
Author

ps73 commented Mar 11, 2024

Cannot confirm this @awhitford.

When passing field.error.value down as a prop, it will not be changed when using v2 with or without the babel plugin:
https://stackblitz.com/edit/vitejs-vite-otlhs7?file=src%2FApp.tsx

When using v1.3.8 it works as expected:
https://stackblitz.com/edit/vitejs-vite-7tjm6f?file=src/App.tsx

@fabian-hiller
Copy link
Owner

I will check and merge PR #191 tomorrow or in the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority This has priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants