Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

Symfony Attributes Are Stable. TypeScript Decorators Aren't.

DEV Community·Gabriel Anhaia·30 days ago
#YzebftdZ
Reading 0:00
15s threshold

Book: PHP to TypeScript Also by me: The TypeScript Library — the 5-book collection My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools Me: xgabriel.com | GitHub Day two on the new TypeScript team. You left Symfony last Friday. You open the new TypeScript repo, scroll to a controller, and expect to see something close to: #[Route('/users/{id}', methods: ['GET'])] public function show ( int $id ): Response { /* ... */ } Enter fullscreen mode Exit fullscreen mode What you find instead is one of three different things, depending on which framework the team picked: // NestJS @ Controller ( ' users ' ) class UsersController { @ Get ( ' :id ' ) show (@ Param ( ' id ' ) id : number ) { /* ... */ } } Enter fullscreen mode Exit fullscreen mode // Hono app . get ( ' /users/:id ' , validate ( IdParam ), async ( c ) => { /* ... */ }); Enter fullscreen mode Exit fullscreen mode // tRPC export const users = router ({ show : publicProcedure . input ( z .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More