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
+33-15Lines changed: 33 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,9 @@ Run your React code on the go [https://react-runner.vercel.app](https://react-ru
8
8
- Function component
9
9
- Class component, **with class fields support**
10
10
- Composing components with `render` or `export default`
11
-
- Support `Typescript`
12
11
- Server Side Rendering
12
+
- Support `Typescript`
13
+
- Support `import` statement via `createRequire` utility
13
14
14
15
Hacker News [in react-runner](https://react-runner.vercel.app/#hacker-news) vs [in real world](https://react-runner.vercel.app/examples/hacker-news), with the same code
// you can define your own version of `createRequire`
62
+
import { createRequire } from'react-runner'
63
+
import*asYourPkgfrom'your-pkg'
64
+
65
+
constscope= {
66
+
require:createRquire({
67
+
'your-pkg': YourPkg,
68
+
}),
69
+
}
70
+
```
71
+
72
+
then in your code you can use `import Foo, { Bar } from 'your-pkg'`
73
+
55
74
## Browser support
56
75
57
76
```
@@ -70,7 +89,7 @@ I love it, but I love arrow functions for event handlers instead of bind them ma
70
89
and I don't want to change my code to be compliant with restrictions, so I created this project,
71
90
use [Sucrase](https://github.com/alangpierce/sucrase) instead of [Bublé](https://github.com/bublejs/buble) to transpile the code.
72
91
73
-
If you are using `react-live` in your project and want a smooth transition, `react-live-runner` is there for you which provide the identical way to play with:
92
+
If you are using `react-live` in your project and want a smooth transition, `react-live-runner` is there for you which provide the identical way to play with, and `react-live-runner` re-exports `react-runner` so you can use everything in `react-runner` by importing `react-live-runner`
Copy file name to clipboardExpand all lines: packages/react-live-runner/README.md
+33-15Lines changed: 33 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,9 @@ Run your React code on the go [https://react-runner.vercel.app](https://react-ru
8
8
- Function component
9
9
- Class component, **with class fields support**
10
10
- Composing components with `render` or `export default`
11
-
- Support `Typescript`
12
11
- Server Side Rendering
12
+
- Support `Typescript`
13
+
- Support `import` statement via `createRequire` utility
13
14
14
15
Hacker News [in react-runner](https://react-runner.vercel.app/#hacker-news) vs [in real world](https://react-runner.vercel.app/examples/hacker-news), with the same code
// you can define your own version of `createRequire`
62
+
import { createRequire } from'react-runner'
63
+
import*asYourPkgfrom'your-pkg'
64
+
65
+
constscope= {
66
+
require:createRquire({
67
+
'your-pkg': YourPkg,
68
+
}),
69
+
}
70
+
```
71
+
72
+
then in your code you can use `import Foo, { Bar } from 'your-pkg'`
73
+
55
74
## Browser support
56
75
57
76
```
@@ -70,7 +89,7 @@ I love it, but I love arrow functions for event handlers instead of bind them ma
70
89
and I don't want to change my code to be compliant with restrictions, so I created this project,
71
90
use [Sucrase](https://github.com/alangpierce/sucrase) instead of [Bublé](https://github.com/bublejs/buble) to transpile the code.
72
91
73
-
If you are using `react-live` in your project and want a smooth transition, `react-live-runner` is there for you which provide the identical way to play with:
92
+
If you are using `react-live` in your project and want a smooth transition, `react-live-runner` is there for you which provide the identical way to play with, and `react-live-runner` re-exports `react-runner` so you can use everything in `react-runner` by importing `react-live-runner`
Copy file name to clipboardExpand all lines: packages/react-runner/README.md
+33-15Lines changed: 33 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,9 @@ Run your React code on the go [https://react-runner.vercel.app](https://react-ru
8
8
- Function component
9
9
- Class component, **with class fields support**
10
10
- Composing components with `render` or `export default`
11
-
- Support `Typescript`
12
11
- Server Side Rendering
12
+
- Support `Typescript`
13
+
- Support `import` statement via `createRequire` utility
13
14
14
15
Hacker News [in react-runner](https://react-runner.vercel.app/#hacker-news) vs [in real world](https://react-runner.vercel.app/examples/hacker-news), with the same code
// you can define your own version of `createRequire`
62
+
import { createRequire } from'react-runner'
63
+
import*asYourPkgfrom'your-pkg'
64
+
65
+
constscope= {
66
+
require:createRquire({
67
+
'your-pkg': YourPkg,
68
+
}),
69
+
}
70
+
```
71
+
72
+
then in your code you can use `import Foo, { Bar } from 'your-pkg'`
73
+
55
74
## Browser support
56
75
57
76
```
@@ -70,7 +89,7 @@ I love it, but I love arrow functions for event handlers instead of bind them ma
70
89
and I don't want to change my code to be compliant with restrictions, so I created this project,
71
90
use [Sucrase](https://github.com/alangpierce/sucrase) instead of [Bublé](https://github.com/bublejs/buble) to transpile the code.
72
91
73
-
If you are using `react-live` in your project and want a smooth transition, `react-live-runner` is there for you which provide the identical way to play with:
92
+
If you are using `react-live` in your project and want a smooth transition, `react-live-runner` is there for you which provide the identical way to play with, and `react-live-runner` re-exports `react-runner` so you can use everything in `react-runner` by importing `react-live-runner`
0 commit comments