{"id":13496184,"url":"https://github.com/yellowsink/solid-reactor","last_synced_at":"2025-07-25T17:31:15.553Z","repository":{"id":57676801,"uuid":"479555349","full_name":"yellowsink/solid-reactor","owner":"yellowsink","description":"A compiler to ease the move from React to SolidJS.","archived":false,"fork":false,"pushed_at":"2022-10-19T08:40:01.000Z","size":106,"stargazers_count":30,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-17T20:29:53.416Z","etag":null,"topics":["compiler","javascript","js-framework","migration","react","solid","solid-js","swc"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yellowsink.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-08T22:30:11.000Z","updated_at":"2024-02-25T10:31:27.000Z","dependencies_parsed_at":"2022-09-03T00:01:48.071Z","dependency_job_id":null,"html_url":"https://github.com/yellowsink/solid-reactor","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yellowsink%2Fsolid-reactor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yellowsink%2Fsolid-reactor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yellowsink%2Fsolid-reactor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yellowsink%2Fsolid-reactor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yellowsink","download_url":"https://codeload.github.com/yellowsink/solid-reactor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222403038,"owners_count":16978780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","javascript","js-framework","migration","react","solid","solid-js","swc"],"created_at":"2024-07-31T19:01:43.516Z","updated_at":"2024-10-31T11:30:59.447Z","avatar_url":"https://github.com/yellowsink.png","language":"TypeScript","readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/yellowsink/solid-reactor/master/reactor.svg\" width=\"100\" /\u003e\n  \n  Reactor\n\u003c/h1\u003e\n\n[![SWC](https://img.shields.io/badge/transforms%20by-SWC-orange)](https://swc.rs)\n[![EmitKit](https://img.shields.io/badge/enhanced%20with-EmitKit-blueviolet)](https://github.com/yellowsink/emitkit)\n\n---\n\n[CLICK HERE FOR SOLIDHACK SUBMISSION DEMO VIDEO](https://youtu.be/Yt-_b3h0SjE)\n\nA compiler to ease the move from React to SolidJS.\n\n## Features\n\n - Converts the following hooks to Solid equivalents:\n   * `useState` -\u003e `createSignal`\n   * `useEffect` -\u003e `createEffect`\n     - attempting to recreate the \"run on every rerender\" behaviour\n   * `useReducer` -\u003e `createSignal` + a function\n   * `useRef` -\u003e `{ current: \u003cvalue\u003e }` + a variable\n     - convert (useRef-returned only) refs in `ref={myRef}` to `ref={myRef.current}`.\n\n- Converts camel case (`marginRight`) style names to skewer case (`margin-right`)\n\n## Example\n```js\nexport default () =\u003e {\n  const [state, setState] = React.useState(0);\n\n  let [, rerender] = useReducer((a) =\u003e ~a, 0);\n\n  Reactor.useEffect(() =\u003e console.log(state));\n\n  const myRef = useRef();\n\n  return (\n    \u003c\u003e\n      \u003cbutton onClick={() =\u003e setState(state * 2)} style={`color: red`} /\u003e\n\n      {state}\n\n      \u003cdiv style={{ marginRight: \"5rem\" }}\u003e\n        \u003cspan ref={myRef} /\u003e\n      \u003c/div\u003e\n    \u003c/\u003e\n  );\n};\n```\n\n```js\nexport default () =\u003e {\n  const [state, setState] = createSignal(0);\n\n  let [$$__REACTOR_UNIQUE_VAR_1, $$__REACTOR_UNIQUE_VAR_0] = createSignal(0);\n  const rerender = () =\u003e\n    $$__REACTOR_UNIQUE_VAR_0(((a) =\u003e ~a)($$__REACTOR_UNIQUE_VAR_1()));\n\n  createEffect(() =\u003e console.log(state()));\n\n  const myRef = {};\n\n  return (\n    \u003c\u003e\n      \u003cbutton onClick={() =\u003e setState(state() * 2)} style={`color: red`} /\u003e\n\n      {state()}\n\n      \u003cdiv style={{ \"margin-right\": \"5rem\" }}\u003e\n        \u003cspan ref={myRef.current} /\u003e\n      \u003c/div\u003e\n    \u003c/\u003e\n  );\n};\n\n```\n(output hand-prettified,\nbut youre likely to either be using this as a build step,\nor have a codebase with a formatter setup)\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyellowsink%2Fsolid-reactor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyellowsink%2Fsolid-reactor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyellowsink%2Fsolid-reactor/lists"}