esbuild
0.28.2 · 8 Aug 2026MIT443.2M / weekRepositoryHomepagenpmAtom feed
0.28.2 is the newest release of 0.14.x.
In short
1 new
Security
1 advisory affects 0.14.51
- Moderateesbuild enables any website to send any requests to the development server and read the responseGHSA-67mh-4wv8-2f99 · 10 Feb 2025No fix yet
Release note
Add support for React 17's
automaticJSX transform (#334, #718, #1172, #2318, #2349)This adds support for the new "automatic" JSX runtime from React 17+ to esbuild for both the build and transform APIs.
New CLI flags and API options:
--jsx,jsx— Set this to"automatic"to opt in to this new transform--jsx-dev,jsxDev— Toggles development mode for the automatic runtime--jsx-import-source,jsxImportSource— Overrides the root import for runtime functions (default"react")
New JSX pragma comments:
@jsxRuntime— Sets the runtime (automaticorclassic)@jsxImportSource— Sets the import source (only valid with automatic runtime)
The existing
@jsxFragmentand@jsxFactorypragma comments are only valid with "classic" runtime.TSConfig resolving:
Along with accepting the new options directly via CLI or API, option inference fromtsconfig.jsoncompiler options was also implemented:"jsx": "preserve"or"jsx": "react-native"→ Same as--jsx=preservein esbuild"jsx": "react"→ Same as--jsx=transformin esbuild (which is the default behavior)"jsx": "react-jsx"→ Same as--jsx=automaticin esbuild"jsx": "react-jsxdev"→ Same as--jsx=automatic --jsx-devin esbuild
It also reads the value of
"jsxImportSource"fromtsconfig.jsonif specified.For
react-jsxit's important to note that it doesn't implicitly disable--jsx-dev. This is to support the case where a user sets"react-jsx"in theirtsconfig.jsonbut then toggles development mode directly in esbuild.esbuild vs Babel vs TS vs...
There are a few differences between the various technologies that implement automatic JSX runtimes. The JSX transform in esbuild follows a mix of Babel's and TypeScript's behavior:
When an element has
__sourceor__selfprops:Babel: Print an error about a deprecated transform plugin
TypeScript: Allow the props
swc: Hard crash
esbuild: Print an error — Following Babel was chosen for this one because this might help people catch configuration issues where JSX files are being parsed by multiple tools
Element has an "implicit true" key prop, e.g.
<a key />:Babel: Print an error indicating that "key" props require an explicit value
TypeScript: Silently omit the "key" prop
swc: Hard crash
esbuild: Print an error like Babel — This might help catch legitimate programming mistakes
Element has spread children, e.g.
<a>{...children}</a>Babel: Print an error stating that React doesn't support spread children
TypeScript: Use static jsx function and pass children as-is, including spread operator
swc: same as Babel
esbuild: Same as TypeScript
Also note that TypeScript has some bugs regarding JSX development mode and the generation of
lineNumberandcolumnNumbervalues. Babel's values are accurate though, so esbuild's line and column numbers match Babel. Both numbers are 1-based and columns are counted in terms of UTF-16 code units.This feature was contributed
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.