-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[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
zommerberg 3598ff0
minor fixes
zommerberg d5e665b
naming
zommerberg 83e145b
minor naming changs
zommerberg 667ae97
minor improvements
zommerberg a6cba14
implement requested changes
zommerberg e8fff7f
add newline
zommerberg a521968
newline fix
zommerberg c19f3cd
docs fixes
zommerberg 73f8d2b
docs fixes #2
zommerberg 32f305e
docs fixes #2
zommerberg c0a409b
docs spacing
zommerberg 4d54105
minor docs fix
zommerberg 9014c14
speeling fix
zommerberg a2e46ef
remove if(browser) check
zommerberg dc3773d
types
zommerberg 7c9def1
snake_case
zommerberg 6055ae7
snake case #2
zommerberg 0c53d10
naming
zommerberg 6c909d4
Update documentation/docs/05-modules.md
zommerberg 3864e40
Update pnpm-lock.yaml
zommerberg e4c56e1
Merge branch 'sveltejs:master' into master
zommerberg 4d71414
add onNavigate method
zommerberg 714aad1
Merge branch 'sveltejs:master' into master
zommerberg 6ec847a
Merge branch 'sveltejs:master' into master
zommerberg 79e35d6
Merge branch 'sveltejs:master' into master
zommerberg 4d7c34f
Update packages/kit/src/runtime/client/router.js
zommerberg 406d43a
Update packages/kit/test/test.js
zommerberg a795d78
minor naming and types improvements
zommerberg 0e168e0
add docs
zommerberg d949133
mroe docs fixes
zommerberg 41c2c56
snake case
zommerberg 42f280d
improve back/forwar browser handling
zommerberg 15f97ba
improve sveltekit:index
zommerberg a0f3b2f
remove custom event, add callbacks.
zommerberg 9da5934
typo fix
zommerberg eafddd4
docs
zommerberg 0709fad
remove logs
zommerberg 34cc46e
namig
zommerberg 35af505
Merge branch 'sveltejs:master' into master
zommerberg da3ad4b
Update packages/kit/src/runtime/client/router.js
zommerberg 7a63543
fixes
zommerberg 9f78e51
improve types
zommerberg 460bb3a
nicer format
zommerberg 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
zommerberg efb271f
lints
zommerberg 2ff3e9b
Merge branch 'sveltejs:master' into master
zommerberg bee8487
add more tests
zommerberg e679bb4
Merge branch 'sveltejs:master' into master
zommerberg 4a9a355
Merge branch 'sveltejs:master' into master
zommerberg c86cac6
Merge branch 'sveltejs:master' into master
zommerberg 656e7de
reafactor
zommerberg a8be2d6
fix if statement
zommerberg eea4279
fix if statement 2
zommerberg 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