{"id":16625618,"url":"https://github.com/aleclarson/react-dev-ssr","last_synced_at":"2025-08-16T11:10:21.258Z","repository":{"id":61711138,"uuid":"554375910","full_name":"aleclarson/react-dev-ssr","owner":"aleclarson","description":"JSX runtime + Babel transform – Step through React component trees with a synchronous stack trace","archived":false,"fork":false,"pushed_at":"2022-10-20T14:39:06.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T12:18:40.538Z","etag":null,"topics":[],"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/aleclarson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-19T17:56:46.000Z","updated_at":"2022-11-03T20:46:48.000Z","dependencies_parsed_at":"2023-01-20T07:00:25.774Z","dependency_job_id":null,"html_url":"https://github.com/aleclarson/react-dev-ssr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aleclarson/react-dev-ssr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Freact-dev-ssr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Freact-dev-ssr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Freact-dev-ssr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Freact-dev-ssr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleclarson","download_url":"https://codeload.github.com/aleclarson/react-dev-ssr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Freact-dev-ssr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270702562,"owners_count":24630877,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-12T04:06:29.308Z","updated_at":"2025-08-16T11:10:21.231Z","avatar_url":"https://github.com/aleclarson.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-dev-ssr\n\nA custom JSX runtime + Babel transform that runs your React SSR code in a way that makes the stack trace actually useful. You can see every ancestor component and where the current component exists in its immediate parent.\n\n## How it works\n\nEvery JSX element using a custom component is wrapped with the `jsxCallSite` function from `react-dev-ssr/jsx-runtime` module. This wraps the element with a closure, creating a stack frame where the element was declared. Since the `react-dev-ssr` runtime is synchronous, you will which JSX elements led to the invocation of the current stack of components being rendered.\n\nEvery JSX child expression is also wrapped with `jsxCallSite`, so you can see where exactly each component was declared inside its parent component.\n\nSince the `react-dev-ssr` runtime only runs on the server, it doesn't need to implement any concept of re-rendering. This allows for a drastically simplified runtime. Many of React's features are no-ops on the server (eg: `useEffect`, `React.memo`, etc).\n\n## Help wanted\n\nThis is a work-in-progress. Many React features are missing that you might be using. If you find a missing feature, please open an issue or PR. **If your React app is relatively basic, this package should work just fine!**\n\n- Suspense\n- Class components\n- `cloneElement`\n- `isValidElement`\n- `React.Children`\n- `React.lazy`\n- `useReducer`\n- `useId`\n\n## Usage\n\n```\npnpm install react-dev-ssr\n```\n\n### Using with Vite\n\nIn your Vite config, add the following code:\n\n```ts\nimport reactDevSSR from 'react-dev-ssr/vite'\nimport react from '@vitejs/plugin-react'\n\nexport default defineConfig({\n  plugins: [react(), reactDevSSR()],\n})\n```\n\n\u003e **Warning**\n\u003e Vite support is pending a PR to Vite:\n\u003e https://github.com/vitejs/vite/pull/10552\n\n### Using with Babel\n\nIn your Babel config, add the following to your plugins array:\n\n```ts\n'react-dev-ssr/jsx-transform'\n```\n\nYou also need to swap out `react` and `react-dom/server` imports with `react-dev-ssr`. The bundler you're using will determine how this is done.\n\n- **Webpack**  \n  Use the [`resolve.alias`](https://webpack.js.org/configuration/resolve/#resolvealias) built-in option.\n\n- **Parcel**  \n  Use the [\"Package Aliases\"](https://parceljs.org/features/dependency-resolution/#aliases) built-in feature.\n\n- **Rollup**  \n  Use the [`@rollup/plugin-alias`](https://www.npmjs.com/package/@rollup/plugin-alias) plugin.\n\n- **ESBuild**  \n  Use the [`esbuild-plugin-alias`](https://github.com/igoradamenko/esbuild-plugin-alias) plugin.\n\n- **Babel**  \n  If you're not using a bundler, you can try using the [`babel-plugin-import-replacement`](https://github.com/BuggMaker/babel-plugin-import-replacement) plugin.\n\nDepending on which tool you're using, it might be difficult for you to apply `react-dev-ssr` aliases **in development SSR only**. If you figure it out, please open a PR to add it to this README.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Freact-dev-ssr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleclarson%2Freact-dev-ssr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Freact-dev-ssr/lists"}