frontend
Frontend rules and React Router conventions. Use when working with frontend-related tasks.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Frontend rules and React Router conventions. Use when working with frontend-related tasks.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Run, write, and troubleshoot Japa browser tests that use Playwright; use when you add or change frontend functionality that should be covered by tests
Writing documentation. Use when key functionality is added or changed
Caching with @adonisjs/cache (keys, tags, invalidation). Use when adding or debugging cache behavior.
Lucid models/migrations conventions and safe workflows. Use when changing schema or models.
Background job conventions (BullMQ via @rlanz/bull-queue). Use when adding or editing jobs.
AdonisJS service patterns (creation, registration, components). Use when adding or modifying services.
استنادا إلى تصنيف SOC المهني
| name | frontend |
| description | Frontend rules and React Router conventions. Use when working with frontend-related tasks. |
boolean && <Component /> pattern inside components, use composition instead.useLoaderData<typeof loader> hook in components over passing propskiliman/remix-flat-routes when organizing the UI<Link to={href("/products/:id", { id: "abc123" })} />#web/ for imports
"#web/*": "./resources/react_app/*.js"react-router.json/defer are now deprecated, there's no need to wrap return objects/promises in these../+types/<route-name>.js (done with parallel tsconfig rootDirs).const env = await make('env')const user = http.auth.getUserOrFail()
context object you find the AdonisJS http context and the AdonisJS IoC container. This is the primary way the React Router app communicates with the backend.(props: { id: string })
useFetcher() hook and its fetcher.Form component when connecting to internal react-router routesintent which is the key for the intent validation, along with an object corresponding to the other input elements. The vine validator is then used like so:const actionValidator = intentValidation({
login: {
email: vine.string().email().toLowerCase(),
},
})
const r = await http.request.validateUsing(actionValidator)
if (r.intent === 'login') {
// here the type will be narrowed to the login shape and `email` will be available
}
#web/* - Points to ./resources/remix_app/* (defined in tsconfig.json)#web/components - Used for shadcn components and utilities
import { cn } from "#web/lib/utils"@kiliman/remix-flat-routes to organize our routes.We use the hybrid routes approach with the + suffix for directories:
section+/ for directories that should be treated as flat files
api+/endpoint.tsx → /api/endpointapi+/_index.tsx -> /api+: _route.tsx becomes the route, for example api/_route.tsx -> /apiapi+/endpoint.tsx → /api/endpoint_auth+/route.tsx -> /routeresources+/$resourceId.tsx → /resources/:resourceIdthumbnails+/$videoId[.jpg].tsx → /thumbnails/:videoId.jpg_auth+/admin+/settings.tsx → /admin/settingsendpoint+/_layout.tsx -> Creates a layout for any other paths inside the endpoint+ folder. Render children with <Outlet />+ suffix_ prefix for layout routes that shouldn't create URL segments[] to denote routes that serve non-HTML resources+types are autogenerated for routes by react-router and will always be relative to the current file and end with a .js extension: ./+types/<filename>.js.npx react-router typegen to regenerate them
import { Route } from './+types/<file_name>.js' and used like this:export async function loader({ context }: Route.LoaderArgs) {
const { http, make } = context
const service = await make('my-service')
}
.react-router at the project root.