Skip to content

Make vuex usable in react, react-native #2149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
32 changes: 24 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
version: 2
version: 2.1

defaults: &defaults
working_directory: ~/vuex
docker:
- image: circleci/node:12-browsers
- image: cimg/node:lts-browsers
parallelism: 4

jobs:
install:
@@ -48,8 +49,13 @@ jobs:
test-unit:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- checkout
- run:
name: Installing Dependencies
command: yarn
- run:
name: Installing peerDependencies explicitly
command: yarn add vue --peer
- run:
name: Running Unit Tests
command: |
@@ -58,8 +64,13 @@ jobs:
test-e2e:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- checkout
- run:
name: Installing Dependencies
command: yarn
- run:
name: Installing peerDependencies explicitly
command: yarn add vue --peer
- run:
name: Running End-to-end Tests
command: |
@@ -68,8 +79,13 @@ jobs:
test-ssr:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- checkout
- run:
name: Installing Dependencies
command: yarn
- run:
name: Installing peerDependencies explicitly
command: yarn add vue --peer
- run:
name: Running Server-side Rendering Tests
command: |
53 changes: 28 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -56,45 +56,48 @@
"vue": "^3.2.0"
},
"dependencies": {
"@vue/devtools-api": "^6.0.0-beta.11"
"@vue/devtools-api": "^6.1.3",
"@vue/reactivity": "^3.2.31",
"@vue/runtime-core": "^3.2.31"
},
"devDependencies": {
"@babel/core": "^7.14.3",
"@babel/preset-env": "^7.14.2",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^19.0.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@babel/core": "^7.17.8",
"@babel/preset-env": "^7.16.11",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^19.0.2",
"@rollup/plugin-node-resolve": "^13.1.3",
"@rollup/plugin-replace": "^2.4.2",
"@types/node": "^15.6.0",
"@types/node": "^15.14.9",
"@vue/compiler-sfc": "^3.2.4",
"babel-jest": "^26.6.3",
"babel-loader": "^8.2.2",
"babel-loader": "^8.2.4",
"brotli": "^1.3.2",
"chalk": "^4.1.1",
"conventional-changelog-cli": "^2.1.1",
"chalk": "^4.1.2",
"conventional-changelog-cli": "^2.2.2",
"cross-env": "^7.0.3",
"css-loader": "^2.1.0",
"enquirer": "^2.3.5",
"eslint": "^7.27.0",
"css-loader": "^2.1.1",
"enquirer": "^2.3.6",
"eslint": "^6.8.0",
"eslint-plugin-vue": "^8.5.0",
"eslint-plugin-vue-libs": "^4.0.0",
"execa": "^5.0.0",
"express": "^4.17.1",
"fs-extra": "^10.0.0",
"express": "^4.17.3",
"fs-extra": "^10.0.1",
"jest": "^26.6.3",
"puppeteer": "^9.1.1",
"regenerator-runtime": "^0.13.5",
"rollup": "^2.49.0",
"regenerator-runtime": "^0.13.9",
"rollup": "^2.70.1",
"rollup-plugin-terser": "^7.0.2",
"semver": "^7.3.5",
"start-server-and-test": "^1.12.3",
"todomvc-app-css": "^2.4.1",
"typescript": "^4.2.4",
"vitepress": "^0.20.0",
"start-server-and-test": "^1.14.0",
"todomvc-app-css": "^2.4.2",
"typescript": "^4.6.3",
"vitepress": "^0.20.10",
"vue": "^3.2.4",
"vue-loader": "^16.5.0",
"vue-loader": "^16.8.3",
"vue-style-loader": "^4.1.3",
"webpack": "^4.43.0",
"webpack-dev-middleware": "^3.7.2",
"webpack-hot-middleware": "^2.25.0"
"webpack": "^4.46.0",
"webpack-dev-middleware": "^3.7.3",
"webpack-hot-middleware": "^2.25.1"
}
}
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import buble from '@rollup/plugin-buble'
import { babel } from '@rollup/plugin-babel'
import replace from '@rollup/plugin-replace'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
@@ -68,7 +68,7 @@ function createEntry(config) {
}))

if (config.transpile !== false) {
c.plugins.push(buble())
c.plugins.push(babel({ babelHelpers: 'bundled' }))
}

c.plugins.push(resolve())
2 changes: 1 addition & 1 deletion src/injectKey.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { inject } from 'vue'
import { inject } from '@vue/runtime-core'

export const storeKey = 'store'

3 changes: 2 additions & 1 deletion src/store-util.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { reactive, computed, watch, effectScope } from 'vue'
import { reactive, computed, effectScope } from '@vue/reactivity'
import { watch } from '@vue/runtime-core'
import { forEachValue, isObject, isPromise, assert, partial } from './util'

export function genericSubscribe (fn, subs, options) {
2 changes: 1 addition & 1 deletion src/store.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { watch } from 'vue'
import { watch } from '@vue/runtime-core'
import { storeKey } from './injectKey'
import { addDevtools } from './plugins/devtool'
import ModuleCollection from './module/module-collection'