Skip to content

Latest commit

 

History

History
763 lines (471 loc) · 44.7 KB

CHANGELOG.md

File metadata and controls

763 lines (471 loc) · 44.7 KB

0.10.8 (2024-09-08)

Features

  • loaders: allow errors as a function (df80b28)
  • loaders: allow plain value in colada loader key (646e5bf)
  • loaders: avoid warning during ssr (99d7b0b)
  • loaders: warn incorrect query usage (e43c5f5)

0.10.7 (2024-08-17)

Bug Fixes

  • loaders: reset context in ssr scenarios (4ea4b8c)

0.10.6 (2024-08-15)

Bug Fixes

  • loaders: remove default value for experimental (8773c96)

Features

  • expose experimental vite plugin (0903d61)
  • loaders: add more state to pinia colada (0163811)

0.10.5 (2024-08-15)

Features

  • loaders: change experimental option to match only specific folders (f01cddd)

0.10.4 (2024-08-14)

Features

  • experimental auto export of data loaders (16af831)

0.10.3 (2024-08-12)

Features

  • upgrade to @pinia/colada 0.8.0 (c372b14)

0.10.2 (2024-07-30)

Bug Fixes

  • avoid nested loaders in setup (3aea904)
  • loaders: avoid double fetch on nested loaders (f15bedc)

0.10.1 (2024-07-22)

Bug Fixes

Features

0.10.0 (2024-06-21)

Bug Fixes

  • types: use native vue-router types (5c1b6c3)

Features

Performance Improvements

BREAKING CHANGES

This version requires vue-router@4.4.0 or higher. The unplugin-vue-router/types no longer export all of the generic types from vue-router. Instead, import them directly from vue-router.

0.9.1 (2024-06-07)

Bug Fixes

0.9.0 (2024-05-28)

Bug Fixes

  • move extension handling outside of tree (85d8472), closes #400
  • remove wrong error log during HMR (c511082)
  • require explicit routes import to avoid cyclic imports (63788f6), closes #132

Code Refactoring

  • pkg: migrate package to type=module (f1e4ca5)

BREAKING CHANGES

  • createRouter() now requires the explicit router property to be set and imported:
import { createRouter, createWebHistory } from 'vue-router/auto'
+import { routes } from 'vue-router/auto-routes'

createRouter({
  history: createWebHistory(),
+  routes
})

This also means that runtime extendRoutes() option is not needed. It has been deprecated and will be removed in the next major release.

  • Tree and PrefixTree insert method expects a path without the file extension. They also expect the fullpath of the file as a second argument (it used to be optional). This aligns better with their responsibility as they shouldn't be trimming the extension like they used to.
// replace
tree.insert('file.vue')
// with
tree.insert('file', resolve('file.vue'))

This shouldn't affect most users as the Tree implementation is used internally to represent the folder structure.

  • pkg: The package is now of "type": "module". It shouldn't break anything for users but this is just in case, we all know how fragile this js ecosystem is sometimes...

0.8.8 (2024-05-22)

Bug Fixes

  • watch all extensions not just root (74ac22b)

0.8.7 (2024-05-20)

Bug Fixes

  • apply definePage in named pages (bd7d5b1), closes #383
  • correctly trim extensions from routesFolder (b8a9473), closes #274

Features

  • add an option to disable file watching (#387) (13f93fc)
  • add component alias to EditableTreeNode (fc8ae27)

0.8.6 (2024-04-12)

Bug Fixes

  • data-loaders: tracked properties with an object in key (58aa516)

0.8.5 (2024-03-14)

Bug Fixes

  • avoid invalid modules with definePage query (25bbec3), closes #338

0.8.4 (2024-02-24)

This patch contains the necessary fixes to allow importing the data loaders. However, they cannot be imported from vue-router/auto nor from unplugin-vue-router/runtime. Instead, they should be imported from unplugin-vue-router/data-loaders/.... This is needed as some of the loaders depends on extra packages that not all users have installed. At the moment, there are two data loaders

Bug Fixes

  • allow untyped router with data loaders (51f7d55)
  • build: externalize libs (e55d735)
  • remove the need to install @pinia/colada (8d45669)
  • types: externalize uvr/types (ee9a2a3), closes #322

0.8.3 (2024-02-22)

Bug Fixes

  • dts: fix default value for routesFolder (1ed1eda), closes #320

0.8.2 (2024-02-22)

Bug Fixes

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

0.8.1 (2024-02-22)

Bug Fixes

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

0.8.0 (2024-02-22)

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/data-loaders/rfc. 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/data-loaders/rfc.html#basic-example
    • The function setupDataFetchingGuard has been replaced with a Vue Plugin. See https://uvr.esm.is/data-loaders/rfc.html#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 unplugin-vue-router/data-loaders/.... The good news is you no longer need to use the plugin in order to benefit from the data loaders; they can be imported 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. This file contains the augmentation of the vue-router/auto module that was previously in typed-router.d.ts. You also need to set the modeResolution to Bundler in your tsconfig.json.

    • 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 about the future of 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.

0.7.0 (2023-09-22)

Bug Fixes

  • allow overriding and extending folder options (1f6e312)
  • correctly ignore folders (cbd14b9)
  • keep parent override in children (f651961), closes #189

Features

BREAKING CHANGES

  • exclude is no longer relative to routesFolder.src but to the cwd. like other paths. Note this is technically a fix that should simplify your configuration.

0.6.4 (2023-05-09)

Bug Fixes

  • expose types for bundler module resolution (#162) (82e2577)

Features

0.6.3 (2023-05-02)

Bug Fixes

  • handle empty regexp in raw routes (9bea452)

0.6.2 (2023-05-01)

Bug Fixes

0.6.1 (2023-05-01)

Bug Fixes

  • types: correct exports in new files (e9056f7)

0.6.0 (2023-05-01)

Bug Fixes

  • allow suffix after param [id]_s (f0fcc07)
  • handle raw segments in EditableTreeNode (5695522)

Features

  • allow inserting raw routes in the editable tree node (c04d068)
  • dotNesting option to disable dot special handling in filenames (d803831)
  • types: expose RouterLinkProps typed (04031b4)

0.5.5 (2023-04-18)

Bug Fixes

  • no missing imports (65f8c83)
  • remove old option (7368185)
  • split types from index to avoid types pollution (4026948), closes #136
  • types: skip postbuild fix on types (d54a9b7)

Features

  • add children to EditableTreeNode (2eef836)
  • expose default options (47b4aed)

0.5.4 (2023-03-02)

Features

  • allow exclude per folder (468b251)

0.5.3 (2023-03-02)

  • feat!: rename filePattern to filePatterns and allow arrays (8902778)

BREAKING CHANGES

  • filePattern is now named filePatterns because it allows arrays. This is only a naming change.

0.5.2 (2023-03-02)

Features

  • allow overriding the file pattern (96febf1)

0.5.1 (2023-03-01)

Features

  • allow extending the type of definePage() (4d663b1)
  • export EditableTreeNode (b5745e1)

0.5.0 (2023-02-16)

  • feat!: allow set operations on meta (a84d659)

Features

  • types: improve routeBlockLang (19bd892)

BREAKING CHANGES

  • if you were setting directly route.meta within extendRoute(), you know need to use route.addToMeta() instead to have the same merging behavior. Directly setting route.meta now replaces the meta property completely.

0.4.1 (2023-02-16)

Bug Fixes

  • webpack: handle loadInclude (9a43b63)

0.4.0 (2023-02-16)

Bug Fixes

  • handle insertions with leading slash in extendRoute (d1287b8)

  • feat!: rename EditableTreeNode files to components (5c359c9)

Features

  • add internal name in virtual files as comments (326156d)
  • allow changing the path in extendRoute (a9d0c77)

BREAKING CHANGES

  • the property files in EditableTreeNode (e.g. within extendRoute) is now named components to match the route record name.

0.3.3 (2023-02-15)

🙌 This version introduces the ability to extend the routes with the extendRoutes option. Please refer to the relevant issue for use cases and share any problems you might have.

Bug Fixes

Features

0.3.2 (2023-01-09)

Bug Fixes

0.3.1 (2023-01-08)

Bug Fixes

  • parse non modules with definePage (ce70048), closes #114
  • stricter extension check (f5f508a)
  • work with files named definePage (178107b)

Features

0.3.0 (2023-01-03)

Bug Fixes

  • build: remove DEV (a50b713)
  • read name and path from definePage (dffcc61), closes #74

Features

0.2.3 (2022-10-05)

Bug Fixes

0.2.2 (2022-09-30)

Bug Fixes

  • types: for auto import (49ffe81)
  • types: remove trailing slash in path for nested routes (f0cfb36), closes #70

Features

0.2.1 (2022-08-27)

Bug Fixes

0.2.0 (2022-08-26)

Introducing Experimental Data fetching

Refer to https://github.com/posva/unplugin-vue-router/tree/main/src/data-fetching for up to date information on how to use the data fetching.

Bug Fixes

Features

  • add setupNavigationGuard options (0656e35)
  • explicitly allow for the data fetching guard (5f672b2)
  • importMode option (9aa2e33), closes #47
  • one single auto import (c82e964)
  • parse definePage (b2470a6)
  • support props to route blocks (073c29c), closes #49

0.1.2 (2022-08-10)

Features

0.1.1 (2022-08-09)

Bug Fixes

  • types: declaration of auto module (e5ac67c)

0.1.0 (2022-08-09)

Bug Fixes

  • deep merge meta properties (47bce4f)
  • expose options subpath (#42) (b44c32e)
  • handle nested loaders that were already called (6887fb2)
  • reload the page during dev when no cache entry is available (918bfd0)
  • support older browsers with object.assign (66c7ae0)
  • trigger loaders only once when nested (4a13819)

Code Refactoring

  • rename [@vue-router](https://github.com/vue-router) to vue-router/auto (461530a)

Features

  • add basic data loaders (9c19fd2)
  • add lazy loaders (815f875)
  • add pendingLoad (055bc3c)
  • allow enabling experimental data fetching (1b7e6b3)
  • change default route component folder to src/pages (6d6cb13)
  • implement nested sequential loaders (6d5201f)
  • track hash reads (e5583a4)

BREAKING CHANGES

  • the module name is now vue-router/auto instead of @vue-router. To upgrade to this version you only need to replace it:

    -import { ... } from '@vue-router'
    +import { ... } from 'vue-router/auto'
    
    -import { ... } from '@vue-router/routes'
    +import { ... } from 'vue-router/auto/routes'

    This allows stubbing the package in vue-router to hint the user towards this plugin.

  • the default value of routesFolder is changed from src/routes to src/pages. If you didn't change this setting, you will have to either:

    • rename your src/routes folder to src/pages
    • add routesFolder: 'src/routes' to the options of the plugin in your vite, webpack, etc config

0.0.21 (2022-07-12)

Features

0.0.20 (2022-07-07)

Bug Fixes

  • correct arg for useLink (afdf147)

0.0.19 (2022-07-07)

Bug Fixes

0.0.18 (2022-07-07)

Bug Fixes

Features

  • types: expose some useful route location types (86b1d01)
  • types: typed useLink() (55bf04e)

0.0.17 (2022-07-06)

Features

0.0.16 (2022-07-06)

Bug Fixes

0.0.15 (2022-07-05)

Bug Fixes

Features

0.0.14 (2022-07-05)

Features

  • handle updates of routes (1a9a028)

0.0.13 (2022-07-05)

Bug Fixes

  • build: externalize vue compiler (7ef277b)
  • use route block in nested routes (bdf4170), closes #17

0.0.12 (2022-07-04)

Bug Fixes

  • options: make all options optional (9a573dd), closes #13

Features

0.0.11 (2022-07-04)

Adapt peer vue router per dep to 4.1.0.

0.0.10 (2022-07-04)

Features

  • add route json schema (c5480e1)
  • parse route custom block (963d1ca)
  • vite: reload when routes change (0231679)

0.0.9 (2022-07-01)

Bug Fixes

  • keep tree nodes until all children are removed (e254d15)
  • stable order of paths (59d743a)

0.0.8 (2022-06-29)

Bug Fixes

  • correctly extendRoutes (e8d22a2)
  • handle static unnested paths (56b73d7)
  • stable order of paths (59d743a)

0.0.7 (2022-06-28)

Bug Fixes

Features

  • allow extending routes with extendRoutes (da4db97)
  • keep one component if possible (efe20e2)
  • named view support (#6) (a46dcd2)

0.0.6 (2022-06-27)

  • small fixes

0.0.5 (2022-06-27)

Features

0.0.4 (2022-06-24)

Bug Fixes

0.0.3 (2022-06-24)

Bug Fixes

0.0.1 (2022-06-24)

Features