diff options
author | 2022-07-03 23:54:44 -0700 | |
---|---|---|
committer | 2022-07-03 23:54:44 -0700 | |
commit | 78d5a0f20162714054c99b713b44151dfd9e938b (patch) | |
tree | 737dde5224aeb2729e650c57cbdcbef332420ac4 | |
parent | 53a8ab57154d370ac8cdf93a50b325bb4d67e2ab (diff) | |
download | bun-78d5a0f20162714054c99b713b44151dfd9e938b.tar.gz bun-78d5a0f20162714054c99b713b44151dfd9e938b.tar.zst bun-78d5a0f20162714054c99b713b44151dfd9e938b.zip |
Update README.md
-rw-r--r-- | README.md | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -212,6 +212,8 @@ Server-side render React: // react-ssr.tsx import { renderToReadableStream } from "react-dom/server"; +const dt = new Intl.DateTimeFormat(); + export default { port: 3000, async fetch(request: Request) { @@ -223,7 +225,7 @@ export default { </head> <body> <h1>Hello from React!</h1> - <p>The date is {new Intl.DateTimeFormat().format(new Date())}</p> + <p>The date is {dt.format(new Date())}</p> </body> </html> ) @@ -504,13 +506,16 @@ bun.js == bun’s JavaScriptCore integration that executes JavaScript. Similar t ### Limitations & intended usage -bun's bundler & transpiler are great for building websites & webapps, but note that bun doesn't have a minifier or support tree-shaking yet. For production, you probably still want to use a tool like esbuild to do that. +Today, bun is mostly focused on bun.js: the JavaScript runtime. + +While you could use bun's bundler & transpiler separately to build for browsers or node, bun doesn't have a minifier or support tree-shaking yet. For production browser builds, you probably should use a tool like esbuild or swc. -Today, bun is mostly focused on compatibility with existing frameworks & tooling. +Longer-term, bun intends to replace Node.js, Webpack, Babel, yarn, and PostCSS (in production). -Ideally, most projects can use bun with their existing tooling while making few changes to their codebase. For frontend work, that means using bun in development, and continuing to use Webpack, esbuild, or another bundler in production. Using two bundlers might sound strange at first, but after all the production-only AST transforms, minification, and special development/production-only imported files...it’s not far from the status quo. +### Upcoming breaking changes -Longer-term, bun intends to replace Node.js, Webpack, Babel, and PostCSS (in production). +- Bun's CLI flags will change to better support bun as a JavaScript runtime. They were chosen when bun was just a frontend development tool. +- Bun's bundling format will change to accomdate production browser bundles and on-demand production bundling ## Configuration |