Skip to content
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

chore(deps): update dependency unplugin-vue-router to ^0.8.5 (main) #25913

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Feb 22, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
unplugin-vue-router ^0.7.0 -> ^0.8.3 age adoption passing confidence

Release Notes

posva/unplugin-vue-router (unplugin-vue-router)

v0.8.3

Compare Source

Bug Fixes

v0.8.2

Compare Source

Bug Fixes
  • data-loaders: fix types references (6558fa8)
  • types: typed router (8ff1984)

v0.8.1

Compare Source

Bug Fixes
  • upgrade peer dep on vue-router to 4.3.0 (746ad8f)

v0.8.0

Compare Source

Based on the feedback of the RFC, the Data Loaders have been redesigned from the ground up and are now way more flexible and powerful. As a result, if you were using the experimental data loaders, make sure to check the list of breaking changes and the new RFC at https://uvr.esm.is/rfcs/data-loaders. We are looking for early testers and feedback!

For people using the file-based routing, you now need to add unplugin-vue-router/client to the types property of your tsconfig. See setup for an example.

Bug Fixes
  • allow errors outside of navigation (ae37a8e)
  • avoid uncatchable rejection (fa0c794)
  • delay setting the error (3d341ae)
  • discard loads from canceled navigations (aac66c1), closes posva/unplugin-vue-router#200
  • router.push types (98cb17b)
  • run nested loaders once when used across places (73a6cc5)
  • types: correct types in navigation guards (3f01155)
  • types: correctly extend client (d226cf9)
  • types: remove null from non raw star param (0b71ad5)
  • types: restrict what can be imported from the package (8748644), closes #​289
  • types: use vue-router/auto-routes (2dc0446)
  • use single alias for reused components on different paths (1544363)
Code Refactoring
  • rename pending to isLoading (9502751)
  • refactor!: remove deprecated APIs (0415b9e)
  • refactor(data-loaders)!: rewrite of data loaders (f0b7b58)
  • refactor!: remove setupLoaderGuard (8094f62)
Features
  • add pinia colada properties (63a768f)
  • commit option (56b2a4d), closes posva/unplugin-vue-router#201
  • data-fetching: add server option (d4d2f46)
  • data-loaders: abort the signal for old pending locations (afabb47)
  • data-loaders: add abort signal to navigation (a175fa7)
  • data-loaders: allow changing the navigation result (7a7da74)
  • data-loaders: pass the signal to the loader (85d0494)
  • handle thrown errors (2e38544)
  • inject in nested loaders (b0aa0b3)
  • loaders: thrown navigation results take precedence (2aaaf56)
  • return a promise of data only (d2dda40)
  • run loaders with access to global inject and provide (9d95e27)
  • track used params (b2ae763)
Performance Improvements
  • compute params once (322f220)
  • use a shallowRef for data (aae0c70)
  • use for of instead of forEach (1635745)
BREAKING CHANGES
  • Remove the deprecated APIs:

  • createPrefixTree() -> new PrefixTree()

  • VueRouterExports -> VueRouterAutoImports

  • Data Loaders have been redesigned to be more flexible
    and account for other libraries. Notably, the caching behavior has been
    moved out of the basic loader to an extended one pinia-colada and the basic loader
    has no cache. All of the pending bugs have also been fixed.
    I recommend you to give the RFC examples a new read to get
    setup: https://uvr.esm.is/rfcs/data-loaders/. Most of the changes are
    simplifying things by removing them.
    Here is a list of the breaking changes to simplify
    migration:

    • The dataFetching option is no longer needed.
    • Manual work needed to add loaders with HasDataLoaderMeta has been
      removed. It is just no longer needed. Loaders are picked up from lazy
      loaded components and must otherwise be directly added to a meta.loaders
      array. See the example at https://uvr.esm.is/rfcs/data-loaders/#basic-example
    • The function setupDataFetchingGuard has been replaced with a Vue
      Plugin. See https://uvr.esm.is/rfcs/data-loaders/#data-loader-setup
      for details.
    • If you were relying on cacheTime, use the staleTime option in the
      new defineColadaLoader() based off @​pinia/colada
    • To reduce the dependency on file-based router, things have been
      refactored and none of the defineLoader functions are automatically
      imported anymore. You can add them yourself to the list of auto
      imports, or import them from vue-router/auto. The good news is you
      no longer need to use the plugin in order to benefit from the data
      loaders; they can be directly imported from
      unplugin-vue-router/runtime even if you don't want file-based routing.

    If you find missing information or improvements, please open a Pull
    Request to improve the CHANGELOG.md.

    • The navigation guard is replaced in favor of a Vue
      plugin:

    Replace

    import { setupLoaderGuard } from 'vue-router/auto'
    
    setupLoaderGuard({ router, app })

    with

    import { DataLoaderPlugin } from 'vue-router/auto'
    
    app.use(DataLoaderPlugin, { router })
    • vue-router/auto/routes becomes vue-router/auto-routes. This change was necessary to improve compatibility with
      TypeScript and other tools in the ecosystem. Most of the time you don't
      need to use this path but if you were using it, replace it:
    - import { } from 'vue-router/auto/routes'
    + import { } from 'vue-router/auto-routes'
    • Data Loaders now return an isLoading property instead
      of pending. This aligns better with the wording of Data Loaders being
      in a loading state rather than pending, which can have more meanings.

    • You know need to add unplugin-vue-router/client to the types property of your tsconfig. See setup for an example.

    • the existing defineLoader is being replaced by a
      basic loader without cache. The version with cache will be implemented
      by adding a library that properly handles the caching. This new strategy
      will also enable other integrations like VueFire, Apollo, and custom
      ones. Keep an eye (subscribe) to the RFC for news and to discus abhttps://github.com/vuejs/rfcs/discussions/460://github.com/Vue Router Data Loaders vuejs/rfcs#460

    • since data loaders aren't meant to be awaited in script
      setup (they are awaited at the navigation level), they now return a
      promise of the raw data only, not of the UseDataLoaderReturn, to make it
      clearer that this syntax is a bit special and should only be used within
      nested loaders. This change also brings other benefits like allowing
      lazy loaders to be awaited within loaders without changing their usage
      outside, in components. Also, allowing different types of commit while
      still allowing data to be awaited within loaders.


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.

Copy link

stackblitz bot commented Feb 22, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@renovate renovate bot force-pushed the renovate/main-unplugin-vue-router branch 2 times, most recently from 0b7cf86 to a32785c Compare February 22, 2024 16:33
@renovate renovate bot changed the title chore(deps): update dependency unplugin-vue-router to ^0.8.2 (main) chore(deps): update dependency unplugin-vue-router to ^0.8.3 (main) Feb 22, 2024
@renovate renovate bot force-pushed the renovate/main-unplugin-vue-router branch from a32785c to 8913981 Compare February 22, 2024 16:58
Copy link
Contributor Author

renovate bot commented Feb 22, 2024

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

Warning: custom changes will be lost.

@danielroe danielroe changed the title chore(deps): update dependency unplugin-vue-router to ^0.8.3 (main) chore(deps): update dependency unplugin-vue-router to ^0.8.5 (main) Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant