Skip to content

Latest commit

 

History

History
85 lines (53 loc) · 6 KB

changelog.md

File metadata and controls

85 lines (53 loc) · 6 KB

Vue Routisan

Changelog

v3.0.0-beta-5

This is a reversal of the previous beta, however it now uses esbuild, and targets ESM as browsers are capable of running modules. Certain bundlers may do a pass over dependencies, converting them where required.

This release also fixes an issue where using '/' in a nested route would result in pointing to the root. This is a new feature in Vue Router 4. Now, when using '' or '/' in a nested route, Routisan will compile an empty string. Whilst this may counter the feature in Vue Router 4, it does stray away from the purpose of this package, which is to produce routes using a Laravel-like approach, which does not support the feature (which itself is counter-intuitive, in my opionion).

Lastly, this release includes a Vite-powered demo in the demo directory. To play with it, simply clone the repo and spin up the demo app using npm run serve or yarn serve.

v3.0.0-beta.4

The internal build of Vue Routisan has been removed. This has been done for a few reasons:

  1. Most bundlers can compile the code, and would do so with the dist bundle anyway.
  2. Several dependency security issues, and quite a lot of open issues in microbundle. Whilst development is active on that project, it's actually not required.

At a later stage, alternative options will be explored to make sure that Vue Routisan can be used in all environments (Node, Deno, and the browser).

v3.0.0-beta.3

Fixing the missing meta and props fields (#55)

v3.0.0-beta.2

The fallback helper has been removed. See the upgrade guide for more information.

v3.0.0-alpha.1

This is a complete rewrite of Routisan, from the ground up. The aim was to provide a more context-aware and efficient way of building up a route-tree without changing the vast majority of the API, which makes the upgrade process relatively straight-forward.

Note, however, that this rebuild brings Vue routing a little closer to Laravel’s routing syntax and, as such, has a few breaking changes.

Your setup will determine upgrade-complexity, however the upgrade guide will help you out.

So, what's new under the hood?

In v2, Routes were built up using a Route instance-helper and a shared container through an iterative, recursive merging process, building route config on the fly. The v3 approach is quite different, where a Factory delegate is used to build up a tree of routes, which is then recursively compiled to a Vue Router-compatible config and flushed from memory.

Apart from this, here's a list that details everything that's been added, changed, and fixed. Again, there are breaking changes here, so please review the below and the upgrade guide.

Added

  • Routing:

    • Name-cascading, which allows names to cascade or funnel down from route to route.
    • Names are joined together using the separator specified in Factory.withNameSeparator(string), which defaults to a period (.).
  • Semantics and Utilities:

    • Helper functions for view, redirect, group were added, in the case you don't want to use Route everywhere.
    • A fallback option was added to Route, along with the corresponding helper function.
    • Route parameters may now be declared using {curly braces} in addition to :colons.
    • Additionally, if two parameters are {joined}{together}, they will be separated by a slash (/).
    • The {all} paramater, which translates to (.*), was added.
    • The (number) and (string) constraint-aliases, which translate to (\\d+) and (\\w+) respectively, were added.
    • For debugging, you can call Route.dump() to see all compiled routes in the console. Factory.dump() is also available and shows what the routes look like before compilation. Note, though, that internal variable names are mangled by Terser, so you'll need to figure out your way around the tree structure.

Changed

  • Views and Resolvers:

    • View resolvers are now set on the Factory with the usingResolver method.
    • Named views are now passed in as additional views, the third argument to view.
    • Likewise, the second argument to view no longer compiles down to component, but rather components.default, which is what Vue Router does with RouteRecord.component.
  • Guards:

    • The v2 vue-router-multiguard setup has been replaced with a Promise-based class system. Amoung other benefits, this change affords guards the ability to run an optional callback on navigation-rejection, the return value of which will be passed to next. All guards must extend the Guard class and implement the handle(resolve, reject, [context]) method.
    • Guards must registered through the Factory, using the withGuards method. They are then used in route definitions by name, which may or may not be aliased when registered.
    • When rejecting navigation, Routisan will detect rejection loops and warn you when it finds them.
    • When applying multiple guards to a route, an array is no longer required – simply add each guard as an argument to the guard method.
    • Useful for debugging, guards may log the outcome of their inner promises by declaring a method that returns a boolean, called logPromiseOutcomes.
  • Internal:

    • Builds are now performed by microbundle using the CJS, UMD, ESM and modern output formats, compressed with Terser.

Fixed

These are not fixes, technically. Rather, they are existing issues that the rewrite solves.

  • Any issues pertaining to route concatenation are gone.
  • Groups and children now play nicely together.

Removed

  • To reduce duplication issues, the Route.options method is no longer required and has been removed. You should use the corresponding route-builder methods instead.