Skip to content

Conversation

@kobejean
Copy link

I think to get the params to work from alternateRoutes the params will have to be constructed inside alternates.forEach((segments) => {...}). As it stands now the params are still being constructed using pre-alternateRoutes segments. I tried this out locally and it works beautifully.

@pzerelles pzerelles merged commit 84aff3d into pzerelles:alternate-routes Apr 27, 2021
@pzerelles
Copy link
Owner

pzerelles commented Apr 27, 2021

Of course, you are right. I just quickly tried to add it this morning but overlooked that segments is the untranslated array. Thanks for the fix!

pzerelles pushed a commit that referenced this pull request Jan 19, 2022
…tejs#3293)

* feature/add-onBeforeNavigate-listner

* minor fixes

* naming

* minor naming changs

* minor improvements

* implement requested changes

* add newline

* newline fix

* docs fixes

* docs fixes #2

* docs fixes #2

* docs spacing

* minor docs fix

* speeling fix

* remove if(browser) check

* types

* snake_case

* snake case #2

* naming

* Update documentation/docs/05-modules.md

Co-authored-by: Ben McCann <[email protected]>

* Update pnpm-lock.yaml

* add onNavigate method

* Update packages/kit/src/runtime/client/router.js

Co-authored-by: Bjorn Lu <[email protected]>

* Update packages/kit/test/test.js

Co-authored-by: Bjorn Lu <[email protected]>

* minor naming and types improvements

* add docs

* mroe docs fixes

* snake case

* improve back/forwar browser handling

* improve sveltekit:index

* remove custom event, add callbacks.

* typo fix

* docs

* remove logs

* namig

* Update packages/kit/src/runtime/client/router.js

Co-authored-by: Bjorn Lu <[email protected]>

* fixes

* improve types

* nicer format

* Added second parameter to `goto` function in tests

* Fixed `history.state` when fixing trailing slash

* Added tests for `onBeforeNavigate`

* lints

* add more tests

* reafactor

* fix if statement

* fix if statement 2

* remove unused files

* fix test

* patch changeset

* rename to beforeNavigate/afterNavigate

* typo

* make beforeNavigate callbacks synchronous

* rename internal functions

* make _navigate take non-position arguments. bit clearer

* remove sveltekit:index tests - this is non-user-facing implementation detail

* typo

* remove more sveltekit:index stuff

* separate out beforeNavigate tests

* simplify tests

* rename tests

* handle no-router case

* simplify some stuff

* only pass scroll/keepfocus to renderer

* focus beforeNavigate tests

* manage history index inside _navigate

* neaten up

* allow _navigate to handle external links; centralise logic

* pass { from, to, cancel } to beforeNavigate callbacks

* lint

* block unload if appropriate

* make goto work with external urls

* unfocus tests

* typechecking

* no longer needs to be async

* update docs

* call afterNavigate callbacks on page load

* typechecking

* Update documentation/docs/05-modules.md

Co-authored-by: Ben McCann <[email protected]>

Co-authored-by: pavelBelyaev98 <[email protected]>
Co-authored-by: Pavel Belyaev <[email protected]>
Co-authored-by: Ben McCann <[email protected]>
Co-authored-by: Bjorn Lu <[email protected]>
Co-authored-by: Patrick <[email protected]>
Co-authored-by: Ignatius Bagus <[email protected]>
pzerelles pushed a commit that referenced this pull request Jan 27, 2022
…s#3473) (sveltejs#3521)

* Add failing test for sveltejs#3473 prerender error body used already

* Fix reading from same response body twice during prerender

* Fix quotes

* Add changeset

* Fix casing for internal variables

* Revert change of cloning response as bug was actually in prerender.js

* Avoid reading response body twice

* Revert "Avoid reading response body twice"

This reverts commit cecf7dd.

Revert being stupid #1

* Revert "Revert change of cloning response as bug was actually in prerender.js"

This reverts commit 5e5f30b.

Revert being stupid #2

* store buffered depenedency bodies for prerendering

* failing test for non-buffered endpoint data

* use buffered body if available, otherwise buffer

Co-authored-by: Rich Harris <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants