Skip to content

Commit

Permalink
Fix use of react-dom vs react-native
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkcz committed Nov 8, 2020
1 parent 4434fe3 commit 01a050f
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .changeset/young-days-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"mobx-react-lite": patch
---

Fix use of react-dom vs react-native

The `es` folder content is compiled only without transpilation to keep `utils/reactBatchedUpdates` which exists in DOM and RN versions. The bundled `esm` is still kept around too, especially the prod/dev ones that should be utilized in modern browser environments.
2 changes: 2 additions & 0 deletions packages/mobx-react-lite/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/node_modules/

es/
lib/
dist/
coverage/

Expand Down
1 change: 0 additions & 1 deletion packages/mobx-react-lite/es/index.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/mobx-react-lite/lib/index.js

This file was deleted.

8 changes: 5 additions & 3 deletions packages/mobx-react-lite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"unpkg": "dist/mobxreactlite.umd.production.min.js",
"jsdelivr": "dist/mobxreactlite.umd.production.min.js",
"jsnext:main": "dist/mobxreactlite.esm.production.min.js",
"module": "dist/mobxreactlite.esm.js",
"react-native": "dist/mobxreactlite.esm.js",
"module": "es/index.js",
"react-native": "es/index.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"files": [
Expand Down Expand Up @@ -69,8 +69,10 @@
"lint": "eslint src/**/* --ext .js,.ts,.tsx",
"build": "node ../../scripts/build.js mobxreactlite",
"build:test": "yarn build --target test",
"build:cjs": "tsc --project tsconfig.build.cjs.json",
"build:es": "tsc --project tsconfig.build.es.json",
"test": "jest",
"test:size": "yarn import-size --report . observer useLocalObservable",
"prepublish": "yarn build --target publish"
"prepublish": "yarn build --target publish && yarn build:cjs && yarn build:es"
}
}
7 changes: 7 additions & 0 deletions packages/mobx-react-lite/tsconfig.build.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.build.json",
"compilerOptions": {
"outDir": "lib",
"module": "CommonJS"
}
}
7 changes: 7 additions & 0 deletions packages/mobx-react-lite/tsconfig.build.es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.build.json",
"compilerOptions": {
"outDir": "es",
"module": "ESNext"
}
}
9 changes: 9 additions & 0 deletions packages/mobx-react-lite/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"esModuleInterop": true,
"target": "ES5",
"noEmit": false,
"declaration": false
}
}

0 comments on commit 01a050f

Please sign in to comment.