-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
test(e2e): Add Bun, Deno and Cloudflare variants to react-router-8-framework #24598
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1028,8 +1028,8 @@ | |
| node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json' | ||
| - name: Set up Bun | ||
| if: | ||
| contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "elysia-bun", "elysia-bun-static", "hono-4", | ||
| "bun-bytecode", "bun-mysql"]'), matrix.test-application) | ||
| matrix.runtime == 'bun' || contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "elysia-bun", | ||
| "elysia-bun-static", "hono-4", "bun-bytecode", "bun-mysql"]'), matrix.test-application) | ||
| uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: '1.3.14' | ||
|
|
@@ -1040,7 +1040,7 @@ | |
| use-installer: true | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Set up Deno | ||
| if: matrix.test-application == 'deno' || matrix.test-application == 'hono-4' | ||
| if: matrix.runtime == 'deno' || matrix.test-application == 'deno' || matrix.test-application == 'hono-4' | ||
| uses: denoland/setup-deno@v2.0.5 | ||
| with: | ||
| deno-version: ${{ matrix.deno-version || 'v2.8.3' }} | ||
|
|
@@ -1166,8 +1166,13 @@ | |
| uses: actions/setup-node@v7 | ||
| with: | ||
| node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json' | ||
| - name: Set up Bun | ||
| if: matrix.runtime == 'bun' | ||
| uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: '1.3.14' | ||
|
Check warning on line 1173 in .github/workflows/build.yml
|
||
|
Comment on lines
+1169
to
+1173
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mutable oven-sh/setup-bun@v2 in secrets-bearing E2E job Pin Evidence
Identified by Warden · security-review · LR9-NP8 |
||
| - name: Set up Deno | ||
| if: matrix.test-application == 'deno' | ||
| if: matrix.runtime == 'deno' || matrix.test-application == 'deno' | ||
| uses: denoland/setup-deno@v2.0.5 | ||
| with: | ||
| deno-version: ${{ matrix.deno-version || 'v2.8.3' }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import * as Sentry from '@sentry/react-router/cloudflare'; | ||
| import { isbot } from 'isbot'; | ||
| import { renderToReadableStream } from 'react-dom/server'; | ||
| import { type EntryContext, type HandleErrorFunction, ServerRouter } from 'react-router'; | ||
|
|
||
| async function handleRequest( | ||
| request: Request, | ||
| responseStatusCode: number, | ||
| responseHeaders: Headers, | ||
| routerContext: EntryContext, | ||
| ): Promise<Response> { | ||
| let shellRendered = false; | ||
| const userAgent = request.headers.get('user-agent'); | ||
|
|
||
| const body = await renderToReadableStream(<ServerRouter context={routerContext} url={request.url} />, { | ||
| signal: request.signal, | ||
| onError(error: unknown) { | ||
| responseStatusCode = 500; | ||
| // Errors thrown after the shell has flushed can't change the status code, so surface them. | ||
| if (shellRendered) { | ||
| // eslint-disable-next-line no-console | ||
| console.error(error); | ||
| } | ||
| }, | ||
| }); | ||
| shellRendered = true; | ||
|
|
||
| if (userAgent && isbot(userAgent)) { | ||
| await body.allReady; | ||
| } | ||
|
|
||
| responseHeaders.set('Content-Type', 'text/html'); | ||
|
|
||
| return new Response(Sentry.injectTraceMetaTags(body), { | ||
| headers: responseHeaders, | ||
| status: responseStatusCode, | ||
| }); | ||
| } | ||
|
|
||
| export const handleError: HandleErrorFunction = Sentry.createSentryHandleError({ logErrors: true }); | ||
|
|
||
| export default Sentry.wrapSentryHandleRequest(handleRequest); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,5 @@ | ||
| export type Runtime = 'node' | 'bun' | 'deno' | 'cloudflare'; | ||
|
|
||
| export const RUNTIME = (process.env.RUNTIME || 'node') as Runtime; | ||
|
|
||
| export const APP_NAME = 'react-router-8-framework'; |
Uh oh!
There was an error while loading. Please reload this page.