Added ignoredPaths option#22
Conversation
|
@MaverickMartyn I played around with the changes in my local fork and everything seems to be working great. I'd recommend @MrEmelianenko to pull this in. I think getting rid of the blacklist and whitelist might be a good idea since this solves their use cases. Also it is very dangerous to have bugs such as #19 when working with secure applications. |
|
@Stormtv I agree that blacklist/whitelists should probably be removed, but I want o note this: Using the blacklist in combination with this, however works great. Maybe with an options structure like this: {
// Ignores specific paths on the state object, when persisting.
ignoredPaths: ['test.testy', 'testy2.moretesty'],
// Blocks commits from triggering a persistence update.
ignoredCommits: ['TESTCOMMIT', 'ANOTHERCOMMIT'],
// Changes the behavior from blacklist-like to whitelist-like. Default to false. Maybe another name?
invertIgnored: true,
}EDIT: Changed my proposal, to no longer suggest throwing an error, if inverting without supplying any of the other suggested params. EDIT 2: EDIT 3: |
|
@MrEmelianenko @Stormtv Bump? |
|
@MaverickMartyn can you just return early? the else if's aren't needed and:
If you remove the else if's with just if's, it'll be nice :) |
|
@MaverickMartyn This is also a breaking change for some people, you'd need to keep the remaining functionality in there, and also you need to update the docs for your PR :) |
|
I just couldn't be asked to fix the Code Climate issue at the time. :) |
|
@MaverickMartyn please fix all issues and I'll merge this into master. Thank you! |
|
@MrEmelianenko One last minor issue: The bundle size is 2 kB and the file ./dist/persisted-state.js is now 2.17 kB. |
|
@MrEmelianenko I just need to know if I can change the maximum size limit mentioned above. |
|
I personally think changing the max size to 3kB is fine. @MaverickMartyn but it would be nice is @MrEmelianenko would sign off on it :) |
Minify the dist files this should make the bundlesize pass
|
@MaverickMartyn @MrEmelianenko Turns out we did not need to increase the bundle size. I just made sure to minify the dist files in the PR which solved bundle size violation. |
|
@MrEmelianenko Any update on this, would greatly appreciate this being included in vuex-electron. |
|
I have a need for this too. The ignore paths saved my bacon, but I'm now relying on a specific commit of the OPs PR |
|
@MrEmelianenko poke |
|
@MrEmelianenko Can we get this merged please? |
|
@MrEmelianenko Are you alive <3 |
|
@MrEmelianenko Are there any issues with this PR? |
|
@MrEmelianenko Just pinging you again, to make sure you see it. :) |
vuex-electron存在很一个严重的问题。即使添加了blacklist,但是在下次非blacklist的commit的时候,还是会把所有的state进行持久化。鉴于vuex-electron已经不做维护,使用 MaverickMartyn/vuex-electron 作为替代 refs: vue-electron/vuex-electron#19 refs: vue-electron/vuex-electron#22 refs: https://github.com/MaverickMartyn/vuex-electron
|
ping, would love to see this merged |
|
hi, my option is my state is I don't want to persite the |
Hey there guys. I am fairly sure this repository is no longer being maintained. |
I added an option to supply an array of state paths to not persist.
This includes a unit test.
It simply works by cloning the state object, and deleting any properties that should not be persisted.
It then persists the modified clone instead,
I think this is my first actual pull request, so I hope it lives up to everyone's expectations.
Please let me know if something isn't working.