import { render } from "./renderDocument"; import packagejson from "next/package.json"; const version = packagejson.version; if (!version.startsWith("12.2")) { console.warn( "Possibly incompatible Next.js version: ", version, ". Please upgrade to Next.js 12.2.0+.\n", ); } let buildId = 0; let DocumentLoaded = false; let DocumentNamespace; import(Bun.routesDir + "_document").then( (doc) => { DocumentNamespace = doc; DocumentLoaded = true; }, (err) => { // ResolveError is defined outside of bun-framework-next in ../../src/runtime/errors // @ts-expect-error if (err instanceof ResolveError) { DocumentLoaded = true; } else { console.error(err); } }, ); addEventListener("fetch", async (event: FetchEvent) => { const route = Bun.match(event); // This imports the currently matched route. let PageNamespace: any; try { PageNamespace = await import(route.filePath); } catch (exception) { console.error("Error loading page:", route.filePath); throw exception; } // This returns all .css files that were imported in the line above. // It's recursive, so any file that imports a CSS file will be included. const pageStylesheets = (Bun.getImportedStyles() as string[]).slice(); let appRoute: any; try { appRoute = await import(Bun.routesDir + "_app"); } catch (exception) { // ResolveError is defined outside of bun-framework-next in ../../src/runtime/errors // @ts-expect-error if (exception && !(exception instanceof ResolveError)) { console.error("Error loading app:", Bun.routesDir + "_app"); throw exception; } } const appStylesheets = (Bun.getImportedStyles() as string[]).slice(); let response: Response; try { response = await render({ route, PageNamespace, appStylesheets, pageStylesheets, DocumentNamespace, AppNamespace: appRoute, buildId, routePaths: Bun.getRouteFiles(), routeNames: Bun.getRouteNames(), request: event.request, }); } catch (exception) { console.error("Error rendering route", route.filePath); throw exception; } event.respondWith(response); buildId++; }); declare let Bun: any; export {}; Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/test/js/web/streams (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2023-10-12TweaksGravatar Colin McDonnell 1-2/+2
2023-10-12Fix structGravatar Colin McDonnell 1-1/+1
2023-10-12Clean up, implement warn_on_unrecognized_flagGravatar Colin McDonnell 4-26/+40
2023-10-12WIPGravatar Colin McDonnell 4-77/+14
2023-10-12WIPGravatar Colin McDonnell 5-347/+353
2023-10-12WIPGravatar Colin McDonnell 5-209/+446
2023-10-12WIPGravatar Colin McDonnell 2-24/+106
2023-10-12Improve helptextGravatar Colin McDonnell 1-55/+83
2023-10-12WIPGravatar Colin McDonnell 3-49/+147
2023-10-12WIPGravatar Colin McDonnell 2-0/+19
2023-10-12fix install testGravatar Dylan Conway 2-6/+8
2023-10-12fix editing package json when adding github dependency (#6432)Gravatar Dylan Conway 5-14/+146
* fix package name added to package json * check for github tag * remove alloc * some tests * fix test
2023-10-12Update installation.mdGravatar Colin McDonnell 1-8/+14
2023-10-12Update installation.mdGravatar Colin McDonnell 1-3/+3
2023-10-12fix(install): re-evaluate overrides when removedbun-v1.0.6Gravatar dave caruso 3-3/+45
2023-10-12chore: add missing ending quote (#6436)Gravatar Luna 1-1/+1
2023-10-12feat(install): support npm overrides/yarn resolutions, one level deep only ↵Gravatar dave caruso 7-31/+640
(#6435) * disable zig fmt on generated ResolvedSourceTag.zig * overrides * it works * ok * a --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-10-11fix #6416 (#6430)Gravatar Dylan Conway 2-1/+132
* make sure latest is checked after prerelease * test and fix * test for when latest matches prerelease
2023-10-11Bump WebKitGravatar Jarred Sumner 9-29/+29
2023-10-11Bump!Gravatar Jarred Sumner 1-1/+1
2023-10-11Update JSCUSocketsLoopIntegration.cppGravatar Dylan Conway 1-2/+2
2023-10-11Update installation.mdGravatar Colin McDonnell 1-10/+7