Upgrade Guide: Pinecone Router 6.x to 7.x
April 11, 2025 · View on GitHub
For a more detailed list of changes and also additions which aren't covered here, see CHANGELOG
$router Changes
$routernow provides the PineconeRouter object instead of the Context object- Use
$router.contextto access the context. See the above links for the appropriate types.
- Use
- Use new
$paramsmagic helper instead of$router.params - Replace
$router.routewith$router.context.route - Replace
redirect()method:$router.redirect()→$router.navigate()
- Removed
Context.queryandContext.hash, access them directly withwindow.location.search/window.location.hash
Navigation Stack -> Navigation History
See docs: Navigation History
- Use new
$historymagic helper for history navigation$history.back()\$history.canGoBack()$history.forward()\$history.canGoForward()
- Use
PineconeRouter.historyto access from JS.
Handler Changes
See docs: x-handler
- Replace
context.redirect()withthis.$router.navigate() - Handlers must use provided context parameter - global context (ie. $router.context) isn't updated until handlers finish.
context.navigate,context.redirectand other functions were all removed from the Context object.- Use instead
this.$router.navigate()inside handlers to redirect.
- Use instead
- Handlers now receive a second argument
AbortController.
Template Changes
See docs: x-template
- Must add an empty
x-templatedirective for inline templates - Templates now support multiple root elements and multiple scripts
Event Renames
- Update event listeners:
pinecone-start→pinecone:startpinecone-end→pinecone:endfetch-error→pinecone:fetch-error
Settings
See docs: Settings
PineconeRouter.Settings is now a function.
To configure:
PineconeRouter.settings({
basePath: '/app',
targetID: 'app',
})
To read:
PineconeRouter.settings().basePath
Renames
Settings.templateTargetId→Settings.targetIDSettings.interceptLinks→Settings.handleClicks
Removed
Settings.alwaysSendLoadingEventswas removed, it is now default behavior.