Skip to content

Latest commit

 

History

History
165 lines (83 loc) · 12 KB

CHANGELOG.md

File metadata and controls

165 lines (83 loc) · 12 KB

Changelog

Unreleased

  • Respect the sideEffects field when tree shaking (#50)

    Tree shaking now respects "sideEffects": false in package.json, which means esbuild now generates smaller bundles with certain libraries such as lodash-es. This setting is a convention from Webpack: https://webpack.js.org/guides/tree-shaking/. Any files in a package with this setting will not be included in the bundle if they are imported using an ES6 import and then never used.

0.4.5

  • Fix a crash with more than 8 entry points (#162)

    This bug was due to the wrong index being used for an internal bit set. That caused a crash due to an out-of-bounds array read when esbuild is run with more than 8 entry points. I now have test coverage for large numbers of entry points, so this should not happen again.

  • Fix slash characters in file loader (#164)

    This fixes a bug where the base64-encoded hash included in the file name could sometimes contain a / character. The fix is to use the base64 character set for URL-encoding, which replaces the / character with a _ character.

0.4.4

  • Fix optional chaining with TypeScript operators (#168)

    The work on optional chaining in the previous release introduced a regression where the TypeScript infix operators ! and <> incorrectly stopped the propagation of optional chaining. That meant a?.b!() and a?.b<T>() incorrectly behaved like (a?.b)() instead of a?.b(). This now has test coverage.

  • Add support for the "paths" field in tsconfig.json (#60 and #144)

    This provides a way of remapping module paths to local file paths. It's relatively powerful because it supports wildcard patterns and multiple fallback locations. See the documentation in the TypeScript handbook for more information about how this feature works. This was contributed by @viankakrisna.

  • Add the file loader (#14 and #135)

    The file loader copies the input file to the output folder and exports the path of the file as a string to any modules that import the file. For example, --loader:.png=file enables this loader for all imported .png files. This was contributed by @viankakrisna.

  • Add the --resolve-extensions flag (#142)

    This lets you override the implicit extensions that are tested when importing a file. It must be a comma-separated list of extensions. For example, setting --resolve-extensions=.jsx,.js means import "./foo" will check for ./foo then ./foo.jsx then ./foo.js in that order. The behavior corresponds to the similarly-named feature in Webpack. This was contributed by @viankakrisna.

0.4.3

  • Fix bug with optional chaining parentheses (#156)

    One edge case with JavaScript optional chaining syntax is that parentheses stop the chain. So a?.b.c will be undefined if a is nullish but (a?.b).c will crash if a is nullish.

    This was handled correctly when lowering is enabled (i.e. when the language target is es2019 or below) but was not handled correctly when lowering is disabled (i.e. when the language target is es2020 or above). The output for (a?.b).c was incorrectly a?.b.c instead of (a?.b).c, which would no longer crash if a is nullish. The fix is to preserve the parentheses in the output.

  • Support for the PowerPC 64-bit Little Endian architecture on Linux (#146)

    This was contributed by @runlevel5.

0.4.2

  • Bind imports to re-exports (#149)

    This fixes a bug where imports of re-exported symbols were not correctly merged in some cases. This resulted in the generated code referencing symbols that were not declared, resulting in a crash.

0.4.1

  • Add a log level setting (#117)

    You can now silence esbuild except for errors with --log-level=error, or except for errors and warnings with --log-level=warning.

  • Now jsconfig.json is an alternative to tsconfig.json (#132)

    The "baseUrl" setting in tsconfig.json, which lets you avoid ../../ relative import paths, is respected by esbuild. With this change, esbuild will also check for this setting in jsconfig.json if no tsconfig.json file is found. This is relevant to some projects that use the TypeScript compiler with JavaScript files instead of TypeScript files. You can read more about this feature here. This was contributed by @viankakrisna.

  • Chinese translation of documentation (#129)

    Both the readme and the architecture documentation have been translated into Chinese, which is available here: http://docs.breword.com/evanw-esbuild. This was contributed by @92hackers.

  • Async generator functions require --target=es2018

    This fixes a bug where async generator functions were incorrectly allowed with --target=es2017, which is incorrect because the asynchronous iteration spec is part of ES2018.

0.4.0

  • Add the esm output format (#48)

    It is now possible to generate a bundle in ES6 module format using --format=esm. The generated code uses ES6 import and export statements. This is useful for bundling code to be used as a library, for using in a <script type="module> tag in the browser, or for using with node's --experimental-modules flag. Note that CommonJS entry points bundled with this format will become a single default export, which is the same way node works.

  • Preliminary tree shaking support (#50)

    Bundling now performs tree shaking, which is also known as dead code elimination. Every top-level statement is considered to be a separate part of the file, and unused parts without any side effects are not included in the bundle. This only really affects code using ES6 modules, so make sure you use ES6 modules to take advantage of tree shaking.

    This is the initial release of tree shaking which lands the fundamental mechanism behind it. This release does not include the various annotations used by the community to indicate side-effect free code (e.g. "sideEffects": false and /*#__PURE__*/), so esbuild will likely generate somewhat bigger bundles than other bundlers. Support for these annotations will come in future releases.

  • Benchmarks have been re-run

    This updates all of the bundlers used in the benchmark to their latest versions. Due to recent performance work, esbuild is now at least 100x faster than all other bundlers. I have also included a single-threaded version of esbuild for comparison since some people were wondering how much of esbuild's performance was due to multithreading.

  • Warnings about future syntax are now errors

    This happens when an input file contains newer JavaScript syntax and --target is set to an earlier version of JavaScript than the syntax can be transformed to. These most of transforms will be implemented eventually, but for now some are still unimplemented. This was changed from a warning to an error because ignoring these warnings could result in broken code in older browsers, so these messages are more serious than warnings.

  • Using bundle-related flags without --bundle is now an error

    This leaves the possibility open of using these flags for non-bundle mode in the future. For example, in the future --format may also work when not bundling.

0.3.9

  • Add the dataurl loader (#107)

    This loader turns the file into a base64-encoded data URL. The mime type is automatically derived from the file extension, with the file contents used as a fallback. This was contributed by @viankakrisna.

  • Fix minification bug with external modules (#134)

    When loading a module marked --external with require(), the resulting code was sometimes incorrectly minified when bundling. This now has test coverage.

0.3.8

  • Fix an issue that prevented non-inline source maps with the build() API (#130)

    The issue happend when invoking esbuild.build({ sourcemap: true }) and was a regression due to the addition of inline source map support. This now has test coverage.

0.3.7

  • Add an unsupported build for ARM64 (#123)

    Now you can npm install esbuild on a Linux ARM64 machine and it should work. This lets you run esbuild on a Raspberry Pi. Note that this target isn't officially supported because it's not covered by any automated tests. This was contributed by @violentmagician.

0.3.6

  • Fix a bug with JSX element contents that end in a multi-byte unicode character (#124)

    Such characters are now preserved instead of being truncated.

0.3.5

  • Performance improvements

    The parsing phase was failing to saturate all CPUs in many cases because input files were being read on a single goroutine in a blocking fashion. Each file is now read on its own goroutine and the parsing phase now saturates all CPUs.

    With the performance improvements in this release and the previous release, the time to run the JavaScript benchmark has been reduced from 0.54s to 0.4s, which is approximately a 25% performance improvement.

0.3.4

  • Performance improvements

    The GC is now disabled when running in build-and-exit mode, which is a noticeable speedup. This release also fixes some accidental O(n^2) behavior in the code that renames variables to avoid collisions in non-minify mode. This didn't affect any of esbuild's benchmarks but it did cause issues on certain other artificial test cases.

0.3.3

  • Support all unicode whitespace (#116)

    The lexer now accepts all unicode characters in the WS category as valid whitespace to match the JavaScript standard.

0.3.2

  • Add some options related to source maps

    There is now a sourcefile option to set the input file path for input files without a path. This happens in two cases: either using the service.transform() API or passing an input file using stdin.

    This release also adds the inline value for the sourcemap option which inlines the source map as a base64-encoded data URL in the output file instead of writing the source map to a separate file.

0.3.1

  • Remove type-only exports from TypeScript (#110)

    This fixes a bug where type-only exports in TypeScript files could in some cases generate an invalid export statement.

0.3.0

  • Support for stdin/stdout (#76)

    You can now pass esbuild an input file over stdin instead of using a file path. Use the --loader=jsx syntax to set the loader instead of using the --loader:.js=jsx syntax.

    Now if there is no output file, esbuild will write the output to stdout. Before this, esbuild would try to infer an output file based on the input file name. This is a breaking change so it was released with a minor version bump.