Repository navigation
What is the purpose of the .txt files generated for each route? #93201
Replies: 2 comments
|
It used to be called index.rsc but was renamed to .txt , for reasons which aren't given (@styfle?). They started appearing after upgrading to router because of (AFAICT) |
0 replies
|
When App Router renders a page, it outputs HTML files, so that direct navigation to your routes can be properly handled. However, when doing client side transitions, SPA navigations, the router needs information to update the React component tree. That information is stored in these text files. (navigation with next/link or router methods). It is important to be careful, sometimes you might accidentally cache at CDN the txt file. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
I just recently upgraded my pages router to app router, and everything went fairly smooth. However I noticed that for every page, Next also generates a .txt file.
I tried this on a new project:
npx create-next-app@latest
npm run build
And in the out directory, I both see a index.html and index.txt. What is the purpose of these .txt files? I can't see any reference to them.
Additional information
No response
Example
No response
All reactions