Skip to content

Commit

Permalink
Merge pull request #89 from XaveScor/88-react-support
Browse files Browse the repository at this point in the history
88: react-support
  • Loading branch information
XaveScor authored Nov 20, 2024
2 parents a78db7e + 76c3fa9 commit c8ae094
Show file tree
Hide file tree
Showing 68 changed files with 709 additions and 286 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ Just install `typescript@^5.0.0` as a dev dependency and start creating ts files
### Babel
Just install `@babel/core@^7.0.0` as a dev dependency and create a Babel configuration file in the project root.

### React
Just install `react`. More information on React integration can be found [here](./docs/react.md).

## `package.json` limitations
To reduce potential errors and ensure smooth package generation, we follow a stricter configuration for `package.json`.

Expand Down
8 changes: 8 additions & 0 deletions docs/react.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# React Integration

## Installation
Simply install `react` in your project, and you're all set to use it.

## Optimizations
- For `react@<17.0.0`, SmartBundle compiles JSX files into `React.createElement` calls.
- For `react@>=17.0.0`, SmartBundle compiles JSX files into `jsx/runtime` [calls](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html).
284 changes: 138 additions & 146 deletions e2e/e2e.test.ts

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,24 @@
"license": "MIT",
"devDependencies": {
"@types/babel__core": "^7.20.5",
"@types/node": "^20.14.11",
"@types/node": "^20.17.6",
"@types/semver": "^7.5.8",
"@types/yargs": "^17.0.33",
"prettier": "^3.3.3",
"typescript": "^5.6.3",
"vitest": "^2.1.3",
"vitest": "^2.1.5",
"vitest-directory-snapshot": "^0.2.2",
"zx": "^8.1.9"
"zx": "^8.2.2"
},
"dependencies": {
"vite": "^5.4.9",
"semver": "^7.6.3",
"vite": "^5.4.11",
"yargs": "^17.7.2",
"zod": "^3.23.8"
},
"optionalDependencies": {
"typescript": "^5.0.0",
"@babel/core": "^7.0.0"
"@babel/core": "^7.26.0",
"typescript": "^5.6.3"
},
"exports": "./src/index.ts"
}
Loading

0 comments on commit c8ae094

Please sign in to comment.