Skip to content

Conversation

florian-lefebvre
Copy link
Member

Co-authored-by: Sarah Rainsberger 5098874+sarah11918@users.noreply.github.com

Description (required)

Related issues & labels (optional)

  • Closes #
  • Suggested label:

For Astro version: 6.0. See astro PR #14457.

@florian-lefebvre florian-lefebvre added this to the v6.0.0 docs milestone Sep 30, 2025
Copy link

netlify bot commented Sep 30, 2025

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit 277a9b7
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/68dd52fef8a3060007628a75
😎 Deploy Preview https://deploy-preview-12467--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Sep 30, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/endpoints.mdx Source changed, localizations will be marked as outdated.
en/guides/upgrade-to/v6.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Florian! Left some comments below to see what you think!

florian-lefebvre and others added 3 commits October 1, 2025 16:52
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
@florian-lefebvre
Copy link
Member Author

@sarah11918 just checked the docs and we call these routes "static file endpoints" if that helps!

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugh... pending reviews strike again!

@sarah11918
Copy link
Member

we call these routes "static file endpoints" if that helps!

Actually, I'm not entirely sure we do? I was rereading that page and it looks like we have two separate static / SSR route categories, but... the static one defines what these routes are, and the SSR one only describes extra functionality if the route is rendered on demand? (Though one could easily just jump to the later section for on-demand rendered routes, and not realize that we've explained what these are in the "static" section.) So, probably a case of adding SSR on after the fact and not getting the info hierarchy quite right there, tbh 😅

@florian-lefebvre
Copy link
Member Author

That's how I understood this part:

The .js or .ts extension will be removed during the build process, so the name of the file should include the extension of the data you want to create. For example, src/pages/data.json.ts will build a /data.json endpoint.

@sarah11918
Copy link
Member

Furthermore, I don't think this page shows any examples of an endpoint that does not contain a file extension before the .js/.ts... so a) maybe we should in general? and b) this extra info won't make sense unless we're VERY explicit about which ones cannot have the trailing slash (since we otherwise make no mention of differentiating these endpoints)

@sarah11918
Copy link
Member

sarah11918 commented Oct 1, 2025

The .js or .ts extension will be removed during the build process, so the name of the file should include the extension of the data you want to create. For example, src/pages/data.json.ts will build a /data.json endpoint.

But, I think we mean for this to also be true about the Server Endpoints?

Everything described in the static file endpoints section can also be used in SSR mode... This unlocks new features that are unavailable at build time

And no examples showing anything without an extension?

e.g. we never show how to make something like /api/submit ... is that kind of route only on-demand rendered?

Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
@florian-lefebvre
Copy link
Member Author

NWTWWHB for the win!

we never show how to make something like /api/submit ... is that kind of route only on-demand rendered?

Yeah I don't think there's a case outside of SSR

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, but let's put it in the "breaking changes" category instead of "changed defaults"!

@sarah11918
Copy link
Member

Yeah I don't think there's a case outside of SSR

If so, I do think future works should be to explicitly show an example of that in the on-demand rendered section, but out of scope here!

@florian-lefebvre florian-lefebvre merged commit 7586143 into v6 Oct 1, 2025
9 of 10 checks passed
@florian-lefebvre florian-lefebvre deleted the feat/trailing-slash-never-endpoint-dot branch October 1, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants