### Run Development Environment and Install Dependencies (Bash) Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/CONTRIBUTING.md This snippet demonstrates how to start the development environment using Docker Compose, install backend dependencies with Composer, and install frontend dependencies with Bun. It also includes the command to run quality checks. ```bash docker compose --profile dev up -d cd backend && composer install cd frontend && bun install make quality # Must pass before opening a PR ``` -------------------------------- ### Inflate Initialization and Buffer Setup Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html Initializes the decompression context, including the allocation of the sliding window buffer and reset functionality for the state machine. ```javascript function _A(l,u){const c=this;let f=bl,r=0,o=0,h=0,v;const y=[0],A=[0],E=new WA;let S=0,O=new Int32Array(L2*3);const X=0,B=new Wf;c.bitk=0,c.bitb=0,c.win=new Uint8Array(u),c.end=u,c.read=0,c.write=0,c.reset=function(b,p){p&&(p[0]=X),f==tc&&E.free(b),f=bl,c.bitk=0,c.bitb=0,c.read=c.write=0},c.reset(l,null),c.inflate_flush=function(b,p){let x,R,U;return} ``` -------------------------------- ### Project Initialization and Quality Checks Source: https://context7.com/tony-stark-eth/template-symfony-sveltekit/llms.txt Commands to clone the template, start the Docker development environment, and execute quality assurance tools like ECS, PHPStan, and PHPUnit. ```bash gh repo create my-project --template tony-stark-eth/template-symfony-sveltekit --private cd my-project docker compose --profile dev up -d curl http://localhost/api/v1/health docker compose exec php vendor/bin/ecs check docker compose exec php vendor/bin/phpstan analyse docker compose exec php vendor/bin/phpunit ``` -------------------------------- ### GET /api/v1/health/ready Source: https://context7.com/tony-stark-eth/template-symfony-sveltekit/llms.txt Verifies database connectivity for infrastructure readiness probes. ```APIDOC ## GET /api/v1/health/ready ### Description Verifies database connectivity. Returns HTTP 200 when the database is accessible, or HTTP 503 when unavailable. Use this for Kubernetes readiness probes. ### Method GET ### Endpoint /api/v1/health/ready ### Response #### Success Response (200) - **status** (string) - "ok" - **timestamp** (string) - ISO 8601 formatted timestamp #### Error Response (503) - **status** (string) - "error" - **message** (string) - "Database unavailable" #### Response Example { "status": "ok", "timestamp": "2026-03-21T10:30:00+00:00" } ``` -------------------------------- ### React useContext Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useContext` hook allows components to subscribe to context changes. It accepts a Context object and returns the current context value for that context. This example shows how context is read. ```javascript function ne(t) { return t.value } ``` -------------------------------- ### React useState Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useState` hook allows functional components to manage local state. It returns an array with the current state value and a function to update it. This example demonstrates basic state management. ```javascript function useState(t) { t = ps(t); var e = t.queue, n = R0.bind(null, mt, e); return e.dispatch = n, [t.memoizedState, n] } ``` -------------------------------- ### Frontend API Client Usage Source: https://context7.com/tony-stark-eth/template-symfony-sveltekit/llms.txt Demonstrates the use of the type-safe TypeScript API client to perform GET, POST, PUT, and DELETE requests. Includes examples of error handling and JWT token management. ```typescript import { client, clearTokens, ApiRequestError } from '$lib/api/client'; const health = await client.get<{status: string, timestamp: string}>('/health'); const auth = await client.post<{token: string, refresh_token: string}>('/auth/login', { email: 'user@example.com', password: 'secret123' }); await client.put('/users/me', { name: 'New Name' }); await client.delete('/users/me/sessions/123'); try { await client.get('/protected-resource'); } catch (error) { if (error instanceof ApiRequestError) { console.error(`API Error ${error.status}: ${error.message}`); } } ``` -------------------------------- ### React useHostTransitionStatus Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useHostTransitionStatus` hook provides information about the current transition status of the host environment. This can be used to adapt UI behavior based on ongoing transitions. ```javascript function Os() { return ne(gi) } ``` -------------------------------- ### React useEffect Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useEffect` hook enables performing side effects in function components. It runs after every render by default, but can be configured to run only on specific updates using a dependency array. This example shows its basic structure. ```javascript function m0(t, e) { return Au(4, 2, t, e) } ``` -------------------------------- ### React useMemo Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useMemo` hook returns a memoized value. It only recalculates the memoized value when one of the dependencies has changed. This is useful for expensive calculations. ```javascript function b0(t, e) { var n = fe(); e = e === void 0 ? null : e; var a = t(); if (Ca) { Dn(!0); try { t() } finally { Dn(!1) } } return n.memoizedState = [a, e], a } ``` -------------------------------- ### React useTransition Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useTransition` hook provides a way to mark certain state updates as transitions. Transitions allow you to keep your UI responsive by deferring less important updates. ```javascript function S0(t, e, n, a) { var i = ps(!1); return i = S0.bind(null, t, i.queue, !0, !1), fe().memoizedState = i, [!1, i] } ``` -------------------------------- ### Docker Compose Management Commands Source: https://context7.com/tony-stark-eth/template-symfony-sveltekit/llms.txt Essential commands for managing the Docker Compose environment. These include starting and stopping services, viewing logs, and accessing the PHP container via a shell. The '--profile dev' flag is used to activate the development-specific services. ```bash # Start development environment docker compose --profile dev up -d # View logs docker compose logs -f php # Shell into PHP container docker compose exec php sh # Stop all services docker compose --profile dev down ``` -------------------------------- ### React useFormState Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useFormState` hook is designed for managing form state and actions. It simplifies handling form submissions, errors, and pending states. ```javascript function f0(t, e) { var n = fe(); n.memoizedState = n.baseState = t; var a = { pending: null, lanes: 0, dispatch: null, lastRenderedReducer: null, lastRenderedState: t }; return n.queue = a, t = ws.bind(null, mt, !0, a), a.dispatch = t, [t, e] } ``` -------------------------------- ### React useLayoutEffect Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useLayoutEffect` hook is functionally identical to `useEffect`, but it fires synchronously after all DOM mutations. Use this to read layout from the DOM and synchronously re-render. ```javascript function v0(t, e) { return Au(4194308, 4, t, e) } ``` -------------------------------- ### React useInsertionEffect Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useInsertionEffect` hook is for CSS-in-JS libraries to inject styles into the DOM. It fires synchronously before all DOM mutations. ```javascript function A0(t, e) { Au(4, 2, t, e) } ``` -------------------------------- ### React useMemoCache Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useMemoCache` hook is used for memoizing expensive computations within a component, similar to `useMemo`, but potentially with different caching strategies or use cases. ```javascript function vs() { return fe().memoizedState } ``` -------------------------------- ### React useId Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useId` hook is a hook for generating unique IDs that are stable across the server and client. This is useful for accessibility attributes like `aria-labelledby`. ```javascript function xg(t) { var e = fe(); if (bt) { var n = Fe, a = Je; n = (a & ~(1 << 32 - xe(a) - 1)).toString(32) + n, e = "_" + e + "R_" + n, n = du++, 0 < n && (e += "H" + n.toString(32)), e += "_" } else n = xg++, e = "_" + e + "r_" + n.toString(32) + "_"; return e.memoizedState = e, e } ``` -------------------------------- ### React useSyncExternalStore Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useSyncExternalStore` hook is used for integrating with external state management libraries. It subscribes to an external store and ensures that the React component stays in sync with the store's state. ```javascript function t0(t, e, n) { var a = mt, i = fe(); if (bt) { if (n === void 0) throw Error(f(407)); n = n() } else { if (n = e(), jt === null) throw Error(f(349)); (Et & 127) !== 0 || Po(a, e, n) } return i.memoizedState = n, e = { value: n, getSnapshot: e }, i.queue = e, m0(t0.bind(null, a, e, n, t), [t]), a.flags |= 2048, sl(9, { destroy: void 0 }, $o.bind(null, a, e, n, t), null), n } ``` -------------------------------- ### Running Playwright E2E Tests Source: https://context7.com/tony-stark-eth/template-symfony-sveltekit/llms.txt Commands to execute Playwright end-to-end tests. This involves starting the Docker Compose development environment and then running the tests using Bun. The 'test:e2e:ui' command launches Playwright's UI mode for debugging. ```bash # Run E2E tests (requires Docker Compose running) docker compose --profile dev up -d cd frontend && bun run test:e2e # Run with Playwright UI for debugging bun run test:e2e:ui ``` -------------------------------- ### React useOptimistic Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useOptimistic` hook allows you to optimistically update the UI before an asynchronous action completes. It provides a way to render a temporary state that is replaced by the actual result. ```javascript function ws(t, e, n, a) { a = { lane: 2, revertLane: uf(), gesture: null, action: a, hasEagerState: !1, eagerState: null, next: null }, yu(t) ? e && Error(f(479)) : (e = qc(t, n, a, 2), e !== null && ve(e, t, 2)) } ``` -------------------------------- ### React useCallback Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useCallback` hook returns a memoized callback function. This is useful when passing callbacks to optimized child components that rely on reference equality to prevent unnecessary re-renders. ```javascript function p0(t, e) { return fe().memoizedState = [t, e === void 0 ? null : e], t } ``` -------------------------------- ### Makefile Development Shortcuts Source: https://context7.com/tony-stark-eth/template-symfony-sveltekit/llms.txt Common Makefile targets for managing Docker containers, running backend quality checks, and executing test suites. ```makefile make up make down make build make logs make shell make quality make ecs make phpstan make rector make test make infection ``` -------------------------------- ### React useRef Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useRef` hook returns a mutable ref object whose `.current` property is initialized to the passed argument. The returned object will persist for the full lifetime of the component. This example shows its initialization. ```javascript function h0(t) { var e = fe(); return t = { current: t }, e.memoizedState = t, t } ``` -------------------------------- ### Automate Project Tasks with Makefile Source: https://context7.com/tony-stark-eth/template-symfony-sveltekit/llms.txt A collection of Makefile commands to manage frontend dependencies, database migrations, and infrastructure lifecycle using OpenTofu. These commands abstract complex CLI operations into simple, repeatable tasks. ```makefile make frontend-install make frontend-dev make frontend-build make frontend-check make frontend-lint make e2e make e2e-ui make db-migrate make db-diff make db-reset make tofu-init make tofu-plan make tofu-apply ``` -------------------------------- ### React Hook State Initialization Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html This code demonstrates the initialization of state for various hooks, including setting up memoized states, base states, and queues for pending updates. ```javascript function T0(t) { var e = t.memoizedState; if (e !== null) return e; e = { memoizedState: $, baseState: $, baseQueue: null, queue: { pending: null, lanes: 0, dispatch: null, lastRenderedReducer: sn, lastRenderedState: $ }, next: null }; var n = {}; return e.next = { memoizedState: n, baseState: n, baseQueue: null, queue: { pending: null, lanes: 0, dispatch: null, lastRenderedReducer: sn, lastRenderedState: n }, next: null }, t.memoizedState = e, t = t.alternate, t !== null && (t.memoizedState = e), e } ``` -------------------------------- ### GET /api/v1/users/{id} Source: https://context7.com/tony-stark-eth/template-symfony-sveltekit/llms.txt Retrieves a specific user by their ID. ```APIDOC ## GET /api/v1/users/{id} ### Description Retrieves a specific user by their ID. Returns a 404 error if the user is not found. ### Method GET ### Endpoint /api/v1/users/{id} ### Parameters #### Path Parameters - **id** (int) - Required - The unique identifier of the user. ### Response #### Success Response (200) - **id** (int) - The user's unique identifier. - **username** (string) - The user's username. - **email** (string) - The user's email address. #### Error Response (404) - **error** (string) - 'User not found' #### Response Example ```json { "id": 1, "username": "johndoe", "email": "john.doe@example.com" } ``` ``` -------------------------------- ### POST /api/v1/users Source: https://context7.com/tony-stark-eth/template-symfony-sveltekit/llms.txt Creates a new user. ```APIDOC ## POST /api/v1/users ### Description Creates a new user. The user data should be provided in the request body as JSON. ### Method POST ### Endpoint /api/v1/users ### Request Body - **username** (string) - Required - The desired username for the new user. - **email** (string) - Required - The email address for the new user. ### Request Example ```json { "username": "janedoe", "email": "jane.doe@example.com" } ``` ### Response #### Success Response (201) - **id** (int) - The user's unique identifier. - **username** (string) - The user's username. - **email** (string) - The user's email address. #### Response Example ```json { "id": 2, "username": "janedoe", "email": "jane.doe@example.com" } ``` ``` -------------------------------- ### Creating Host Elements Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html This function creates a new host element (e.g., a div, span). It takes the type of the host element, its key, props, and the return pointer. It returns a new element with the appropriate tag and props. ```javascript function tu(t,M,w,Q,q,ut){return t=tu(t,M,w,null,q,ut),t.index=0,t.sibling=null,t} ``` -------------------------------- ### Resource Preloading Utilities Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html Utilities for managing browser resource hints like dns-prefetch, preconnect, and modulepreload. These functions ensure that assets are only injected into the document head once to prevent duplicate requests. ```javascript function f1(t, e, n) { var a = vl; if (a && typeof e == "string" && e) { var i = He(e); i = 'link[rel="' + t + '"][href="' + i + '"]'; typeof n == "string" && (i += '[crossorigin="' + n + '"]'); if (!s1.has(i)) { s1.add(i); var config = { rel: t, crossOrigin: n, href: e }; if (a.querySelector(i) === null) { var el = a.createElement("link"); le(el, "link", config); Wt(el); a.head.appendChild(el); } } } } ``` -------------------------------- ### GET /api/v1/health Source: https://context7.com/tony-stark-eth/template-symfony-sveltekit/llms.txt Returns the current application status and timestamp for uptime monitoring. ```APIDOC ## GET /api/v1/health ### Description Returns the current application status and timestamp. Use this for uptime monitoring and load balancer health checks. ### Method GET ### Endpoint /api/v1/health ### Response #### Success Response (200) - **status** (string) - The current status of the application (e.g., "ok") - **timestamp** (string) - ISO 8601 formatted timestamp #### Response Example { "status": "ok", "timestamp": "2026-03-21T10:30:00+00:00" } ``` -------------------------------- ### Array Slicing Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html Extracts a subarray from a Uint8Array within the specified start and end indices. Used for segmenting data. ```javascript function Xe(l,u,c){ return l.subarray(u,c) } ``` -------------------------------- ### Key Derivation and Initialization Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html Derives cryptographic keys (encryption, authentication, password verification) from a password and salt using PBKDF2. It initializes CTR and HMAC objects for subsequent operations. ```javascript async function K8(l,u,c,f){ const r=await th(l,u,c,Xe(f,0,Ci[u])), o=Xe(f,Ci[u]); if(r[0]!=o[0]||r[1]!=o[1])throw new Error(rr) } async function k8(l,u,c){ const f=W2(new Uint8Array(Ci[u])), r=await th(l,u,c,f); return hr(f,r) } async function th(l,u,c,f){ l.password=null; const r=await J8(U8,c,Y8,!1,L8), o=await F8(Object.assign({salt:f},_f),r,8*(bi[u]*2+2)), h=new Uint8Array(o), v=wi(Pe,Xe(h,0,bi[u])), y=wi(Pe,Xe(h,bi[u],bi[u]*2)), A=Xe(h,bi[u]*2); return Object.assign(l,{keys:{key:v,authentication:y,passwordVerification:A},ctr:new V8(new X8(v),Array.from(G8)),hmac:new Z8(y)}), A } ``` -------------------------------- ### Removing Sibling Nodes Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html This function removes all sibling nodes starting from a given node. It iterates through the siblings and adds them to the parent's deletions list. ```javascript function n(M,w){if(!t)return null;for(;w!==null;)e(M,w),w=w.sibling;return null} ``` -------------------------------- ### React useDebugValue Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useDebugValue` hook can be used to display a label for custom hooks in React DevTools. This is helpful for understanding the state of custom hooks. ```javascript function Ss(t, e) { if (jt.disableDebugValue) return var n = e === void 0 ? '' : e; e = t; t = n; if (jt.componentStack) return n = fe().queue; return n = n !== null ? n.dispatch : null, jt.pushStoreListener(jt.currentFiber, t, e, n) } ``` -------------------------------- ### Manage Theme and UI State in JavaScript Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html Handles theme switching between light, dark, and system modes. It also manages UI state related to window focus and blur events, and initializes theme persistence. Dependencies include `window.matchMedia` and DOM manipulation. ```javascript el:"Light mode",value:"light-mode"},{label:"System",value:"system"}],lm=window.matchMedia("(prefers-color-scheme: dark)");function gv(){document.playwrightThemeInitialized||(document.playwrightThemeInitialized=!0,document.defaultView.addEventListener("focus",l=>{l.target.document.nodeType===Node.DOCUMENT_NODE&&document.body.classList.remove("inactive")},!1),document.defaultView.addEventListener("blur",l=>{document.body.classList.add("inactive")},!1),cr(sr()),lm.addEventListener("change",()=>{cr(sr())}))}const Av=new Set;function cr(l){const u=vv(),c=l==="system"?lm.matches?"dark-mode":"light-mode":l;if(u!==c){u&&document.documentElement.classList.remove(u),document.documentElement.classList.add(c);for(const f of Av)f(c)}}function sr(){return Ma.getString(am,hv)}function vv(){return document.documentElement.classList.contains("dark-mode")?"dark-mode":document.documentElement.classList.contains("light-mode")?"light-mode":null}function yv(){const[l,u]=ue.useState(sr());return ue.useEffect(()=>{Ma.setString(am,l),cr(l)},[l]),[l,u]} ``` -------------------------------- ### Creating Context Elements Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html This function creates a new context element. It takes the context object, mode, and return pointer. It returns a new element with the tag set to 4 (representing a context). ```javascript function kc(t,M,w){return t=kc(t,M,w),t.index=0,t.sibling=null,t} ``` -------------------------------- ### Multi-Disk Reader Implementation Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The 'br' class allows for reading across multiple disk segments as if they were a single contiguous file. It handles offset calculations and recursive reading across reader instances. ```javascript class br extends fa { constructor(u) { super(); this.readers = u; } async readUint8Array(u, c, f = 0) { const r = this, { readers: o } = this; // Logic for spanning reads across multiple readers // ... } } ``` -------------------------------- ### Create User Controller in PHP Source: https://context7.com/tony-stark-eth/template-symfony-sveltekit/llms.txt This PHP code defines a `UserController` using Symfony's framework. It demonstrates constructor injection for `UserRepository` and `SerializerInterface`, and includes methods for retrieving a user by ID and creating a new user via POST requests. It handles JSON serialization and deserialization for user data. ```php userRepository->find($id); if ($user === null) { return new JsonResponse( ['error' => 'User not found'], Response::HTTP_NOT_FOUND, ); } return new JsonResponse( $this->serializer->normalize($user, 'json'), ); } #[Route('/api/v1/users', name: 'user_create', methods: ['POST'])] public function create(Request $request): JsonResponse { /** @var User $user */ $user = $this->serializer->deserialize( $request->getContent(), User::class, 'json', ); $this->userRepository->save($user); return new JsonResponse( $this->serializer->normalize($user, 'json'), Response::HTTP_CREATED, ); } } ``` -------------------------------- ### React useDeferredValue Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useDeferredValue` hook lets you defer updating a part of the UI. This can be used to keep your UI responsive by prioritizing foreground updates over background updates. ```javascript function Ts(t, e, n) { return t.memoizedState = e, t.lanes = 0, t.baseState = e, t.baseQueue = null, t.queue = { pending: null, lanes: 0, dispatch: null, lastRenderedReducer: sn, lastRenderedState: e }, n !== void 0 && (t.dependencies = n), e } ``` -------------------------------- ### Running PHPUnit Tests Source: https://context7.com/tony-stark-eth/template-symfony-sveltekit/llms.txt These bash commands are used to execute PHPUnit tests. They allow running all tests, generating coverage reports, or targeting specific test suites. Ensure you are in the 'backend' directory before running these commands. ```bash # Run all tests cd backend && vendor/bin/phpunit # Run with coverage report vendor/bin/phpunit --testsuite=unit --coverage-html=var/coverage # Run specific test suite vendor/bin/phpunit --testsuite=integration ``` -------------------------------- ### React useCacheRefresh Hook Example Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The `useCacheRefresh` hook provides a function to manually refresh the cache for memoized values. This can be useful when external data changes and the cached result needs to be recomputed. ```javascript function Rg(t) { for (var e = t.return; e !== null;) { switch (e.tag) { case 24: case 3: var n = De(); t = zn(n), a = Yn(e, t, n), a !== null && (ve(a, e, n), kl(a, e, n)), e = { cache: es() }, t.payload = e; return } e = e.return } } ``` -------------------------------- ### Docker Compose Configuration for Development Source: https://context7.com/tony-stark-eth/template-symfony-sveltekit/llms.txt Defines the development services including FrankenPHP, PostgreSQL, PgBouncer, and a Symfony Messenger worker. The frontend Vite server is configured with the 'dev' profile. It specifies build contexts, environment variables, and service dependencies. ```yaml # compose.yaml (excerpt) services: php: build: context: . dockerfile: docker/frankenphp/Dockerfile target: frankenphp_dev volumes: - ./backend:/app environment: - DATABASE_URL=postgresql://app:!ChangeMe!@pgbouncer:5432/app - MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 depends_on: database: condition: service_healthy database: image: postgres:17-alpine environment: POSTGRES_USER: app POSTGRES_PASSWORD: "!ChangeMe!" POSTGRES_DB: app healthcheck: test: ["CMD", "pg_isready", "-U", "app"] interval: 5s pgbouncer: image: edoburu/pgbouncer:latest environment: POOL_MODE: transaction SERVER_RESET_QUERY: "DISCARD ALL" messenger-worker: command: php bin/console messenger:consume async --time-limit=3600 environment: # Direct DB connection for LISTEN/NOTIFY support - DATABASE_URL=postgresql://app:!ChangeMe!@database:5432/app bun: image: oven/bun:1.3-alpine command: bun run dev --host 0.0.0.0 ports: - "5173:5173" profiles: - dev ``` -------------------------------- ### Initialize and Process Zlib Decompression Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html The implementation uses a state-machine approach to handle Zlib streams. It includes methods for initializing the inflate state, processing input buffers, and managing output chunks through a custom G2 prototype. ```javascript function G2(){}G2.prototype={ inflateInit(l){const u=this;return u.istate=new n8,l||(l=YA),u.istate.inflateInit(u,l)}, inflate(l){const u=this;return u.istate?u.istate.inflate(u,l):ye}, inflateEnd(){const l=this;if(!l.istate)return ye;const u=l.istate.inflateEnd(l);return l.istate=null,u}, read_byte(l){return this.next_in[l]}, read_buf(l,u){return this.next_in.subarray(l,l+u)} }; ``` -------------------------------- ### React Element Factory Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html Handles the creation of React elements, including property normalization, key extraction, and children management. ```javascript dt.createElement=function(C,L,W){var et,rt={},ot=null;if(L!=null)for(et in L.key!==void 0&&(ot=""+L.key),L)N.call(L,et)&&et!=="key"&&et!=="__self"&&et!=="__source"&&(rt[et]=L[et]);var gt=arguments.length-2;if(gt===1)rt.children=W;else if(1{const r=f.tag.join(" "),o=new Date(f.startTime).toLocaleTimeString(\[],{hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"});let h=`${r} started at ${o}, runs ${rm(f.duration)}`;return f.shardIndex&&(h+=` (shard ${f.shardIndex})`),{label:r,tooltip:h,startTime:f.startTime,duration:f.duration,shardIndex:f.shardIndex??1}}).sort((f,r)=>f.label.localeCompare(r.label)||f.shardIndex-r.shardIndex);return m.jsx(ke,{header:"Timeline",children:m.jsx($v,{entries:c})})} ``` -------------------------------- ### Creating Memo Elements Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html This function creates a new memo element. It takes the memoized component, mode, and return pointer. It returns a new element with the appropriate tag and props. ```javascript function au(M,w){return w.type} ``` -------------------------------- ### Get Owner Document of a Node Source: https://github.com/tony-stark-eth/template-symfony-sveltekit/blob/main/frontend/playwright-report/index.html This utility function retrieves the owner document of a given DOM node. It handles cases where the input might be the document itself or a node within a document. This is useful for operations that require access to the document context. ```javascript function Yu(t){return t.nodeType===9?t:t.ownerDocument} ```