]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/log
thirdparty/vuejs/pinia.git
4 years agotest: test warn mapStores
Eduardo San Martin Morote [Mon, 3 May 2021 09:21:17 +0000 (11:21 +0200)] 
test: test warn mapStores

4 years agochore: remove old code
Eduardo San Martin Morote [Mon, 3 May 2021 09:00:37 +0000 (11:00 +0200)] 
chore: remove old code

4 years agotest: adatp to new getters syntax
Eduardo San Martin Morote [Mon, 3 May 2021 09:00:09 +0000 (11:00 +0200)] 
test: adatp to new getters syntax

4 years agorefactor: correctly use DefineStoreOptions
Eduardo San Martin Morote [Mon, 3 May 2021 08:55:42 +0000 (10:55 +0200)] 
refactor: correctly use DefineStoreOptions

4 years agofeat(plugins): pass options to plugins
Eduardo San Martin Morote [Mon, 3 May 2021 08:39:32 +0000 (10:39 +0200)] 
feat(plugins): pass options to plugins

4 years agofeat(pinia): allow chaining pinia.use
Eduardo San Martin Morote [Mon, 3 May 2021 08:32:31 +0000 (10:32 +0200)] 
feat(pinia): allow chaining pinia.use

4 years agofeat(store): pass state to getters as first argument
Eduardo San Martin Morote [Mon, 3 May 2021 08:28:42 +0000 (10:28 +0200)] 
feat(store): pass state to getters as first argument

BREAKING CHANGE: getters now receive the state as their first argument and it's properly typed so you can write getters with arrow functions:

```js
defineStore({
  state: () => ({ n: 0 }),
  getters: {
    double: state => state.n * 2
  }
})
```

To access other getters, you must still use the syntax that uses `this` **but it is now necessary to explicitely type the getter return type**. The same limitation exists in Vue for computed properties and it's a known limitation in TypeScript:

```ts
defineStore({
  state: () => ({ n: 0 }),
  getters: {
    double: state => state.n * 2,
    // the `: number` is necessary when accessing `this` inside of
    // a getter
    doublePlusOne(state): number {
      return this.double + 1
    },
  }
})
```

For more information, refer to [the updated documentation for getters](https://pinia.esm.dev/core-concepts/getters.html).

4 years agoci: add renovate
Eduardo San Martin Morote [Sun, 2 May 2021 17:31:57 +0000 (19:31 +0200)] 
ci: add renovate

4 years agochore: up deps
Eduardo San Martin Morote [Sun, 2 May 2021 17:31:14 +0000 (19:31 +0200)] 
chore: up deps

4 years agofeat(plugins): pass a context object to plugins instead of app
Eduardo San Martin Morote [Tue, 27 Apr 2021 08:47:23 +0000 (10:47 +0200)] 
feat(plugins): pass a context object to plugins instead of app

BREAKING CHANGE: To improve the plugin api capabilities, `pinia.use()`
now receives a context object instead of just `pinia`:
```js
// replace
pinia.use((pinia) => {})
// with
pinia.use(({ pinia, store }) => {})
```

4 years agochore: up deps
Eduardo San Martin Morote [Tue, 27 Apr 2021 08:36:07 +0000 (10:36 +0200)] 
chore: up deps

4 years agotest: use @sucrase/jest instead of ts-jest
Eduardo San Martin Morote [Fri, 16 Apr 2021 11:02:37 +0000 (13:02 +0200)] 
test: use @sucrase/jest instead of ts-jest

4 years agoci: add release
Eduardo San Martin Morote [Sat, 10 Apr 2021 15:30:52 +0000 (17:30 +0200)] 
ci: add release

4 years agofeat(types): fail on async patch
Eduardo San Martin Morote [Fri, 9 Apr 2021 18:35:57 +0000 (20:35 +0200)] 
feat(types): fail on async patch

4 years agorelease: v0.3.1 v0.3.1
Eduardo San Martin Morote [Sat, 10 Apr 2021 15:28:03 +0000 (17:28 +0200)] 
release: v0.3.1

4 years agotest: ignore global.d.ts
Eduardo San Martin Morote [Sat, 10 Apr 2021 15:26:38 +0000 (17:26 +0200)] 
test: ignore global.d.ts

4 years agofix(subscribe): remove subscription when unmounted
Eduardo San Martin Morote [Sat, 10 Apr 2021 15:13:25 +0000 (17:13 +0200)] 
fix(subscribe): remove subscription when unmounted

4 years agostyle: const
Eduardo San Martin Morote [Fri, 9 Apr 2021 17:08:17 +0000 (19:08 +0200)] 
style: const

4 years agofix(store): avoid multiple subscriptions call
Eduardo San Martin Morote [Fri, 9 Apr 2021 17:06:27 +0000 (19:06 +0200)] 
fix(store): avoid multiple subscriptions call

Fix #429, Fix #430

4 years agorelease: v0.3.0 v0.3.0
Eduardo San Martin Morote [Fri, 9 Apr 2021 11:10:50 +0000 (13:10 +0200)] 
release: v0.3.0

4 years agochore: mark mapGetters as deprecated
Eduardo San Martin Morote [Fri, 9 Apr 2021 07:42:35 +0000 (09:42 +0200)] 
chore: mark mapGetters as deprecated

4 years agofeat: mapWritableState
Eduardo San Martin Morote [Thu, 8 Apr 2021 16:22:30 +0000 (18:22 +0200)] 
feat: mapWritableState

4 years agochore: comment [skip ci]
Eduardo San Martin Morote [Thu, 8 Apr 2021 12:51:50 +0000 (14:51 +0200)] 
chore: comment [skip ci]

4 years agofeat(mapState): accept functions
Eduardo San Martin Morote [Thu, 8 Apr 2021 12:46:16 +0000 (14:46 +0200)] 
feat(mapState): accept functions

4 years agofeat(mapStores): allow custom suffix
Eduardo San Martin Morote [Thu, 8 Apr 2021 11:43:35 +0000 (13:43 +0200)] 
feat(mapStores): allow custom suffix

4 years agofeat(types): allow extending mapStores suffix
Eduardo San Martin Morote [Thu, 8 Apr 2021 11:32:59 +0000 (13:32 +0200)] 
feat(types): allow extending mapStores suffix

4 years agotest: add dts tests
Eduardo San Martin Morote [Thu, 8 Apr 2021 10:01:20 +0000 (12:01 +0200)] 
test: add dts tests

4 years agodocs: mark pStores as internal [skip ci]
Eduardo San Martin Morote [Thu, 8 Apr 2021 09:39:13 +0000 (11:39 +0200)] 
docs: mark pStores as internal [skip ci]

4 years agorefactor(types): mapState autocomplete
Eduardo San Martin Morote [Thu, 8 Apr 2021 09:22:20 +0000 (11:22 +0200)] 
refactor(types): mapState autocomplete

4 years agorefactor(types): fix autocompletion
Eduardo San Martin Morote [Thu, 8 Apr 2021 09:19:39 +0000 (11:19 +0200)] 
refactor(types): fix autocompletion

4 years agochore: coverage nuxt
Eduardo San Martin Morote [Thu, 8 Apr 2021 09:12:56 +0000 (11:12 +0200)] 
chore: coverage nuxt

4 years agofix(types): enable autocomplete in object
Eduardo San Martin Morote [Thu, 8 Apr 2021 09:12:21 +0000 (11:12 +0200)] 
fix(types): enable autocomplete in object

4 years agodocs: improve map helpers
Eduardo San Martin Morote [Thu, 8 Apr 2021 09:02:17 +0000 (11:02 +0200)] 
docs: improve map helpers

4 years agofeat: add mapActions
Eduardo San Martin Morote [Thu, 8 Apr 2021 09:02:03 +0000 (11:02 +0200)] 
feat: add mapActions

4 years agochore: update readme badges
Eduardo San Martin Morote [Wed, 7 Apr 2021 14:36:15 +0000 (16:36 +0200)] 
chore: update readme badges

4 years agochore: update github files
Eduardo San Martin Morote [Wed, 7 Apr 2021 14:33:42 +0000 (16:33 +0200)] 
chore: update github files

4 years agorefactor: cache store create per instance
Eduardo San Martin Morote [Wed, 7 Apr 2021 14:31:56 +0000 (16:31 +0200)] 
refactor: cache store create per instance

4 years agofeat: mapState with object
Eduardo San Martin Morote [Tue, 6 Apr 2021 18:53:47 +0000 (20:53 +0200)] 
feat: mapState with object

4 years agofeat: mapState with array
Eduardo San Martin Morote [Tue, 6 Apr 2021 18:16:41 +0000 (20:16 +0200)] 
feat: mapState with array

4 years agotest: mapStores
Eduardo San Martin Morote [Tue, 6 Apr 2021 17:52:56 +0000 (19:52 +0200)] 
test: mapStores

4 years agotest: fix lifespan test
Eduardo San Martin Morote [Tue, 6 Apr 2021 10:33:09 +0000 (12:33 +0200)] 
test: fix lifespan test

4 years agotest: add missing file
Eduardo San Martin Morote [Fri, 19 Mar 2021 14:31:19 +0000 (15:31 +0100)] 
test: add missing file

4 years agofeat: add mapStores
Eduardo San Martin Morote [Fri, 12 Mar 2021 16:15:11 +0000 (17:15 +0100)] 
feat: add mapStores

4 years agorelease: v0.2.5 v0.2.5
Eduardo San Martin Morote [Thu, 1 Apr 2021 14:40:02 +0000 (16:40 +0200)] 
release: v0.2.5

4 years agofeat: allow passing a function to $patch
Eduardo San Martin Morote [Thu, 1 Apr 2021 14:37:20 +0000 (16:37 +0200)] 
feat: allow passing a function to $patch

4 years agofeat(types): generic on PiniaCustomProperties
Eduardo San Martin Morote [Wed, 31 Mar 2021 17:30:46 +0000 (19:30 +0200)] 
feat(types): generic on PiniaCustomProperties

4 years agorelease: v0.2.4 v0.2.4
Eduardo San Martin Morote [Wed, 31 Mar 2021 14:11:16 +0000 (16:11 +0200)] 
release: v0.2.4

4 years agofix(nuxt): automatically transpile pinia
Eduardo San Martin Morote [Wed, 31 Mar 2021 14:10:15 +0000 (16:10 +0200)] 
fix(nuxt): automatically transpile pinia

4 years agorelease: v0.2.3 v0.2.3
Eduardo San Martin Morote [Wed, 31 Mar 2021 10:11:52 +0000 (12:11 +0200)] 
release: v0.2.3

4 years agofix(types): pass custom properties to actions and getters
Eduardo San Martin Morote [Wed, 31 Mar 2021 10:05:12 +0000 (12:05 +0200)] 
fix(types): pass custom properties to actions and getters

4 years agofix(types): add PiniaCustomProperties to stores
Eduardo San Martin Morote [Wed, 31 Mar 2021 09:56:44 +0000 (11:56 +0200)] 
fix(types): add PiniaCustomProperties to stores

4 years agorelease: v0.2.2 v0.2.2
Eduardo San Martin Morote [Wed, 31 Mar 2021 09:30:04 +0000 (11:30 +0200)] 
release: v0.2.2

4 years agofix: use inject in nuxt plugin
Eduardo San Martin Morote [Wed, 31 Mar 2021 09:10:02 +0000 (11:10 +0200)] 
fix: use inject in nuxt plugin

4 years agodocs: docs for pinia plugin
Eduardo San Martin Morote [Wed, 31 Mar 2021 09:09:42 +0000 (11:09 +0200)] 
docs: docs for pinia plugin

4 years agorefactor: extract PiniaPlugin
Eduardo San Martin Morote [Wed, 31 Mar 2021 09:09:32 +0000 (11:09 +0200)] 
refactor: extract PiniaPlugin

4 years agobuild: exports in package
Eduardo San Martin Morote [Mon, 29 Mar 2021 17:26:14 +0000 (19:26 +0200)] 
build: exports in package

4 years agorelease: v0.2.1 v0.2.1
Eduardo San Martin Morote [Tue, 23 Mar 2021 10:47:33 +0000 (11:47 +0100)] 
release: v0.2.1

4 years agofix(devtools): time travel and state display
Eduardo San Martin Morote [Tue, 23 Mar 2021 10:45:28 +0000 (11:45 +0100)] 
fix(devtools): time travel and state display

Fix #394

Fix #19

4 years agochore: up deps
Eduardo San Martin Morote [Tue, 23 Mar 2021 09:59:29 +0000 (10:59 +0100)] 
chore: up deps

4 years agorefactor: unused parameter in devtools
Eduardo San Martin Morote [Mon, 8 Mar 2021 15:31:48 +0000 (16:31 +0100)] 
refactor: unused parameter in devtools

4 years agochore: add demo link [skip ci]
Eduardo San Martin Morote [Mon, 8 Mar 2021 15:13:59 +0000 (16:13 +0100)] 
chore: add demo link [skip ci]

4 years agorelease: v0.2.0 v0.2.0
Eduardo San Martin Morote [Mon, 8 Mar 2021 14:53:21 +0000 (15:53 +0100)] 
release: v0.2.0

4 years agorefactor: small fixes and changes in devtools
Eduardo San Martin Morote [Mon, 8 Mar 2021 14:46:31 +0000 (15:46 +0100)] 
refactor: small fixes and changes in devtools

4 years agobuild: fix script
Eduardo San Martin Morote [Mon, 8 Mar 2021 13:41:28 +0000 (14:41 +0100)] 
build: fix script

4 years agobuild: keep normal version for the moment
Eduardo San Martin Morote [Mon, 8 Mar 2021 13:39:41 +0000 (14:39 +0100)] 
build: keep normal version for the moment

4 years agorefactor: set active pinia by default
Eduardo San Martin Morote [Mon, 8 Mar 2021 13:39:05 +0000 (14:39 +0100)] 
refactor: set active pinia by default

4 years agodocs: some fixes
Eduardo San Martin Morote [Mon, 8 Mar 2021 13:38:53 +0000 (14:38 +0100)] 
docs: some fixes

4 years agochore: improve coverage
Eduardo San Martin Morote [Mon, 8 Mar 2021 13:19:06 +0000 (14:19 +0100)] 
chore: improve coverage

4 years agochore: update readme [skip ci]
Eduardo San Martin Morote [Mon, 8 Mar 2021 10:17:53 +0000 (11:17 +0100)] 
chore: update readme [skip ci]

4 years agochore: update readme [skip ci]
Eduardo San Martin Morote [Mon, 8 Mar 2021 10:17:03 +0000 (11:17 +0100)] 
chore: update readme [skip ci]

4 years agochore: update readme [skip ci]
Eduardo San Martin Morote [Mon, 8 Mar 2021 10:14:39 +0000 (11:14 +0100)] 
chore: update readme [skip ci]

4 years agochore: update readme [skip ci]
Eduardo San Martin Morote [Mon, 8 Mar 2021 10:10:52 +0000 (11:10 +0100)] 
chore: update readme [skip ci]

4 years agochore: update readme [skip ci]
Eduardo San Martin Morote [Mon, 8 Mar 2021 10:09:27 +0000 (11:09 +0100)] 
chore: update readme [skip ci]

4 years agochore: update readme
Eduardo San Martin Morote [Mon, 8 Mar 2021 10:08:16 +0000 (11:08 +0100)] 
chore: update readme

4 years agochore: add changelog [skip ci]
Eduardo San Martin Morote [Thu, 4 Mar 2021 18:46:14 +0000 (19:46 +0100)] 
chore: add changelog [skip ci]

4 years agodocs: comment on pinia.use [skip ci]
Eduardo San Martin Morote [Thu, 4 Mar 2021 15:43:14 +0000 (16:43 +0100)] 
docs: comment on pinia.use [skip ci]

4 years agodocs: types nuxt [skip ci]
Eduardo San Martin Morote [Thu, 4 Mar 2021 15:39:00 +0000 (16:39 +0100)] 
docs: types nuxt [skip ci]

4 years agorefactor: dead code
Eduardo San Martin Morote [Thu, 4 Mar 2021 15:27:31 +0000 (16:27 +0100)] 
refactor: dead code

4 years agostyle: fix
Eduardo San Martin Morote [Thu, 4 Mar 2021 15:26:27 +0000 (16:26 +0100)] 
style: fix

4 years agoci: add size check
Eduardo San Martin Morote [Thu, 4 Mar 2021 15:22:22 +0000 (16:22 +0100)] 
ci: add size check

BREAKING CHANGE: files in dist folder are renamed to match official libs in the Vue ecosystem. Unless you were importing from `pinia/dist`, this won't affect you.

4 years agobuild: add release scripts
Eduardo San Martin Morote [Thu, 4 Mar 2021 15:21:56 +0000 (16:21 +0100)] 
build: add release scripts

4 years agodocs: update
Eduardo San Martin Morote [Thu, 4 Mar 2021 14:52:07 +0000 (15:52 +0100)] 
docs: update

4 years agofeat(nuxt): expose nuxt context as $nuxt
Eduardo San Martin Morote [Wed, 3 Mar 2021 16:51:05 +0000 (17:51 +0100)] 
feat(nuxt): expose nuxt context as $nuxt

4 years agostyle: lint
Eduardo San Martin Morote [Wed, 3 Mar 2021 16:39:39 +0000 (17:39 +0100)] 
style: lint

4 years agorefactor: use assign instead of spread
Eduardo San Martin Morote [Wed, 3 Mar 2021 16:38:27 +0000 (17:38 +0100)] 
refactor: use assign instead of spread

4 years agobuild: external vue
Eduardo San Martin Morote [Wed, 3 Mar 2021 16:30:10 +0000 (17:30 +0100)] 
build: external vue

4 years agofeat(nuxt): add buildModule
Eduardo San Martin Morote [Wed, 3 Mar 2021 16:30:03 +0000 (17:30 +0100)] 
feat(nuxt): add buildModule

4 years agofeat: add PiniaPlugin
Eduardo San Martin Morote [Wed, 3 Mar 2021 16:29:51 +0000 (17:29 +0100)] 
feat: add PiniaPlugin

4 years agotest: add plugins test
Eduardo San Martin Morote [Wed, 3 Mar 2021 16:29:16 +0000 (17:29 +0100)] 
test: add plugins test

4 years agofix: outlive components lifespan
Eduardo San Martin Morote [Wed, 3 Mar 2021 15:36:34 +0000 (16:36 +0100)] 
fix: outlive components lifespan

Fix #370

BREAKING CHANGE: It's now necessary to create a pinia instance and
install it:
  ```js
  import { createPinia, PiniaPlugin } from 'pinia'

  const pinia = createPinia()
  Vue.use(PiniaPlugin)

  new Vue({
    el: '#app',
    pinia,
    // ...
  })
  ```
  The `pinia` instance can be passed to `useStore(pinia)` when called
  outside of a `setup()` function. Check the SSR section of the docs for
  more details.

BREAKING CHANGE: `setActiveReq()` and `getActiveReq()` have been
replaced with `setActivePinia()` and `getActivePinia()` respectively.
`setActivePinia()` can only be passed a `pinia` instance created with
`createPinia()`.

BREAKING CHANGE: Since req as a parameter was replacetd with `pinia`,
`getRootState` is no longer necessary. Replace it with
`pinia.state.value` to **read and write** the root state`.

BREAKING CHANGE: `PiniaSsr` is no longer necessary and has been removed.

4 years agotypes: add global types for injecting pinia
Eduardo San Martin Morote [Wed, 3 Mar 2021 15:27:29 +0000 (16:27 +0100)] 
types: add global types for injecting pinia

4 years agochore: fix deprecation message
Eduardo San Martin Morote [Wed, 3 Mar 2021 15:14:55 +0000 (16:14 +0100)] 
chore: fix deprecation message

4 years agorefactor: remove unused code
Eduardo San Martin Morote [Wed, 3 Mar 2021 15:14:43 +0000 (16:14 +0100)] 
refactor: remove unused code

4 years agochore: up deps
Eduardo San Martin Morote [Wed, 3 Mar 2021 15:14:11 +0000 (16:14 +0100)] 
chore: up deps

4 years agodocs: remove old functions
Eduardo San Martin Morote [Wed, 3 Mar 2021 15:14:03 +0000 (16:14 +0100)] 
docs: remove old functions

4 years agotest(ssr): update
Eduardo San Martin Morote [Wed, 3 Mar 2021 15:13:49 +0000 (16:13 +0100)] 
test(ssr): update

4 years agotest: use createPinia()
Eduardo San Martin Morote [Wed, 3 Mar 2021 14:45:26 +0000 (15:45 +0100)] 
test: use createPinia()

4 years agotest: update to handle new api
Eduardo San Martin Morote [Wed, 3 Mar 2021 14:40:10 +0000 (15:40 +0100)] 
test: update to handle new api

4 years agodocs: remove experimental tag
Eduardo San Martin Morote [Wed, 3 Mar 2021 14:40:00 +0000 (15:40 +0100)] 
docs: remove experimental tag

4 years agorefactor: wip to migrate to createPinia() like v2
Eduardo San Martin Morote [Wed, 3 Mar 2021 14:28:47 +0000 (15:28 +0100)] 
refactor: wip to migrate to createPinia() like v2