Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider hooks naming #11180

Closed
benmccann opened this issue Dec 2, 2023 · 3 comments
Closed

Consider hooks naming #11180

benmccann opened this issue Dec 2, 2023 · 3 comments
Milestone

Comments

@benmccann
Copy link
Member

benmccann commented Dec 2, 2023

Describe the problem

Our current hooks naming doesn't follow the naming convention of other files

Describe the proposed solution

src/hooks.server.js or src/routes/+hooks.server.js

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

@benmccann benmccann added this to the 2.0 milestone Dec 2, 2023
@Conduitry
Copy link
Member

I'm against this. The other files beginning with a + all appear within src/routes, and their path is significant. hooks.server.js is neither in src/routes nor does its path signify anything. (It also aligns with src/app.html, src/error.html, and src/service-worker.js, all of which live at specific paths, and none of which have a +.)

If we get around to #6731, I think a + prefix makes sense for that file - but not for the single file that doesn't even live inside src/routes.

@benmccann
Copy link
Member Author

Yeah, #6731 is along the lines of what I was thinking. I'd forgotten there was an issue for it, so I'll go ahead and close this.

@benmccann
Copy link
Member Author

It turns out we already renamed hooks.js to hooks.server.js and I'd forgotten that was a change we'd made...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants