You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -253,6 +253,28 @@ pnpm lint
253
253
254
254
- CI runs on Node 18+ and uses PNPM and Turbo to install, type-check, build, and test the monorepo.
255
255
- Docs are built with Vite and deployed to GitHub Pages from `docs/dist`.
256
+
257
+
## 🔄 Migration Guide (v2 → v3)
258
+
259
+
Major changes in v3.0.0 modernize the architecture and usage. Here’s how to update:
260
+
261
+
- New packages: The project is now a PNPM monorepo with `@react-code-view/react`, `@react-code-view/core`, and `@react-code-view/unplugin`. The `react-code-view` package re-exports everything for convenience.
262
+
- Component imports: Prefer `react-code-view`for quick usage, or import directly from `@react-code-view/react`for granular control.
263
+
- Before (v2): `import { CodeView } from 'react-code-view'`
264
+
- After (v3): `import CodeView from 'react-code-view'` or `import { CodeView } from '@react-code-view/react'`
265
+
- Styles: Use the new CSS entry points.
266
+
- Before (v2): Less files (e.g., `react-code-view/less/styles.less`)
267
+
- After (v3): `import 'react-code-view/styles'` and optional syntax theme `import 'react-code-view/styles/highlight'`
268
+
- Build tool integration: Replace legacy Webpack markdown loader with the unified unplugin across tools.
269
+
- Before (v2): `webpack-md-loader` and custom loader config
270
+
- After (v3): `@react-code-view/unplugin`for Vite/Webpack/Rollup/esbuild/Rspack (see examples above)
271
+
- Hook behavior: `useCodeExecution` is stabilized to avoid unintended re-executions.
272
+
- New: `updateCode`aliasfor code changes; pass `dependencies` explicitly if runtime scope is needed
273
+
- If you relied on implicit re-runs via changing options, update to change `code` or manage your own triggers
274
+
- Types & tests: Vitest + jest-dom types included via package `tsconfig.json`.
275
+
- Add `types: ['vitest/globals', '@testing-library/jest-dom']`if customizing your test config
276
+
277
+
If you need help migrating specific code paths from v2, open an issue and we’ll guide you through it.
0 commit comments