Describe the problem
The naming around hooks files is a bit weird:
hooks.server.ts contains server and 'shared' hooks
hooks.client.ts contains client and 'shared' hooks
hooks.ts contains 'universal' hooks
'Shared' doesn't mean shared, it means that the hooks in question (init and handleError) can have two separate implementations for server and client. The 'universal' hooks (reroute and transport) are, however, shared.
Describe the proposed solution
Not for nothing, this is more aesthetically appealing:
hooks.client.ts
hooks.server.ts
hooks.shared.ts
hooks.shared.ts would contain what are today called 'universal' hooks but which are actually shared between server and client.
Docs-wise I would get rid of the 'Server hooks', 'Shared hooks' and 'Universal hooks' headings in favour of the hooks themselves, each of which would have something like this right after the heading:
## handle
> [!NOTE] Declared in `hooks.server.ts`
## init
> [!NOTE] Declared in `hooks.server.ts` and `hooks.client.ts`
## reroute
> [!NOTE] Declared in `hooks.shared.ts`
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
Describe the problem
The naming around hooks files is a bit weird:
hooks.server.tscontains server and 'shared' hookshooks.client.tscontains client and 'shared' hookshooks.tscontains 'universal' hooks'Shared' doesn't mean shared, it means that the hooks in question (
initandhandleError) can have two separate implementations for server and client. The 'universal' hooks (rerouteandtransport) are, however, shared.Describe the proposed solution
Not for nothing, this is more aesthetically appealing:
hooks.shared.tswould contain what are today called 'universal' hooks but which are actually shared between server and client.Docs-wise I would get rid of the 'Server hooks', 'Shared hooks' and 'Universal hooks' headings in favour of the hooks themselves, each of which would have something like this right after the heading:
Alternatives considered
No response
Importance
nice to have
Additional Information
No response