Releases: pinecone-router/router
Releases · pinecone-router/router
4.3.2
4.3.1
4.3.0
4.2.0
[4.2.0] - 2024-01-07
Added
- Support custom target element ID for inline templates:
x-route.target.app
.- This means now inline templates also use global template target id from settings.
- Added an error when trying to use
x-template
on a template element that have a child, meaning trying to mix inline and external templates.- It is impossible to have both as they both put the content inside the template, x-template does after fetching it from a link. (no one tried this afaik but just in case).
Changed
- No longer use the same variable names as
x-if
for showing and hiding inline or external templates:el._x_undoIf
->el._x_PineconeRouter_undoTemplate
el._x_currentIfEl
->el._x_PineconeRouter_CurrentTemplate
- Now
x-route
adds anel._x_PineconeRouter_route
with the full route as its value (including base path in settings)
These changes are just for internal use.
4.1.1
4.1.0
[4.1.0] - 2024-01-06
Fixed
- Fixed template not rendering when preloading another one.
- x-template.target no longer need the target to be cleared manually if the other routes do not use it.
Changed
- Changed template rendering method, borrowed from shaunlee/alpinejs-router.
- Changed link handling method, use preact-router's method instead of page.js
- There should be no difference for you as it's an internal change.
4.0.3
4.0.2
4.0.1
4.0.0
[4.0.0] - 2023-11-27
Added
- Added
x-template
directive replacing the views middleware. - Added events:
pinecone-start
&pinecone-end
that dispatch todocument
on template loading, andfetch-error
on failure. - Added
cleanup()
for when the route element is removed from the page, it now removes the route as well. - Added
cleanup()
forx-handler
andx-template
, now the handlers and tempate are deleted when the attributes are removed. - Added
PineconeRouter.settings.templateTargetId
when set all external templates will use render to this element
Changed
PineconeRouter.currentContext
is nowPineconeRouter.context
- Handlers are now awaited if they're async, so operations such as fetching will prevent rendering templates and execution of subsequent handlers until current handler is done.
- If a link is a clicked to navigate to a new page while there are handlers active, they will be automatically canceled, the current one will finish running but any ones after will not.