mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
### What does this PR do?
Fixes a crash related to the dev server overwriting the uws user context
pointer when setting abort callback.
Adds support for `return new Response(<jsx />, { ... })` and `return
Response.render(...)` and `return Response.redirect(...)`:
- Created a `SSRResponse` class to handle this (see
`JSBakeResponse.{h,cpp}`)
- `SSRResponse` is designed to "fake" being a React component
- This is done in JSBakeResponse::create inside of
src/bun.js/bindings/JSBakeResponse.cpp
- And `src/js/builtins/BakeSSRResponse.ts` defines a `wrapComponent`
function which wraps
the passed in component (when doing `new Response(<jsx />, ...)`). It
does
this to throw an error (in redirect()/render() case) or return the
component.
- Created a `BakeAdditionsToGlobal` struct which contains some
properties
needed for this
- Added some of the properties we need to fake to BunBuiltinNames.h
(e.g.
`$$typeof`), the rationale behind this is that we couldn't use
`structure->addPropertyTransition` because JSBakeResponse is not a final
JSObject.
- When bake and server-side, bundler rewrites `Response ->
Bun.SSRResponse` (see `src/ast/P.zig` and `src/ast/visitExpr.zig`)
- Created a new WebCore body variant (`Render: struct { path: []const u8
}`)
- Created when `return Response.render(...)`
- When handled, it re-invokes dev server to render the new path
Enables server-side sourcemaps for the dev server:
- New source providers for server-side:
(`DevServerSourceProvider.{h,cpp}`)
- IncrementalGraph and SourceMapStore are updated to support this
There are numerous other stuff:
- allow `app` configuration from Bun.serve(...)
- fix errors stopping dev server
- fix use after free related to in
RequestContext.finishRunningErrorHandler
- Request.cookies
- Make `"use client";` components work
- Fix some bugs using `require(...)` in dev server
- Fix catch-all routes not working in the dev server
- Updates `findSourceMappingURL(...)` to use `std.mem.lastIndexOf(...)`
because
the sourcemap that should be used is the last one anyway
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Alistair Smith <hi@alistair.sh>
126 lines
3.5 KiB
JSON
126 lines
3.5 KiB
JSON
{
|
|
"name": "test",
|
|
"devDependencies": {
|
|
"@types/react": "18.0.28",
|
|
"@types/react-dom": "18.0.11",
|
|
"@types/supertest": "2.0.12",
|
|
"@types/utf-8-validate": "5.0.0",
|
|
"@types/ws": "8.5.10",
|
|
"@types/puppeteer": "7.0.4"
|
|
},
|
|
"dependencies": {
|
|
"@astrojs/node": "9.1.3",
|
|
"@azure/service-bus": "7.9.4",
|
|
"@duckdb/node-api": "1.1.3-alpha.7",
|
|
"@electric-sql/pglite": "0.2.17",
|
|
"@fastify/websocket": "11.0.2",
|
|
"@grpc/grpc-js": "1.12.0",
|
|
"@grpc/proto-loader": "0.7.10",
|
|
"@happy-dom/global-registrator": "17.0.3",
|
|
"@napi-rs/canvas": "0.1.65",
|
|
"@nestjs/common": "11.0.3",
|
|
"@nestjs/core": "11.0.3",
|
|
"@prisma/client": "5.8.0",
|
|
"@remix-run/node": "2.16.8",
|
|
"@remix-run/react": "2.10.3",
|
|
"@remix-run/serve": "2.10.3",
|
|
"@resvg/resvg-js": "2.4.1",
|
|
"@swc/core": "1.3.38",
|
|
"@testing-library/jest-dom": "6.6.3",
|
|
"@testing-library/react": "16.1.0",
|
|
"@verdaccio/config": "6.0.0-6-next.76",
|
|
"acorn": "8.15.0",
|
|
"ansi-regex": "6.1.0",
|
|
"astro": "5.5.5",
|
|
"aws-cdk-lib": "2.148.0",
|
|
"axios": "1.6.8",
|
|
"body-parser": "1.20.2",
|
|
"bun-plugin-svelte": "file:../packages/bun-plugin-svelte",
|
|
"bun-plugin-yaml": "0.0.1",
|
|
"comlink": "4.4.1",
|
|
"commander": "12.1.0",
|
|
"detect-libc": "2.0.3",
|
|
"devalue": "5.1.1",
|
|
"duckdb": "1.3.1",
|
|
"es-module-lexer": "1.3.0",
|
|
"esbuild": "0.18.6",
|
|
"express": "4.18.2",
|
|
"fast-glob": "3.3.1",
|
|
"fastify": "5.2.2",
|
|
"filenamify": "6.0.0",
|
|
"happy-dom": "17.0.3",
|
|
"hono": "4.7.2",
|
|
"http2-wrapper": "2.2.1",
|
|
"https-proxy-agent": "7.0.5",
|
|
"iconv-lite": "0.6.3",
|
|
"immutable": "5.1.3",
|
|
"isbot": "5.1.13",
|
|
"jest-extended": "4.0.0",
|
|
"jimp": "1.6.0",
|
|
"jsdom": "25.0.1",
|
|
"jsonwebtoken": "9.0.2",
|
|
"jws": "4.0.0",
|
|
"lodash": "4.17.21",
|
|
"mongodb": "6.0.0",
|
|
"msgpackr-extract": "3.0.2",
|
|
"msw": "2.3.0",
|
|
"mysql2": "3.7.0",
|
|
"node-gyp": "10.0.1",
|
|
"nodemailer": "6.9.3",
|
|
"p-queue": "8.1.0",
|
|
"peechy": "0.4.310",
|
|
"pg": "8.11.1",
|
|
"pg-connection-string": "2.6.1",
|
|
"pg-gateway": "0.3.0-beta.4",
|
|
"pino": "9.4.0",
|
|
"pino-pretty": "11.2.2",
|
|
"postgres": "3.3.5",
|
|
"prisma": "5.1.1",
|
|
"prompts": "2.4.2",
|
|
"proxy": "2.2.0",
|
|
"react": "file:../node_modules/react",
|
|
"react-dom": "18.3.1",
|
|
"reflect-metadata": "0.2.2",
|
|
"rollup": "4.4.1",
|
|
"sass": "1.79.4",
|
|
"sharp": "0.33.0",
|
|
"sinon": "6.0.0",
|
|
"socket.io": "4.7.1",
|
|
"socket.io-adapter": "2.5.5",
|
|
"socket.io-client": "4.7.1",
|
|
"solc": "0.8.28",
|
|
"source-map": "0.7.4",
|
|
"st": "3.0.0",
|
|
"string-width": "7.0.0",
|
|
"strip-ansi": "7.1.0",
|
|
"stripe": "15.4.0",
|
|
"superagent": "10.2.2",
|
|
"supertest": "6.3.3",
|
|
"svelte": "5.20.4",
|
|
"tsyringe": "4.8.0",
|
|
"type-graphql": "2.0.0-rc.2",
|
|
"typeorm": "0.3.20",
|
|
"typescript": "5.9.2",
|
|
"undici": "5.20.0",
|
|
"unzipper": "0.12.3",
|
|
"uuid": "11.1.0",
|
|
"v8-heapsnapshot": "1.3.1",
|
|
"verdaccio": "6.0.0",
|
|
"vitest": "0.32.2",
|
|
"webpack": "5.88.0",
|
|
"webpack-cli": "4.7.2",
|
|
"ws": "8.18.3",
|
|
"xml2js": "0.6.2",
|
|
"yargs": "17.7.2"
|
|
},
|
|
"private": true,
|
|
"scripts": {
|
|
"typecheck": "tsc --noEmit",
|
|
"bd:v": "(bun run --silent --cwd=../ build:debug &> /tmp/bun.debug.build.log || (cat /tmp/bun.debug.build.log && rm -rf /tmp/bun.debug.build.log && exit 1)) && rm -f /tmp/bun.debug.build.log && ../build/debug/bun-debug",
|
|
"bd": "BUN_DEBUG_QUIET_LOGS=1 bun --silent bd:v"
|
|
},
|
|
"resolutions": {
|
|
"react": "../node_modules/react"
|
|
}
|
|
}
|