Skip to content

Signals vite#900

Merged
JoviDeCroock merged 14 commits intomainfrom
signals-vite
Mar 16, 2026
Merged

Signals vite#900
JoviDeCroock merged 14 commits intomainfrom
signals-vite

Conversation

@JoviDeCroock
Copy link
Copy Markdown
Member

@JoviDeCroock JoviDeCroock commented Mar 10, 2026

This PR adds a new vite plugin which does several things

  • It injects the preact/react babel plugin when you provide the framework
  • It will create a few endpoints on your vite dev-server that can be used to observe page-state

Relates to https://x.com/JoviDeC/status/2031404460178833693

I want to apologize in advance for the huge amount of code, I could not have done this in the time it took without the help of GPT5.4

One open question is how to distribute a skill like this.

For the curious, I wrote about this flow in https://jovidecroock.com/blog/llm-signals-debugging

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 10, 2026

Deploy Preview for preact-signals-demo ready!

Name Link
🔨 Latest commit e730ce1
🔍 Latest deploy log https://app.netlify.com/projects/preact-signals-demo/deploys/69b791326da4760008f41e58
😎 Deploy Preview https://deploy-preview-900--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 project configuration.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 10, 2026

🦋 Changeset detected

Latest commit: e730ce1

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-agent-vite 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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 10, 2026

Size Change: +16.8 kB (+10.57%) ⚠️

Total Size: 176 kB

Filename Size Change
docs/dist/assets/bench-********.js 1.6 kB +1 B (+0.06%)
docs/dist/assets/index-********.js 835 B +1 B (+0.12%)
docs/dist/assets/style-********.css 5.26 kB +115 B (+2.24%)
packages/vite-plugin/dist/vite-plugin.js 8.86 kB +8.86 kB (new file) 🆕
packages/vite-plugin/dist/vite-plugin.mjs 7.86 kB +7.86 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
docs/dist/assets/client-********.js 46.6 kB
docs/dist/assets/devtools-********.js 907 B
docs/dist/assets/EmbeddedDevtools-********.js 16.6 kB
docs/dist/assets/jsxRuntime.module-********.js 300 B
docs/dist/assets/preact.module-********.js 4.74 kB
docs/dist/assets/signals-core.module-********.js 1.85 kB
docs/dist/assets/signals.module-********.js 2.64 kB
docs/dist/assets/Unmount-********.js 649 B
docs/dist/assets/utils.module-********.js 431 B
docs/dist/basic-********.js 244 B
docs/dist/nesting-********.js 1.14 kB
docs/dist/react-********.js 242 B
packages/core/dist/signals-core.js 1.88 kB
packages/core/dist/signals-core.mjs 1.87 kB
packages/debug/dist/debug.js 4.58 kB
packages/debug/dist/debug.mjs 4.09 kB
packages/devtools-adapter/dist/devtools-adapter.js 2.17 kB
packages/devtools-adapter/dist/devtools-adapter.mjs 1.88 kB
packages/devtools-ui/dist/devtools-ui.js 15.2 kB
packages/devtools-ui/dist/devtools-ui.mjs 14.6 kB
packages/preact-transform/dist/signals-transform.js 1.3 kB
packages/preact-transform/dist/signals-transform.mjs 1.29 kB
packages/preact-transform/dist/signals-transform.umd.js 1.42 kB
packages/preact/dist/signals.js 1.81 kB
packages/preact/dist/signals.mjs 1.75 kB
packages/react-transform/dist/signals-transform.js 7.28 kB
packages/react-transform/dist/signals-transform.mjs 6.47 kB
packages/react-transform/dist/signals-transform.umd.js 7.39 kB
packages/react/dist/signals.js 214 B
packages/react/dist/signals.mjs 165 B

compressed-size-action

endpointBase: string;
}

export function createClientModuleCode(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it possible to read this file in from disk? So we can get type checking, linting, etc at dev time.

Like read an actual TS file then replace some magic strings with the defaults

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 prefer to do this separately as it would be a large change where we need to transpile ts of this

Clear active sessions on reset and align tests/docs with the remaining event sources after removing console capture.
Keep active sessions alive when clearing buffered events so clients can reuse existing filters across debugging runs.
Avoid exact session object equality so production builds do not fail on createdAt and updatedAt variability across responses.
Load the React and Preact transform packages on demand so projects only need the one they use. Document the optional setup and keep TypeScript aligned with the dynamic import support.
@@ -0,0 +1,5 @@
---
"@preact/signals-vite-plugin": minor
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this will need a tweak now, I imagine it'll fail to find this when publishing?

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.

It will initially fail, I will manually publish 0.0.0 and then the minor version will do 0.1.0 - I do have to adjust the package name indeed 😅 I naively just did the package.json

@JoviDeCroock JoviDeCroock merged commit 5866205 into main Mar 16, 2026
6 checks passed
@JoviDeCroock JoviDeCroock deleted the signals-vite branch March 16, 2026 16:53
@github-actions github-actions bot mentioned this pull request Mar 16, 2026
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.

3 participants