Commit Graph

40 Commits

Author SHA1 Message Date
Tony
5ac8fbb1fa feat(store): load override defaults (#2857)
* feat(store): load override defaults

* Update docs

* Update example

* Allow setting defaults from js

* Tweak resolve

* Merge remote-tracking branch 'upstream/v2' into store-load-override-defaults

* Merge branch 'v2' of https://github.com/tauri-apps/plugins-workspace into store-load-override-defaults

* Merge branch 'v2' into store-load-override-defaults

* Rename to ignore defaults

* Merge remote-tracking branch 'upstream/v2' into store-load-override-defaults
2025-08-05 18:45:09 +08:00
Amr Bashir
a3b553ddb4 feat(http): add request and response tracing behind feature flag (#2079) 2024-11-21 17:08:34 +02:00
Fabian-Lars
51856e9e0a docs: Remove header image from inline docs (#2045) 2024-11-13 16:07:29 +01:00
Tony
8c67d44aef refactor(store)!: more reworks (#1860)
* refactor(store): more reworks

* Enable auto save by default

* Store to resource table by default

* Remove share store

* Clean up

* Add close store

* Add store function

* Add lazy store

* Add init to lazy store

* refresh cache in example

* Add get-or-create-store

* Revert "Add get-or-create-store"

This reverts commit 7ffd769240.

* try get first

* Docs

* Use absolute path for store

* more docs

* Allow js to use pre-stored (de)serialize functions

* Fix js get and close store

* Show case how to use pretty json

* Update readme

* Use store instead of `store_builder` in example

* Build

* Fix example

* More docs for StoreBuilder::build

* Add default (de)serialize fn

* Use pretty json by default

* Use `undefined` for empty value in get

* Change files

* Differentiate json null from no value for events

* Add create or existing

* Build

* Rename inner store's inset method to set

* Update readme

* Apply suggestions from code review

* Use close instead

* Update breaking changes

* Return result in resolve_store_path

* Change to close_resource and take &self

* Clean up

* Apply suggestions from code review

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>

* Remove unused pub(crate)

* Update change file

* Expose resolve_store_path

* Remove with_store

* Remove StoreInner from pub and expose is_empty

* Fix wrong jsdoc param

* Update readme

* rename createOrExistingStore to createOrLoad

* make api consistent with the JS implementation, add examples

* fmt

* reintroduce "get existing store" behavior for create_or_load

* rename createOrLoad to newOrExisting

* keep store lock throughout whole new_or_existing_inner

* Remove load

* Missed if load

* Don't make StoreState public

* Remove R: Runtime from Builder

* rename newOrExisting to load, load to reload

* update docs

* rename missing reload fn

* rename builder fn to build()

* fix default permission

* Fix description and create_new logic

* Clippy

* Update docs

* Update docs

* remove create_store command

* remove close_store command since we extend from Resource

* Revert "remove close_store command since we extend from Resource"

This reverts commit 4a29fc8990.

* Reapply "remove close_store command since we extend from Resource"

This reverts commit 70a1830e7d.

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-17 19:14:41 +08:00
Tony
7e5e34420b Cancel auto save on save (#1859) 2024-10-01 23:13:20 -03:00
Tony
f12d35609a feat(store)!: fully rework and add auto save (#1550)
* Add auto save to store plugin

* Put jsdoc at constructor instead of class level

* Clippy

* Use enum instead of bool

* Some(AutoSaveMessage::Cancel) | None

* from_millis

* u64

* Add change file

* Rename to emit_on_change

* should use Duration in `with_store`

* Add breaking change notice to change file

* Emit change event for inserts by reset

* Update readme example

* Update example

* Remove extra line

* Make description clear it only works with managed

* Fix links in docstring

* Fix doc string closing

* get_mut

* Proof of concept

* fmt

* Load store on create

* cargo fmt

* Fix merge conflits

* Format

* small cleanup

* update docs, use `impl Into<JsonValue>`

* fix doctests, further simplification of api

* add store options

---------

Co-authored-by: Tillmann <28728469+tweidinger@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-01 15:10:40 -03:00
Lucas Fernandes Nogueira
0c040bcc9a fix(store): remove Android and iOS plugins, closes #1256 (#1695)
The Android and iOS support introduced on #1011 is not really supported - the Tauri path API correctly resolves the cache directory on mobile, and we can access those directly using Rust code.

This is a breaking change because we no longer uses the same directory to store the files - app_cache_dir returns a different location
2024-08-27 14:18:02 -03:00
Lucas Fernandes Nogueira
22a17980ff feat: update to tauri beta.24 (#1537)
* feat: update to tauri beta.24

* remove .tauri

* pnpm build
2024-07-12 17:59:17 -03:00
Fabian-Lars
0d4d029011 build: Update pnpm to v9 (#1309)
* build: Update pnpm to v9

* update actions

* remove last actions-rs usage

* clippy

* clippy again

* revert default feature
2024-05-13 17:03:04 +02:00
Fabian-Lars
bb51a41d67 feat: Remove UNC prefix in paths returned to the frontend (#1168)
* feat: Remove UNC prefix in paths returned to the frontend

* that one doesn't count

* map instead of mut

* revert accidental ipc::response change

* move dunce to workspace root
2024-04-17 15:49:32 +02:00
Lucas Fernandes Nogueira
a04ea2f382 refactor: only inject API IIFE script when withGlobalTauri is true (#1071)
* refactor: only inject API IIFE script when withGlobalTauri is true

* fmt

* update tauri
2024-03-19 15:03:20 -03:00
Tony
79691e93e0 fix(store): with_store and StoreCollection become private in #1011 (#1040)
* Fix with_store become private in #1011

* Add change file
2024-03-07 11:52:33 +01:00
Ahmed Elkhoudiry
22f5acf240 feat(store): Add android & iOS support (#1011)
* update cli

* init android module

* upgdate gitignore

* add desktop and mobile

* android

* ios

* lib

* remove comment

* cargo fmt

* skip empty file creation

* android comments

* apple path

* Discard changes to plugins/store/ios/README.md

* stop auto directories creation

* Update README.md
2024-03-04 21:02:17 +02:00
Lucas Fernandes Nogueira
b1b9a02f9e Merge pull request #971 from tauri-apps/chore/tauri-beta-3
chore: update to tauri beta.4
2024-02-21 14:32:22 -03:00
Lucas Nogueira
dbc0c0757e dist 2024-02-19 17:16:06 -03:00
Lucas Nogueira
9dd1d09797 rebuild 2024-02-19 17:15:24 -03:00
Amr Bashir
7cefa2b0bd pub 2024-02-19 16:03:32 +02:00
amrbashir
72db444401 feat(sql,store): add Builder::new
ref: https://github.com/tauri-apps/tauri/issues/8880
2024-02-19 15:54:56 +02:00
Tillmann
d198c01486 feat: update to tauri beta, add permissions (#862)
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Lucas Nogueira <lucas@crabnebula.dev>
2024-02-03 15:14:41 -03:00
Fabian-Lars
387c2f9e0c chore: Update Tauri to alpha.18 (#802) 2023-12-11 15:41:42 -03:00
Amr Bashir
1b98b85a1f refactor: simplify rollup config and match @tauri-apps/api output style (#722)
* refactor: simplify rollup config and match `@tauri-apps/api` output style

* add license headers

* update api-iife.js [skip ci]

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-11-14 21:09:53 +02:00
Lucas Fernandes Nogueira
e438e0a62d feat: update to alpha.17, typed mobile plugin IPC arguments (#676)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-10-29 16:06:44 -03:00
Lucas Fernandes Nogueira
5c137365c6 chore: update to tauri alpha.16, api alpha.9 (#673)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-10-20 13:50:18 -03:00
Lucas Fernandes Nogueira
d74fc0a097 feat: update to alpha.11 (#555) 2023-08-14 14:51:20 -03:00
Simon Hyll
5fd597ddaf docs: added banners and icons (#443)
* added banners and icons

* fix: formatting
2023-06-20 14:55:14 +03:00
Lucas Fernandes Nogueira
32c2a441c3 feat: update to 2.0.0-alpha.10 (#441) 2023-06-17 18:54:35 -03:00
Lucas Fernandes Nogueira
b131bc8f7c feat(plugins): inject API on window.__TAURI__ (#383) 2023-05-23 14:20:14 -03:00
Lucas Fernandes Nogueira
5914fb9f36 chore: add license headers (#384)
* feat: check for license headers

* add headers

* format
2023-05-21 16:56:10 -03:00
Lucas Fernandes Nogueira
937e6a5be6 feat: use tauri next branch, fix tests, MSRV 1.65 (#354) 2023-05-12 17:16:50 -03:00
Lucas Nogueira
9244d4ee8f fix(store): adjust load and save implementation 2023-05-02 13:46:56 -03:00
FabianLars
fad6edab71 Merge remote-tracking branch 'origin/dev' into next 2023-04-26 16:56:03 +02:00
Lucas Fernandes Nogueira
bbdccefa2d chore(deps): update to tauri alpha.8 (#303) 2023-04-14 08:02:48 -03:00
afa
06f39586af fix(store): Load state from disk and extend defaults, fixes #296 (#295)
* fix(store): Load state from disk and extend defaults, fixes #296

* fmt
2023-04-02 11:37:29 +02:00
Jonas Kruckenberg
d4223f6fd2 feat(store): expose Store to Rust code (#108)
* feat(store): expose Store to Rust code in a meaningful way

* manually implement Default to improve generic inference

* update readme

* rename method

* make error Send and Sync

* make `use_store` more ergonomic

* export JsonValue

* fix readme example

* fmt

---------

Co-authored-by: FabianLars <fabianlars@fabianlars.de>
2023-03-06 15:44:02 +01:00
Lucas Fernandes Nogueira
22f987bf24 feat: update setup hook to new syntax (#257) 2023-02-16 13:42:26 -03:00
Jonas Kruckenberg
9568a99d4c Merge pull request #52 from tauri-apps/store/rename 2023-01-06 20:27:44 +01:00
Jonas Kruckenberg
a2afb07029 refactor(store): rename plugin
align with plugin naming conventions
2023-01-06 14:24:11 +01:00
FabianLars
5b9144594b fix: make clippy 1.66 happy 2023-01-03 10:24:04 +01:00
Jonas Kruckenberg
64aed34eff clippy 2022-12-14 20:46:23 +01:00
Jonas Kruckenberg
eb3495fb72 copy plugin sources 2022-12-14 18:43:39 +01:00