react-native-onyx 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +9 -9
  2. package/package.json +5 -3
package/README.md CHANGED
@@ -430,14 +430,14 @@ The action logs use this naming convention:
430
430
 
431
431
  # Development
432
432
 
433
- `react-native` bundles source using the `metro` bundler. `metro` does not follow symlinks, so we can't use `npm link` to
434
- link a local version of Onyx during development
433
+ React Native bundles source code using the `metro` bundler. Until React Native 0.73, `metro` does not follow symlinks, so we can't use `npm link` to
434
+ link a local version of Onyx during development. Fortunately, we have set up a workflow that's easy to follow and enables
435
+ you to edit the Onyx source directly in the Onyx repo, and have those changes hot-reload in a React Native project in realtime.
435
436
 
436
- To quickly test small changes you can directly go to `node_modules/react-native-onyx` in the parent project and tweak original source code.
437
+ 1. In one terminal tab, open the `react-native-onyx` directory and run `npm run build:watch`
438
+ 2. In another terminal tab, open your React Native project and run `npx link publish <path_to_onyx_directory_on_your_machine>`
439
+ 3. Then run your React Native project as normal!
437
440
 
438
- To continuously work on Onyx we have to set up a task that copies content to parent project's `node_modules/react-native-onyx`:
439
- 1. Work on Onyx feature or a fix
440
- 2. Save files
441
- 3. Optional: run `npm run build` (if you're working or want to test on a non react-native project)
442
- - `npm link` would actually work outside of `react-native` and it can be used to link Onyx locally for a web only project
443
- 4. Copy Onyx to consumer project's `node_modules/react-native-onyx`
441
+ Now you can make changes directly to the `react-native-onyx` source code and your React Native project should-hot reload with those changes in realtime.
442
+
443
+ _Note:_ If you want to unlink `react-native-onyx`, simply run `npm install` from your React Native project directory again. That will reinstall `react-native-onyx` from npm.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-onyx",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "author": "Expensify, Inc.",
5
5
  "homepage": "https://expensify.com",
6
6
  "description": "State management for React Native",
@@ -32,6 +32,7 @@
32
32
  "typecheck": "tsc --noEmit",
33
33
  "test": "jest",
34
34
  "build": "tsc -p tsconfig.build.json && cp ./lib/*.d.ts ./dist",
35
+ "build:watch": "nodemon --watch lib --exec \"npm run build && npm pack\"",
35
36
  "build:docs": "node buildDocs.js",
36
37
  "lint-tests": "eslint tests/**",
37
38
  "prettier": "prettier --write ."
@@ -65,6 +66,7 @@
65
66
  "jest-cli": "^26.5.2",
66
67
  "jsdoc-to-markdown": "^7.1.0",
67
68
  "metro-react-native-babel-preset": "^0.77.0",
69
+ "nodemon": "^3.0.3",
68
70
  "prettier": "^2.8.8",
69
71
  "prop-types": "^15.7.2",
70
72
  "react": "18.2.0",
@@ -81,9 +83,9 @@
81
83
  "idb-keyval": "^6.2.1",
82
84
  "react": ">=18.1.0",
83
85
  "react-dom": ">=18.1.0",
86
+ "react-native-device-info": "^10.3.0",
84
87
  "react-native-performance": "^5.1.0",
85
- "react-native-quick-sqlite": "^8.0.0-beta.2",
86
- "react-native-device-info": "^10.3.0"
88
+ "react-native-quick-sqlite": "^8.0.0-beta.2"
87
89
  },
88
90
  "peerDependenciesMeta": {
89
91
  "idb-keyval": {