This plugin provides an interface for storing unencrypted values on the application cache folder.

Overview

Tauri Plugin Store

Test

This plugin provides an interface for storing unencrypted values on the application cache folder.

Architecture

This repo shape might appear to be strange, but it is really just a hybrid Rust / Typescript project that recommends a specific type of consumption, namely using GIT as the secure distribution mechanism, and referencing specific unforgeable git hashes. Of course, it can also be consumed via Cargo and NPM.

/src

Rust source code that contains the plugin definition.

/webview-src

Typescript source for the /webview-dist folder that provides an API to interface with the rust code.

/webview-dist

Tree-shakeable transpiled JS to be consumed in a Tauri application.

/bindings

Forthcoming tauri bindings to other programming languages, like DENO.

Installation

There are three general methods of installation that we can recommend.

  1. Pull sources directly from Github using git tags / revision hashes (most secure, good for developement, shown below)
  2. Git submodule install this repo in your tauri project and then use file protocol to ingest the source
  3. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)

For more details and usage see the example app. Please note, below in the dependencies you can also lock to a revision/tag in both the Cargo.toml and package.json

RUST

src-tauri/Cargo.toml

[dependencies.tauri-plugin-store]
git = "https://github.com/tauri-apps/tauri-plugin-store"
tag = "v0.1.0"
#branch = "main"

Use in src-tauri/src/main.rs:

use tauri_plugin_store::Store;

fn main() {
    tauri::Builder::default()
        .plugin(Store::default())
        .build()
        .run();
}

WEBVIEW

Install from a tagged release

npm install github:tauri-apps/tauri-plugin-store#v0.1.0
# or
yarn add github:tauri-apps/tauri-plugin-store#v0.1.0

Install from a commit

npm install github:tauri-apps/tauri-plugin-store#488558717b77d8a2bcb37acfd2eca9658aeadc8e
# or
yarn add github:tauri-apps/tauri-plugin-store#488558717b77d8a2bcb37acfd2eca9658aeadc8e

package.json

  "dependencies": {
    "tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store#v0.1.0",

Use within your JS/TS:

import Store from 'tauri-plugin-store-api'
const store = new Store('.settings.dat')
await store.set('some-key', { value: 5 })
const val = await store.get('some-key')
assert(val, { value: 5 })

License

MIT / Apache-2.0

Comments
  • use `load` method error

    use `load` method error

    When I call store.load() after using store.save() to disk.

    Failed to deserialize store. Bincode does not support the serde::Deserializer::deserialize_any method

    opened by hey-feitian 8
  • store.save() does not work

    store.save() does not work

    Cargo toml:

    [build-dependencies]
    tauri-build = { version = "1.0.0-rc.4", features = [] }
    
    [dependencies]
    serde_json = "1.0"
    serde = { version = "1.0", features = ["derive"] }
    tauri = { version = "1.0.0-rc.4", features = ["clipboard-all", "dialog-all", "fs-read-file", "fs-write-file", "shell-all", "window-all"] }
    
    [dependencies.tauri-plugin-store]
    git = "https://github.com/tauri-apps/tauri-plugin-store"
    branch = "dev"
    
    [features]
    # by default Tauri runs in production mode
    # when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
    default = [ "custom-protocol" ]
    # this feature is used used for production builds where `devPath` points to the filesystem
    # DO NOT remove this
    custom-protocol = [ "tauri/custom-protocol" ]
    

    main.rs:

    #![cfg_attr(
      all(not(debug_assertions), target_os = "windows"),
      windows_subsystem = "windows"
    )]
    
    use tauri_plugin_store::PluginBuilder;
    
    fn main() {
      tauri::Builder::default()
        .plugin(PluginBuilder::default().build())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
    }
    

    package.json:

    {
      "dependencies": {
        "tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store#dev",
      }
    }
    

    React code:

    const store = new Store('.settings.dat');
    
    let storeBases = await store.get('bases') as number[];
    storeBases = storeBases ? [...storeBases, baseToAdd] : [baseToAdd];
    await store.set('bases', storeBases);
    await store.save();
    

    The store operations work till the app is running (navigating away or into this page). But the settings file is not persisted on disk and subsequent runs have a blank store. I also have both readFile and writeFile enabled in the allowList.

    opened by a-khanna 5
  • Tauri-plugin-store-api improvements

    Tauri-plugin-store-api improvements

    This PR adds the following

    • only bundles webview-dist files
    • create minified and non-minified builds
    • upgrade ts configuration
    • add temp type-fest dependency until latest commits of @tauri-apps/api is published
    opened by JonasKruckenberg 5
  • Cannot install plugin either for Rust or JS/TS

    Cannot install plugin either for Rust or JS/TS

    I tried to follow the readme instructions, but i get a couple of different errors when installing the plugin both for Rust and for the FE

    For Rust i have added the following to my Cargo.toml:

    [dependencies.tauri-plugin-store]
    git = "https://github.com/tauri-apps/tauri-plugin-store"
    tag = "v0.1.0"
    #branch = "main"
    

    When i try to run the app i get this on the console:

     Updating git repository `https://github.com/tauri-apps/tauri-plugin-store`
    error: failed to get `tauri-plugin-store` as a dependency of package `app v0.1.0 (/Users/myName/Sites/my-app/app/src-tauri)`
    
    Caused by:
      failed to load source for dependency `tauri-plugin-store`
    
    Caused by:
      Unable to update https://github.com/tauri-apps/tauri-plugin-store?tag=v0.1.0
    
    Caused by:
      failed to find tag `v0.1.0`
    
    Caused by:
      reference 'refs/remotes/origin/tags/v0.1.0' not found; class=Reference (4); code=NotFound (-3)
    

    On the JS side i have tried to install it by running:

    npm install github:tauri-apps/tauri-plugin-store#v0.1.0
    

    but this gives me:

    npm ERR! code 1
    npm ERR! The git reference could not be found
    npm ERR! command git --no-replace-objects checkout v0.1.0
    npm ERR! error: pathspec 'v0.1.0' did not match any file(s) known to git
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/myName/.npm/_logs/2022-10-15T18_39_27_111Z-debug-0.log
    

    Not sure if this is needed, but here is the output from npm run tauri info:

    Environment
      › OS: Mac OS 12.4.0 X64
      › Node.js: 16.14.0
      › npm: 8.3.1
      › pnpm: Not installed!
      › yarn: Not installed!
      › rustup: 1.25.1
      › rustc: 1.64.0
      › cargo: 1.64.0
      › Rust toolchain: stable-aarch64-apple-darwin 
    
    Packages
      › @tauri-apps/cli [NPM]: 1.1.1
      › @tauri-apps/api [NPM]: Not installed!
      › tauri [RUST]: 1.1.1,
      › tauri-build [RUST]: 1.1.1,
      › tao [RUST]: 0.14.0,
      › wry [RUST]: 0.21.1,
    
    App
      › build-type: bundle
      › CSP: unset
      › distDir: ../dist
      › devPath: http://localhost:5173/
    
    App directory structure
      ├─ types
      ├─ dist
      ├─ node_modules
      ├─ public
      ├─ src-tauri
      └─ src
    

    This is my first project with Tauri, so i am sorry if it isn't working because i am doing something wrong. If that is the case, maybe we should improve the docs / readme instructions

    opened by boguz 4
  • update readme with installation instructions

    update readme with installation instructions

    Update readme with installation instructions pointing at "dev" branch rather than non-existent "main" branch. Also commented out tag v0.1.0 since it fails to find the listed tag.

    opened by dchicchon 3
  • [Question] How do i get or set from the store in rust?

    [Question] How do i get or set from the store in rust?

    Dearest Maintainer,

    I would like to use this store for configuration. The app I am creating has a UI and CLI. I am unsure how I can access the config from rust right now. Any advice would be appreciated.

    Thanks for you work on this. Becker

    opened by sbeckeriv 3
  • serialize with serde_json instead of bincode, closes #64

    serialize with serde_json instead of bincode, closes #64

    As said in #64 the problem is that we use serde_json::Value which can't be ~~serialized~~ deserialized with bincode (doesn't work with bincode@v2 either (by design)).

    string-like values were (depending on the editor) human readable with bincode anyway, so we're not losing much obfuscation. That said, we could add something to change that, but that might be something for a different PR.

    opened by FabianLars 3
  • Next js support?

    Next js support?

    Hi,

    Wanna ensure is this plugin compatible with next.js ? because when I implement it into the next.js app, got this issue

    ReferenceError: window is not defined
    

    Thank you

    opened by akwanmaroso 2
  • Return UnlistenFn from `onChange` and `onKeyChange`

    Return UnlistenFn from `onChange` and `onKeyChange`

    window.WebviewWindow.listen returns a promise that resolves to a function to unregister the callback. link

    This is what the documentation says about the return value of listen:

    A promise resolving to a function to unlisten to the event. Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.

    It is currently impossible to "unlisten" due to the return value not being forwarded to the caller. This PR fixes this.

    opened by Narcha 2
  • Expose `StoreCollection` as public

    Expose `StoreCollection` as public

    Hello 👋

    Problems

    Currently StoreCollection is not public, so cannot be access with app state.

    There is a use case to directly control the store, and it would be nice to be able to access the app state.

    fn setup<R: Runtime>(app: &mut App<R>)
    {
      let stores = app.state::<State<'_, StoreCollection>>(); // access app state (expected)
    }
    
    fn main() {
      tauri::Builder::default()
        .plugin(PluginBuilder::default().build())
        .setup(setup)
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
    }
    

    Proposal

    Expose StoreCollection as public:

    #[derive(Default)]
    pub struct StoreCollection {
      stores: Mutex<HashMap<PathBuf, Store>>,
      frozen: bool,
    }
    
    opened by seokju-na 2
  • Save store to app dir instead of working dir

    Save store to app dir instead of working dir

    Hi! Was trying out this plugin a bit, and noticed it didn't save the store correctly, instead writing to the working directory. Looked into it a bit and it seems there was a small oversight in the saving code :)

    opened by chrrs 2
  • Update dependency @rollup/plugin-typescript to v10

    Update dependency @rollup/plugin-typescript to v10

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @rollup/plugin-typescript (source) | 8.5.0 -> 10.0.1 | age | adoption | passing | confidence |


    Release Notes

    rollup/plugins

    v10.0.1

    Compare Source

    2022-11-28

    Bugfixes

    v10.0.0

    Compare Source

    2022-11-27

    Breaking Changes
    • fix: incorrect declarations directory (a5c90d1)

    v9.0.2

    Compare Source

    2022-10-21

    Updates
    • chore: update rollup dependencies (3038271)

    v9.0.1

    Compare Source

    2022-10-11

    Bugfixes

    v9.0.0

    Compare Source

    2022-10-10

    Breaking Changes

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency typescript to v4.9.4

    Update dependency typescript to v4.9.4

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | typescript (source) | 4.8.4 -> 4.9.4 | age | adoption | passing | confidence |


    Release Notes

    Microsoft/TypeScript

    v4.9.4: TypeScript 4.9.4

    Compare Source

    For release notes, check out the release announcement.

    For the complete list of fixed issues, check out the

    Downloads are available on:

    Changes:

    This list of changes was auto generated.

    v4.9.3: TypeScript 4.9

    Compare Source

    For release notes, check out the release announcement.

    Downloads are available on:

    Changes:

    See More

    This list of changes was auto generated.


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency @tauri-apps/api to v1.2.0

    Update dependency @tauri-apps/api to v1.2.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @tauri-apps/api | 1.1.0 -> 1.2.0 | age | adoption | passing | confidence |


    Release Notes

    tauri-apps/tauri

    v1.2.0: tauri v1.2.0

    Updating crates.io index

    Cargo Audit

    Fetching advisory database from `https://github.com/RustSec/advisory-db.git`
          Loaded 469 security advisories (from /home/runner/.cargo/advisory-db)
        Updating crates.io index
        Scanning Cargo.lock for vulnerabilities (453 crate dependencies)
    Crate:     xml-rs
    Version:   0.8.4
    Warning:   unmaintained
    Title:     xml-rs is Unmaintained
    Date:      2022-01-26
    ID:        RUSTSEC-2022-0048
    URL:       https://rustsec.org/advisories/RUSTSEC-2022-0048
    Dependency tree:
    xml-rs 0.8.4
    └── plist 1.3.1
        └── tauri-codegen 1.2.0
            ├── tauri-macros 1.2.0
            │   └── tauri 1.2.0
            │       ├── tauri 1.2.0
            │       ├── restart 0.1.0
            │       └── app-updater 0.1.0
            └── tauri-build 1.2.0
                └── app-updater 0.1.0
    
    warning: 1 allowed warning found
    

    [1.2.0]

    • Add accept_first_mouse option for macOS windows.
    • Add new app-specific BaseDirectory enum variants AppConfig, AppData, AppLocalData, AppCache and AppLog along with equivalent functions in path module and deprecated ambiguous variants Log and App along with their equivalent functions in path module.
    • Set the correct mimetype when streaming files through asset: protocol
    • Disable automatic window tabbing on macOS when the tabbing_identifier option is not defined, the window is transparent or does not have decorations.
    • The custom protocol now validates the request URI. This has implications when using the asset protocol without the convertFileSrc helper, the URL must now use the asset://localhost/$filePath format.
    • Escape glob special characters in files/directories when dropping files or using the open/save dialogs.
    • Properly emit events with object payload.
    • Fixes access to the WebviewWindow.getByLabel function in a tauri://window-created event listener.
    • Fixes resource reading being always rejected by the scope.
    • Fixes __TAURI_PATTERN__ object freeze.
    • Readd the option to create an unfocused window via the focused method. The focus function has been deprecated.
    • Add hidden_title option for macOS windows.
    • Custom protocol headers are now implemented on Linux when running on webkit2gtk 2.36 or above.
    • Add App::show(), AppHandle::show(), App::hide() and AppHandle::hide() for hiding/showing the entire application on macOS.
      • 39bf895b feat(macOS): Add application show and hide methods (#​3689) on 2022-10-03
    • Fix a deadlock when modifying the menu in the on_menu_event closure.
    • Resolve base system directory in shell scope.
    • Added tabbing_identifier to the window builder on macOS.
    • Add title_bar_style option for macOS windows.
    • Added methods to set the system tray title on macOS.
    • Added the user_agent option when creating a window.
      • a6c94119 feat(core): expose user_agent to window config (#​5317) on 2022-10-02

    Cargo Publish

    Updating crates.io index
       Packaging tauri v1.2.0 (/home/runner/work/tauri/tauri/core/tauri)
       Verifying tauri v1.2.0 (/home/runner/work/tauri/tauri/core/tauri)
     Downloading crates ...
      Downloaded siphasher v0.3.10
      Downloaded serde_repr v0.1.9
      Downloaded rand_chacha v0.2.2
      Downloaded serialize-to-javascript-impl v0.1.1
      Downloaded serde_with_macros v1.5.2
      Downloaded socket2 v0.4.7
      Downloaded rand_core v0.6.4
      Downloaded unicode-segmentation v1.10.0
      Downloaded uuid v0.8.2
      Downloaded version-compare v0.0.11
      Downloaded webkit2gtk v0.18.2
      Downloaded xattr v0.2.3
      Downloaded serde_with v1.14.0
      Downloaded proc-macro-crate v1.2.1
      Downloaded version-compare v0.1.0
      Downloaded pango-sys v0.15.10
      Downloaded matches v0.1.9
      Downloaded pango v0.15.10
      Downloaded glib-sys v0.15.10
      Downloaded gio-sys v0.15.10
      Downloaded gio v0.15.12
      Downloaded gdkx11-sys v0.15.1
      Downloaded http-range v0.1.5
      Downloaded phf_codegen v0.8.0
      Downloaded phf_macros v0.8.0
      Downloaded phf v0.10.1
      Downloaded phf_shared v0.8.0
      Downloaded x11 v2.20.0
      Downloaded tauri-runtime-wry v0.12.0
      Downloaded gtk3-macros v0.15.4
      Downloaded tokio-macros v1.8.0
      Downloaded utf-8 v0.7.6
      Downloaded treediff v3.0.2
      Downloaded tendril v0.4.3
      Downloaded tar v0.4.38
      Downloaded walkdir v2.3.2
      Downloaded pest v2.4.1
      Downloaded darling v0.13.4
      Downloaded remove_dir_all v0.5.3
      Downloaded ucd-trie v0.1.5
      Downloaded phf_shared v0.10.0
      Downloaded uuid v1.2.1
      Downloaded semver v0.11.0
      Downloaded infer v0.7.0
      Downloaded tauri-codegen v1.2.0
      Downloaded state v0.5.3
      Downloaded thin-slice v0.1.1
      Downloaded same-file v1.0.6
      Downloaded rand_core v0.5.1
      Downloaded tauri-utils v1.2.0
      Downloaded selectors v0.22.0
      Downloaded tauri-runtime v0.12.0
      Downloaded rustc_version v0.4.0
      Downloaded rand_pcg v0.2.1
      Downloaded cssparser-macros v0.6.0
      Downloaded tauri-macros v1.2.0
      Downloaded slab v0.4.7
      Downloaded flate2 v1.0.24
      Downloaded futures-core v0.3.25
      Downloaded cssparser v0.27.2
      Downloaded futf v0.1.5
      Downloaded tempfile v3.3.0
      Downloaded raw-window-handle v0.5.0
      Downloaded digest v0.10.5
      Downloaded cty v0.2.2
      Downloaded ctor v0.1.26
      Downloaded fastrand v1.8.0
      Downloaded typenum v1.15.0
      Downloaded wry v0.22.0
      Downloaded tao v0.15.0
      Downloaded encoding_rs v0.8.31
      Downloaded brotli v3.3.4
      Downloaded javascriptcore-rs v0.16.0
      Downloaded gtk v0.15.5
      Downloaded cpufeatures v0.2.5
      Downloaded atk-sys v0.15.1
      Downloaded glib-macros v0.15.11
      Downloaded glib v0.15.12
      Downloaded convert_case v0.4.0
      Downloaded rand v0.8.5
      Downloaded rand v0.7.3
      Downloaded png v0.17.7
      Downloaded http v0.2.8
      Downloaded gtk-sys v0.15.3
      Downloaded deflate v0.7.20
      Downloaded system-deps v6.0.3
      Downloaded png v0.11.0
      Downloaded javascriptcore-rs-sys v0.4.0
      Downloaded ignore v0.4.18
      Downloaded gdk v0.15.4
      Downloaded string_cache_codegen v0.5.2
      Downloaded stable_deref_trait v1.2.0
      Downloaded kuchiki v0.8.1
      Downloaded inflate v0.3.4
    

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency tslib to v2.4.1

    Update dependency tslib to v2.4.1

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | tslib (source) | 2.4.0 -> 2.4.1 | age | adoption | passing | confidence |


    Release Notes

    Microsoft/tslib

    v2.4.1: tslib 2.4.1

    Compare Source

    This release contains fixes for early returns and throws invoked on generators.


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency rollup to v3

    Update dependency rollup to v3

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | rollup (source) | 2.78.1 -> 3.8.1 | age | adoption | passing | confidence |


    Release Notes

    rollup/rollup

    v3.8.1

    Compare Source

    2022-12-23

    Bug Fixes
    • Reduce memory footprint when explicitly passing cache: false (#​4762)
    • Fix a crash when preserving modules and reexporting namespaces (#​4766)
    Pull Requests

    v3.8.0

    Compare Source

    2022-12-22

    Features
    • Deduplicate ESM exports and reexports when preserving modules (#​4759)
    Bug Fixes
    • Handle files that are emitted as a side effect of the manualChunks option (#​4759)
    Pull Requests

    v3.7.5

    Compare Source

    2022-12-17

    Bug Fixes
    • Avoid name shadowing when default exporting a class that matches the name of another class (#​4756)
    • Do not display the error message both in a separate line and in the stack trace in rollup CLI (#​4749)
    • Make type of RollupWarning.cause compatible with Error.cause (#​4757)
    • Do not swallow side effects when interacting with modules namespaces nested in another object (#​4758)
    Pull Requests

    v3.7.4

    Compare Source

    2022-12-13

    Bug Fixes
    • Do not remove calls to .exec and .test for included stateful regular expressions (#​4742)
    Pull Requests

    v3.7.3

    Compare Source

    2022-12-11

    Bug Fixes
    • Ensure this.getFileName no longer returns a placeholder as soon as hash placeholders have been resolved (#​4747)
    Pull Requests

    v3.7.2

    Compare Source

    2022-12-10

    Bug Fixes
    • Improve chunk generation performance when one module is dynamically imported by many other modules (#​4736)
    Pull Requests

    v3.7.1

    Compare Source

    2022-12-09

    Bug Fixes
    Pull Requests

    v3.7.0

    Compare Source

    2022-12-08

    Features
    • Do not treat .test and .exec on regular expressions as side effects (#​4737)
    Pull Requests

    v3.6.0

    Compare Source

    2022-12-05

    Features
    • extend this.getModuleInfo with information about exports (#​4731)
    Pull Requests

    v3.5.1

    Compare Source

    2022-12-01

    Bug Fixes
    • Accept functions returning a config in defineConfig (#​4728)
    Pull Requests
    • #​4728: Overload defineConfig to accept a RollupOptionsFunction parameter (@​Septh)

    v3.5.0

    Compare Source

    2022-11-27

    Features
    • Add treeshake.manualPureFunctions to override static analysis for explicit function names (#​4718)
    Bug Fixes
    • Do not throw when a plugin uses this.load without awaiting its result (#​4725)
    Pull Requests

    v3.4.0

    Compare Source

    2022-11-22

    Features
    • Do not keep unused Object.freeze calls on object literals (#​4720)
    Pull Requests

    v3.3.0

    Compare Source

    2022-11-12

    Features
    • Add "experimentalMinChunkSize" option to merge smaller chunks into larger ones (#​4705)
    • Automatically deduplicate assets again when the source is a Buffer (#​4712)
    • Deduplicate Buffer with string assets (#​4712)
    Bug Fixes
    • Support plugins with object hooks when using perf: true (#​4707)
    Pull Requests

    v3.2.5

    Compare Source

    2022-11-01

    Bug Fixes
    • We deconflicting classes, ensure the original class name still does not shadow variables (#​4697)
    Pull Requests

    v3.2.4

    Compare Source

    2022-10-31

    Bug Fixes
    • Always use forward slashes in chunk ids when preserving modules, even on Windows (#​4693)
    • Escape problematic characters in ids when rewriting import.meta.url (#​4693)
    Pull Requests

    v3.2.3

    Compare Source

    2022-10-18

    Bug Fixes
    • Fix an issue whre Rollup confused new.target with import.meta (#​4679)
    • Ensure that Rollup does not make assumptions about the value of unknown namespace import members (#​4684)
    Pull Requests

    v3.2.2

    Compare Source

    2022-10-16

    Bug Fixes
    • Do not hang/crash on hashbang comments in input modules (#​4676)
    Pull Requests

    v3.2.1

    Compare Source

    2022-10-16

    Bug Fixes
    • Rewrite class declarations to preserve their .name property if necessary (#​4674)
    Pull Requests

    v3.2.0

    Compare Source

    2022-10-15

    Features
    • Support providing Promises as plugins like Vite (#​4671)
    Pull Requests

    v3.1.0

    Compare Source

    2022-10-12

    Features
    • Support using arrays of plugins as plugins like Vite (#​4657)
    Pull Requests

    v3.0.1

    Compare Source

    2022-10-12

    Bug Fixes
    • Fix installation on Windows (#​4662)
    • Avoid missing parameters that are only used in a destructuring initializer (#​4663)
    Pull Requests

    v3.0.0

    Compare Source

    2022-10-11

    Breaking Changes
    General Changes
    • Rollup now requires at least Node 14.18.0 to run (#​4548 and #​4596)
    • The browser build has been split into a separate package @rollup/browser (#​4593)
    • The node build uses the node: prefix for imports of builtin modules (#​4596)
    • Some previously deprecated features have been removed (#​4552):
      • Some plugin context functions have been removed:
        • this.emitAsset(): use this.emitFile()
        • this.emitChunk(): use this.emitFile()
        • this.getAssetFileName(): use this.getFileName()
        • this.getChunkFileName(): use this.getFileName()
        • this.isExternal(): use this.resolve()
        • this.resolveId(): use this.resolve()
      • The resolveAssetUrl plugin hook has been removed: use resolveFileUrl
      • Rollup no longer passes assetReferenceId or chunkReferenceId parameters to resolveFileUrl
      • The treeshake.pureExternalModules option has been removed: use treeshake.moduleSideEffects: 'no-external'
      • You may no longer use true or false for output.interop. As a replacement for true, you can use "compat"
      • Emitted assets no longer have an isAsset flag in the bundle
      • Rollup will no longer fix assets added directly to the bundle by adding the type: "asset" field
    • Some features that were previously marked for deprecation now show warnings when used (#​4552):
      • Some options have been deprecated:
        • inlineDynamicImports as part of the input options: use output. inlineDynamicImports
        • manualChunks as part of the input options: use output. manualChunks
        • maxParallelFileReads: use `maxParallelFileOps
        • output.preferConst: use output.generatedCode.constBindings
        • output.dynamicImportFunction: use the renderDynamicImport plugin hook
        • output.namespaceToStringTag: use output.generatedCode.symbols
        • preserveModules as part of the input options: use output. preserveModules
      • You should no longer access this.moduleIds in plugins: use this.getModuleIds()
      • You should no longer access this.getModuleInfo(...).hasModuleSideEffects in plugins: use this.getModuleInfo(...).moduleSideEffects
    • Configuration files are only bundled if either the --configPlugin or the --bundleConfigAsCjs options are used. The configuration is bundled to an ES module unless the --bundleConfigAsCjs option is used. In all other cases, configuration is now loaded using Node's native mechanisms (#​4574 and #​4621)
    • The properties attached to some errors have been changed so that there are fewer different possible properties with consistent types (#​4579)
    • Some errors have been replaced by others (ILLEGAL_NAMESPACE_REASSIGNMENT -> ILLEGAL_REASSIGNMENT, NON_EXISTENT_EXPORT -> MISSING_EXPORT) (#​4579)
    • Files in rollup/dist/* can only be required using their file extension (#​4581)
    • The loadConfigFile helper now has a named export of the same name instead of a default export (#​4581)
    • When using the API and sourcemaps, sourcemap comments are contained in the emitted files and sourcemaps are emitted as regular assets (#​4605)
    • Watch mode no longer uses Node's EventEmitter but a custom implementation that awaits Promises returned from event handlers (#​4609)
    • Assets may only be deduplicated with previously emitted assets if their source is a string (#​4644)
    • By default, Rollup will keep external dynamic imports as import(…) in commonjs output unless output.dynamicImportInCjs is set to false (#​4647)
    Changes to Rollup Options
    • As functions passed to output.banner/footer/intro/outro are now called per-chunk, they should be careful to avoid performance-heavy operations (#​4543)
    • entryFileNames/chunkFileNames functions now longer have access to the rendered module information via modules, only to a list of included moduleIds (#​4543)
    • The path of a module is no longer prepended to the corresponding chunk when preserving modules (#​4565)
    • When preserving modules, the [name] placeholder (as well as the chunkInfo.name property when using a function) now includes the relative path of the chunk as well as optionally the file extension if the extension is not one of .js, .jsx, .mjs, .cjs, .ts, .tsx, .mts, or .cts (#​4565)
    • The [ext], [extName] and [assetExtName] placeholders are no longer supported when preserving modules (#​4565)
    • The perf option no longer collects timings for the asynchronous part of plugin hooks as the readings were wildly inaccurate and very misleading, and timings are adapted to the new hashing algorithm (#​4566)
    • Change the default value of makeAbsoluteExternalsRelative to "ifRelativeSource" so that absolute external imports will no longer become relative imports in the output, while relative external imports will still be renormalized (#​4567)
    • Change the default for output.generatedCode.reservedNamesAsProps to no longer quote properties like default by default (#​4568)
    • Change the default for preserveEntrySignatures to "exports-only" so that by default, empty facades for entry chunks are no longer created (#​4576)
    • Change the default for output.interop to "default" to better align with NodeJS interop (#​4611)
    • Change the default for output.esModule to "if-default-prop", which only adds __esModule when the default export would be a property (#​4611)
    • Change the default for output.systemNullSetters to true, which requires at least SystemJS 6.3.3 (#​4649)
    Plugin API Changes
    • Plugins that add/change/remove imports or exports in renderChunk should make sure to update ChunkInfo.imports/importedBindings/exports accordingly (#​4543)
    • The order of plugin hooks when generating output has changed (#​4543)
    • Chunk information passed to renderChunk now contains names with hash placeholders instead of final names, which will be replaced when used in the returned code or ChunkInfo.imports/importedBindings/exports (#​4543 and #​4631)
    • Hooks defined in output plugins will now run after hooks defined in input plugins (used to be the other way around) (#​3846)
    Features
    • Functions passed to output.banner/footer/intro/outro are now called per-chunk with some chunk information (#​4543)
    • Plugins can access the entire chunk graph via an additional parameter in renderChunk (#​4543)
    • Chunk hashes only depend on the actual content of the chunk and are otherwise stable against things like renamed/moved source files or changed module resolution order (#​4543)
    • The length of generated file hashes can be customized both globally and per-chunk (#​4543)
    • When preserving modules, the regular entryFileNames logic is used and the path is included in the [name] property. This finally gives full control over file names when preserving modules (#​4565)
    • output.entryFileNames now also supports the [hash] placeholder when preserving modules (#​4565)
    • The perf option will now collect (synchronous) timings for all plugin hooks, not just a small selection (#​4566)
    • All errors thrown by Rollup have name: RollupError now to make clearer that those are custom error types (#​4579)
    • Error properties that reference modules (such as id and ids) will now always contain the full ids. Only the error message will use shortened ids (#​4579)
    • Errors that are thrown in response to other errors (e.g. parse errors thrown by acorn) will now use the standardized cause property to reference the original error (#​4579)
    • If sourcemaps are enabled, files will contain the appropriate sourcemap comment in generateBundle and sourcemap files are available as regular assets (#​4605)
    • Returning a Promise from an event handler attached to a RollupWatcher instance will make Rollup wait for the Promise to resolve (#​4609)
    • There is a new value "compat" for output.interop that is similar to "auto" but uses duck-typing to determine if there is a default export (#​4611)
    • There is a new value "if-default-prop" for esModule that only adds an __esModule marker to the bundle if there is a default export that is rendered as a property (#​4611)
    • Rollup can statically resolve checks for foo[Symbol.toStringTag] to "Module" if foo is a namespace (#​4611)
    • There is a new CLI option --bundleConfigAsCjs which will force the configuration to be bundled to CommonJS (#​4621)
    • Import assertions for external imports that are present in the input files will be retained in ESM output (#​4646)
    • Rollup will warn when a module is imported with conflicting import assertions (#​4646)
    • Plugins can add, remove or change import assertions when resolving ids (#​4646)
    • The output.externalImportAssertions option allows to turn off emission of import assertions (#​4646)
    • Use output.dynamicImportInCjs to control if dynamic imports are emitted as import(…) or wrapped require(…) when generating commonjs output (#​4647)
    Bug Fixes
    • Chunk hashes take changes in renderChunk, e.g. minification, into account (#​4543)
    • Hashes of referenced assets are properly reflected in the chunk hash (#​4543)
    • No longer warn about implicitly using default export mode to not tempt users to switch to named export mode and break Node compatibility (#​4624)
    • Avoid performance issues when emitting thousands of assets (#​4644)
    Pull Requests

    v2.79.1

    Compare Source

    2022-09-22

    Bug Fixes
    • Avoid massive performance degradation when creating thousands of chunks (#​4643)
    Pull Requests

    v2.79.0

    Compare Source

    2022-08-31

    Features
    • Add amd.forceJsExtensionForImports to enforce using .js extensions for relative AMD imports (#​4607)
    Pull Requests

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
Owner
Tauri
Build smaller, faster, and more secure desktop applications with a web frontend
Tauri
A tool for investigating file system and folder contents and their changes.

Sniff A tool for investigating file systems and folder contents and their changes. Sniff can create snapshots of file systems and folders, storing has

Niclas Schwarzlose 6 Jan 14, 2023
Backup a folder to AWS S3, once or periodically

awsbck This utility lets you compress a folder and upload it to a AWS S3 bucket, once or periodically. Disclaimer This software is in a beta stage and

Valentin Bersier 4 Feb 11, 2023
Plugin to request a relaunch when uploading a Skyline plugin through cargo skyline

restart-plugin A skyline plugin for allowing cargo-skyline (or other tools) to restart your game without you having to touch your controller. Install

null 1 Nov 21, 2021
A Rust crate that provides a simple interface for LZMA compression and decompression.

rust-lzma Documentation This crate provides a simple interface to liblzma. LZMA is more commonly known as XZ or 7zip, (as in, files with the .xz or .7

null 52 Nov 26, 2022
A cross-platform serial port library in Rust. Provides a blocking I/O interface and port enumeration including USB device information.

Note: This is a fork of the original serialport-rs project on GitLab. Please note there have been some changes to both the supported targets and which

Serialport 128 Jan 4, 2023
Nix binary cache implemented in rust using libnix-store

harmonia Build Whole application nix-shell --run cargo b C Library Wrapper around libnixstore nix-shell --run make Note: The makefile is only to pro

Helsinki Systems 84 Dec 24, 2022
A balanced unbounded interval-tree in Rust with associated values in the nodes

store-interval-tree A balanced unbounded interval-tree in Rust with associated values in the nodes. Based on rudac and bio. Example use store_interval

Andrea Fioraldi 3 Nov 22, 2022
syncmap is a fast, concurrent cache library built with a focus on performance and correctness.

syncmap syncmap syncmap is a fast, concurrent cache library syncmap is a fast, concurrent cache library built with a focus on performance and correctn

Behrouz R.Farsi 15 Dec 2, 2022
Rust crate which provides direct access to files within a Debian archive

debarchive This Rust crate provides direct access to files within a Debian archive. This crate is used by our debrep utility to generate the Packages

Pop!_OS 11 Dec 18, 2021
hy-rs, pronounced high rise, provides a unified and portable to the hypervisor APIs provided by various platforms.

Introduction The hy-rs crate, pronounced as high rise, provides a unified and portable interface to the hypervisor APIs provided by various platforms.

S.J.R. van Schaik 12 Nov 1, 2022
Rust crate that provides a convenient macro to quickly plot variables.

Debug Plotter This crate provides a convenient macro to quickly plot variables. Documentation For more information on how to use this crate, please ta

Fabian Bösiger 82 Dec 31, 2022
Provides utility functions to perform a graceful shutdown on an tokio-rs based service

tokio-graceful-shutdown IMPORTANT: This crate is in an early stage and not ready for production. This crate provides utility functions to perform a gr

null 61 Jan 8, 2023
archive-rs provides a generic way of dealing with multiple archive and compression formats in Rust

archive-rs A Rust crate that aims to provide a generic way of dealing with multiple archive and compression formats by providing a generic abstraction

S.J.R. van Schaik 2 Nov 21, 2021
Stack buffer provides alternatives to Buf{Reader,Writer} allocated on the stack instead of the heap.

StackBuf{Reader,Writer} Stack buffer provides alternatives to BufReader and BufWriter allocated on the stack instead of the heap. Its implementation i

Alex Saveau 14 Nov 20, 2022
untyped-arena provides an Arena allocator implementation that is safe and untyped with minimal complexity

untyped-arena untyped-arena provides an Arena allocator implementation that is safe and untyped with minimal complexity Usage let arena = Arena::new()

Max Bruce 1 Jan 9, 2022
This library provides a stable polyfill for Rust's Strict Provenance experiment.

This library provides a stable polyfill for Rust's Strict Provenance experiment.

Aria Beingessner 57 Nov 15, 2022
A rust interval arithmetic library which provides flags that detect domain errors.

intervals-good A Rust interval arithmetic library which provides flags that detect domain errors, supports more functions than any other interval arit

Oliver Flatt 3 Jul 27, 2022
Stdto provides a set of functional traits for conversion between various data representations.

Stdto stdto provides a set of functional traits for conversion between various data representations. | Examples | Docs | Latest Note | stdto = "0.13.0

Doha Lee 5 Dec 21, 2022
Scaffold that provides a basic setup for a Yew app with DaisyUI for styling.

Yew and Tailwind CSS Scaffold This scaffold provides a basic setup for a Yew app with Tailwind CSS for styling. It also includes DaisyUI, a Tailwind C

Alessio Marchi 6 Mar 3, 2023