You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should support any route like /artist/${name}/ without needing to know all the URLs up front.
Details
With this, I think we would also then be able to implement something akin to Next.js' getStaticPaths API, which could allow users to export a bunch of static content from this dynamic route definition.
exportdefaultArtistDetailsPageextendsHTMLElement{constructor(request){super();this.request=request;}asyncconnectedCallback(){const{ request }=this;constartist=awaitfetch(request).then(resp=>resp.json());const{ name, bio }=artist;this.innerHTML=` <h2>${name}</h2> <p>${bio}</p> `;}}exportconstgetStaticPaths=(async()=>{constendpoint='http://www.myapi.com';constdata=awaitfetch('${endpoint}/artists').then(resp=>resp.json());returndata.map((artist)=>{const{ id, name }=artist;return{request: newRequest(newURL(`${endpoint}/artists?artistId?=${id}`,name: `/artists/${name}/`}}
With this data, Greenwood can invoke the page for as many static versions of the page the user wants using:
request as the "constructor prop" to pass into the page component
name as the output filename, based on filesystem based routing, e.g. pages/artist/[name].js
Effectively this would / could be an alternative and / or complete deprecation of the sources plugin.
The text was updated successfully, but these errors were encountered:
thescientist13
changed the title
Serve side routes should support nested dynamic routes
Server side routes should support nested dynamic routes
Apr 1, 2022
thescientist13
changed the title
Server side routes should support nested dynamic routes
Server side routes should support nested dynamic routes with prerendering
Oct 14, 2023
thescientist13
changed the title
Server side routes should support nested dynamic routes with prerendering
Server side routes should support nested dynamic routes (with prerendering)
Oct 14, 2023
thescientist13
changed the title
Server side routes should support nested dynamic routes (with prerendering)
Server side routes should support dynamic routes (with prerendering)
Apr 9, 2024
thescientist13
changed the title
Server side routes should support dynamic routes (with prerendering)
Server side routes should support dynamic route naming (with prerendering)
Apr 9, 2024
Type of Change
Summary
Should support any route like
/artist/${name}/
without needing to know all the URLs up front.Details
With this, I think we would also then be able to implement something akin to Next.js'
getStaticPaths
API, which could allow users to export a bunch of static content from this dynamic route definition.With this data, Greenwood can invoke the page for as many static versions of the page the user wants using:
request
as the "constructor prop" to pass into the page componentname
as the output filename, based on filesystem based routing, e.g. pages/artist/[name].jsEffectively this would / could be an alternative and / or complete deprecation of the sources plugin.
The text was updated successfully, but these errors were encountered: