From e334b5026fbed327542b595b5ab0ae09f6d8d259 Mon Sep 17 00:00:00 2001 From: Pat Cavit Date: Mon, 12 Sep 2016 11:03:44 -0700 Subject: [PATCH] Combine duplicate sections --- docs/v1.x-migration.md | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/docs/v1.x-migration.md b/docs/v1.x-migration.md index 2ced0f0a..e433748e 100644 --- a/docs/v1.x-migration.md +++ b/docs/v1.x-migration.md @@ -9,11 +9,10 @@ - [Component arguments](#component-arguments) - [Passing components to `m()`](#passing-components-to-m) - [Passing vnodes to `m.mount()` and `m.route()`](#passing-vnodes-to-mmount-and-mroute) -- [`m.route` mode](#mroute-mode) +- [`m.route.mode`](#mroutemode) - [`m.route` and anchor tags](#mroute-and-anchor-tags) - [Reading/writing the current route](#readingwriting-the-current-route) - [Accessing route params](#accessing-route-params) -- [Setting route prefix](#setting-route-prefix) - [m.request](#mrequest) ## `m.component` removed @@ -226,9 +225,23 @@ m.route(element, '/', { }) ``` -## `m.route` mode +## `m.route.mode` -`m.route.mode` was replaced by `m.route.prefix(prefix)` where `prefix` can be `#`, `?`, or an empty string (for "pathname" mode). The new API also supports hashbang (`#!`), which is the default, and it supports non-root pathnames and arbitrary mode variations such as querybang (`?!`) +In `v0.2.x` the routing mode could be set by assigning a string of `"pathname"`, `"hash"`, or `"search"` to `m.route.mode`. In `v.1.x` it is replaced by `m.route.prefix(prefix)` where `prefix` can be `#`, `?`, or an empty string (for "pathname" mode). The new API also supports hashbang (`#!`), which is the default, and it supports non-root pathnames and arbitrary mode variations such as querybang (`?!`) + +### `v0.2.x` + +```js +m.route.mode = "pathname"; +m.route.mode = "search"; +``` + +### `v1.x` + +```js +m.route.prefix(""); +m.route.prefix("?"); +``` ## `m.route()` and anchor tags @@ -309,22 +322,6 @@ m.route(document.body, "/booga", { }); ``` -## Setting route prefix - -In `v0.2.x` the route prefix could be set by assigning a string of `"pathname"`, `"hash"`, or `"search"` to `m.route.mode`. In `v1.x` this has been replaced by `m.route.prefix` which is a setter function. Passing it an empty string is analogous to using pathname mode. Other options include passing `"#"` for hash and `"?"` for search. - -### `v0.2.x` - -```js -m.route.mode = "pathname"; -``` - -### `v1.x` - -```js -m.route.prefix(""); -``` - ## m.request [m.request](request.md) now returns an [m.prop stream](prop.md) instead of a promise. The main difference is you'll have to use `.run` to get similar functionality as a promise's `.then`: