Skip to content

Commit

Permalink
Preparation to align SWC plugin with `@preact/signals-react-transform…
Browse files Browse the repository at this point in the history
…` output (#195)

* unified regex with babel origin

* transformHooks implemented

* make 'all' transform to behave only on Component level

* working version

* refactor and start code for new option

* refactor

* wip

* simplification

* test support of context aware transforms

* removed duplicate changeset

* removed useless overhead

* started to tests agains original

* small fix

* wip

* temporary tests turn off

* fixed tests
  • Loading branch information
XantreDev authored Nov 10, 2024
1 parent 8c5b55e commit 46f2d7e
Show file tree
Hide file tree
Showing 9 changed files with 3,295 additions and 1,790 deletions.
7 changes: 7 additions & 0 deletions .changeset/nine-olives-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"transformer-playground": patch
"@preact-signals/safe-react": patch
"@preact-signals/utils": patch
---

Updated babel version to remove browserlist warnings
6 changes: 3 additions & 3 deletions apps/transformer-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"preview": "vite preview"
},
"dependencies": {
"@babel/plugin-syntax-jsx": "^7.24.1",
"@babel/preset-env": "^7.24.6",
"@babel/standalone": "^7.24.3",
"@babel/plugin-syntax-jsx": "^7.25.9",
"@babel/preset-env": "^7.25.9",
"@babel/standalone": "^7.25.9",
"@monaco-editor/react": "^4.6.0",
"@preact-signals/safe-react": "workspace:*",
"@preact-signals/utils": "workspace:*",
Expand Down
7 changes: 4 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@
"lint": "check-export-map"
},
"dependencies": {
"@babel/helper-module-imports": "7.24.3",
"@babel/helper-plugin-utils": "^7.22.5",
"@babel/helper-module-imports": "7.25.9",
"@babel/helper-plugin-utils": "^7.25.9",
"@preact/signals-core": "^1.6.0",
"debug": "^4.3.4",
"hotscript": "^1.0.13",
Expand All @@ -131,7 +131,8 @@
"@swc/core": "~1.4.0"
},
"devDependencies": {
"@babel/traverse": "^7.24.5",
"@babel/traverse": "^7.25.9",
"@preact/signals-react-transform": "^0.4.0",
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-typescript": "^11.1.6",
"@swc/core": "~1.4.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/react/src/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,10 @@ export interface PluginOptions {
* @default "@preact-signals/safe-react/tracking"
*/
importSource?: string;
experimental?: {};
experimental?: {
// apliable only to swc plugin
addHookUsageFlag?: boolean;
};
}

function log(
Expand Down
Loading

0 comments on commit 46f2d7e

Please sign in to comment.