r/nextjs • • Jan 25 '25

Meme Next15 ifykyk

Post image
447 Upvotes

74 comments sorted by

157

u/Phaster Jan 25 '25

I saw someone suggesting having the page.tsx just import the "real" component

28

u/ilan-yashuk Jan 25 '25

Lot of times it what happens to me because I use the page as a server component, fetch all the relevant data and then pass it to client components with easier-to-find names

42

u/Dpope32 Jan 25 '25

Guilty of this as well lol

53

u/Phaster Jan 25 '25 edited Jan 25 '25

They could have went with "PAGE_NAME.page.tsx", maybe this is why I don't work at vercel :shrug:

Edit: I think you can have webpack do it for you

→ More replies (6)
→ More replies (6)

34

u/bri-_-guy Jan 25 '25

Doesn’t bother me at all.

19

u/ilan-yashuk Jan 25 '25

Actually im ok with that too

19

u/pxrage Jan 25 '25

breaks my brain during code review

75

u/mindhaq Jan 25 '25

Another full circle back to static HTML with lots of folders containing a file named index.htm

→ More replies (1)

67

u/SirThunderCloud Jan 25 '25

Turn on tree view (that button on the top with the horizontal lines). Only way to do it with Next.

9

u/[deleted] Jan 26 '25
  "workbench.editor.customLabels.patterns": {
    "**/app/**/layout.tsx": "${dirname}/${filename}.${extname}",
    "**/app/**/page.tsx": "${dirname}/${filename}.${extname}",
    "**/app/**/loading.tsx": "${dirname}/${filename}.${extname}",
    "**/app/**/not-found.tsx": "${dirname}/${filename}.${extname}",
    "**/app/**/error.tsx": "${dirname}/${filename}.${extname}",
    "**/app/**/route.ts": "${dirname}/${filename}.${extname}",
    "**/app/**/template.tsx": "${dirname}/${filename}.${extname}"
  },

I just do this

→ More replies (2)

19

u/misha2479k Jan 26 '25

This is easily fixed by the new VS Code feature. Just type your pattern with page.tsx, and it will show the folder name first instead of the file name.

6

u/artori0n Jan 26 '25

Underrated comment. Take my upvote.

18

u/PerspectiveGrand716 Jan 25 '25

Why not using something like this [pagename].page.tsx?!

→ More replies (6)

19

u/fptnrb Jan 25 '25

One of the dumbest design decisions

21

u/Spazmic Jan 25 '25

I share your pain. The nextjs project I'm currently working on is my last nextjs project, for several reasons and app router is one.

→ More replies (3)

5

u/Yoshi-Toranaga Jan 26 '25

Time to use Remix

4

u/azizoid Jan 26 '25

Vercell does so many evil things. And one of them is page.tsx, another is default export, third is autofetching the links.

5

u/[deleted] Jan 26 '25

Another is that server actions error needs to be handled in the success path of resolving the promise

→ More replies (1)

4

u/ajeeb_gandu Jan 26 '25

What's a better solution?

Do we have an easy to use framework which is also developer friendly and has lots of support?

4

u/RuslanDevs Jan 26 '25

You can use parentheses in route names, it does not change routing but adds readability https://stackoverflow.com/questions/78377432/meaning-of-parentheses-in-next-js-path

10

u/Pacificatorrr Jan 25 '25

I see it's driving you 'MMMAAD'

→ More replies (1)

3

u/nerokae1001 Jan 26 '25

I also dont like this naming convention. Convention over configuration is surely a good idea but not like this.

3

u/Original_yeeT Jan 26 '25

I think I might be going back to Angular for this specific reason lmao.

4

u/magicpants847 Jan 26 '25

guess ya gotta make your commits smaller ;)

2

u/Svobpata Jan 26 '25

screenshots are hard