Skip to content

0.1.1

Compare
Choose a tag to compare
@developit developit released this 19 Nov 20:29

@babel/preset-modules version 0.1.1 changes the behavior of JSX to fix compatibility with Edge 16-18. This preset originally compiled JSX Spread attributes to Object Spread expressions, however these are not supported in Edge. Instead, as of 0.1.1 JSX Spread is now transpiled to Object.assign() calls:

// input:
const X = <div a {...b} />

// previous output: (0.1.0):
const X = h('div', { a: true, ...b })

// new output: (0.1.1):
const X = h('div', Object.assign({ a: true }, b))

The raw byte size has increased slightly, but this increase shrinks to near-0 when compressed using Gzip or Brotli, since the repeated Object.assign( calls are essentially free.