-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[feat] beforeNavigate and afterNavigate lifecycle functions
#3293
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
Merged
Merged
Changes from all commits
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
7496981
feature/add-onBeforeNavigate-listner
pavelbelyaev98 3598ff0
minor fixes
pavelbelyaev98 d5e665b
naming
pavelbelyaev98 83e145b
minor naming changs
pavelbelyaev98 667ae97
minor improvements
pavelbelyaev98 a6cba14
implement requested changes
pavelbelyaev98 e8fff7f
add newline
pavelbelyaev98 a521968
newline fix
pavelbelyaev98 c19f3cd
docs fixes
pavelbelyaev98 73f8d2b
docs fixes #2
pavelbelyaev98 32f305e
docs fixes #2
pavelbelyaev98 c0a409b
docs spacing
pavelbelyaev98 4d54105
minor docs fix
pavelbelyaev98 9014c14
speeling fix
pavelbelyaev98 a2e46ef
remove if(browser) check
pavelbelyaev98 dc3773d
types
pavelbelyaev98 7c9def1
snake_case
pavelbelyaev98 6055ae7
snake case #2
pavelbelyaev98 0c53d10
naming
pavelbelyaev98 6c909d4
Update documentation/docs/05-modules.md
pavelbelyaev98 3864e40
Update pnpm-lock.yaml
pavelbelyaev98 e4c56e1
Merge branch 'sveltejs:master' into master
pavelbelyaev98 4d71414
add onNavigate method
pavelbelyaev98 714aad1
Merge branch 'sveltejs:master' into master
pavelbelyaev98 6ec847a
Merge branch 'sveltejs:master' into master
pavelbelyaev98 79e35d6
Merge branch 'sveltejs:master' into master
pavelbelyaev98 4d7c34f
Update packages/kit/src/runtime/client/router.js
pavelbelyaev98 406d43a
Update packages/kit/test/test.js
pavelbelyaev98 a795d78
minor naming and types improvements
pavelbelyaev98 0e168e0
add docs
pavelbelyaev98 d949133
mroe docs fixes
pavelbelyaev98 41c2c56
snake case
pavelbelyaev98 42f280d
improve back/forwar browser handling
pavelbelyaev98 15f97ba
improve sveltekit:index
pavelbelyaev98 a0f3b2f
remove custom event, add callbacks.
pavelbelyaev98 9da5934
typo fix
pavelbelyaev98 eafddd4
docs
pavelbelyaev98 0709fad
remove logs
pavelbelyaev98 34cc46e
namig
pavelbelyaev98 35af505
Merge branch 'sveltejs:master' into master
pavelbelyaev98 da3ad4b
Update packages/kit/src/runtime/client/router.js
pavelbelyaev98 7a63543
fixes
pavelbelyaev98 9f78e51
improve types
pavelbelyaev98 460bb3a
nicer format
pavelbelyaev98 90d7689
Added second parameter to `goto` function in tests
PatrickG 0bfa83c
Fixed `history.state` when fixing trailing slash
PatrickG e5c2056
Added tests for `onBeforeNavigate`
PatrickG 37cf894
Merge pull request #1 from PatrickG/master
pavelbelyaev98 efb271f
lints
pavelbelyaev98 2ff3e9b
Merge branch 'sveltejs:master' into master
pavelbelyaev98 bee8487
add more tests
pavelbelyaev98 e679bb4
Merge branch 'sveltejs:master' into master
pavelbelyaev98 4a9a355
Merge branch 'sveltejs:master' into master
pavelbelyaev98 c86cac6
Merge branch 'sveltejs:master' into master
pavelbelyaev98 656e7de
reafactor
pavelbelyaev98 a8be2d6
fix if statement
pavelbelyaev98 eea4279
fix if statement 2
pavelbelyaev98 d482e87
merge master -> zommerberg/master
Rich-Harris bcfcef3
remove unused files
Rich-Harris d039816
fix test
Rich-Harris 93e548d
patch changeset
ignatiusmb a45457d
rename to beforeNavigate/afterNavigate
Rich-Harris c8909f9
Merge branch 'on-navigate' of github.com:sveltejs/kit into on-navigate
Rich-Harris f075928
typo
Rich-Harris ff6c578
make beforeNavigate callbacks synchronous
Rich-Harris 8033edc
merge master -> on-navigate
Rich-Harris f49d2a4
rename internal functions
Rich-Harris 6eff260
make _navigate take non-position arguments. bit clearer
Rich-Harris 8696c4e
remove sveltekit:index tests - this is non-user-facing implementation…
Rich-Harris 998b5f2
typo
Rich-Harris d7fbc8a
remove more sveltekit:index stuff
Rich-Harris 000c0d1
separate out beforeNavigate tests
Rich-Harris 7d2ea34
simplify tests
Rich-Harris 4ad899f
rename tests
Rich-Harris 720cc22
handle no-router case
Rich-Harris 8c122ed
simplify some stuff
Rich-Harris 8234ce2
only pass scroll/keepfocus to renderer
Rich-Harris fd92318
focus beforeNavigate tests
Rich-Harris d73a87f
manage history index inside _navigate
Rich-Harris 045d12d
neaten up
Rich-Harris 7c67a17
allow _navigate to handle external links; centralise logic
Rich-Harris 069627b
pass { from, to, cancel } to beforeNavigate callbacks
Rich-Harris 07bd649
lint
Rich-Harris 1768573
block unload if appropriate
Rich-Harris dba49b8
make goto work with external urls
Rich-Harris c58b06c
unfocus tests
Rich-Harris 1995470
typechecking
Rich-Harris 70810b3
no longer needs to be async
Rich-Harris 23a6e89
update docs
Rich-Harris 652ceea
call afterNavigate callbacks on page load
Rich-Harris 716c95e
typechecking
Rich-Harris c3948aa
Update documentation/docs/05-modules.md
Rich-Harris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@sveltejs/kit': patch | ||
| --- | ||
|
|
||
| Adds beforeNavigate/afterNavigate lifecycle functions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this
async