Skip to content

Commit 7c387af

Browse files
committed
Added MDXProvider and TypeScript types
1 parent 4b17d5c commit 7c387af

8 files changed

Lines changed: 392 additions & 201 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### 0.7.0
4+
5+
- added MDX provider implementation
6+
37
### 0.6.0
48

59
- moved from regx to list of valid attributes and properties replaced for SVG and CSS respectively

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,30 @@ const options: Record<string, Component> = {
123123
/>;
124124
```
125125

126+
When nesting MDX files, importing components at the top or repeating the same set of those as parameters can become cumbersome.
127+
You can use MDXProvider to avoid this:
128+
129+
```jsx
130+
import { MDXProvider } from 'solid-jsx';
131+
132+
render(() => (
133+
<MDXProvider components={{ Tweet }}>
134+
<App />
135+
<MDXProvider>
136+
)
137+
);
138+
```
139+
140+
The package also provides Typescript support, the types can be referenced as "solid-jsx/types". In tsconfig.json:
141+
142+
```json
143+
{
144+
"compilerOptions": {
145+
"types": ["vite/client", "solid-jsx/types"]
146+
}
147+
}
148+
```
149+
126150
## Support
127151

128152
This project is free and open-source, so if you think this project can help you or

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "solid-jsx",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"description": "solid-js jsx compatible mdx runtime",
55
"main": "./dist/jsx-runtime.js",
66
"type": "module",
@@ -11,13 +11,13 @@
1111
},
1212
"types": "./dist/jsx-runtime.d.ts",
1313
"files": [
14-
"dist"
14+
"dist",
15+
"types.d.ts"
1516
],
1617
"sideEffects": false,
1718
"scripts": {
18-
"prebuild": "rimraf dist",
1919
"prepare": "husky install",
20-
"build": "pnpm prebuild && pnpm lint && pnpm pretty && tsup src/jsx-runtime.ts --dts --format esm --sourcemap --minify",
20+
"build": "pnpm lint && pnpm pretty && tsup",
2121
"lint": "pnpm eslint --fix ./src",
2222
"pretty": "prettier --ignore-path .gitignore --write ./src",
2323
"prepublishOnly": "pnpm build"
@@ -40,26 +40,26 @@
4040
},
4141
"homepage": "https://github.com/high1/solid-jsx#readme",
4242
"devDependencies": {
43-
"@typescript-eslint/eslint-plugin": "^5.10.0",
44-
"@typescript-eslint/parser": "^5.10.0",
45-
"eslint": "^8.7.0",
43+
"@typescript-eslint/eslint-plugin": "^5.11.0",
44+
"@typescript-eslint/parser": "^5.11.0",
45+
"eslint": "^8.9.0",
4646
"eslint-config-prettier": "^8.3.0",
4747
"eslint-import-resolver-typescript": "^2.5.0",
4848
"eslint-plugin-import": "^2.25.4",
4949
"eslint-plugin-prettier": "^4.0.0",
5050
"eslint-plugin-unicorn": "^40.1.0",
5151
"husky": "^7.0.4",
52-
"lint-staged": "^12.2.2",
52+
"lint-staged": "^12.3.4",
5353
"prettier": "^2.5.1",
5454
"rimraf": "^3.0.2",
55-
"tsup": "^5.11.11",
55+
"tsup": "^5.11.13",
5656
"typescript": "^4.5.5"
5757
},
5858
"lint-staged": {
5959
"*.{js,ts}": "eslint --fix",
6060
"*.{js,css,json,md,jsx,yml,yaml}": "prettier --ignore-path .gitignore --write"
6161
},
6262
"dependencies": {
63-
"solid-js": "^1.3.3"
63+
"solid-js": "^1.3.7"
6464
}
6565
}

0 commit comments

Comments
 (0)