Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): bump esbuild from 0.14.43 to 0.14.47 #608

Merged
merged 2 commits into from
Jun 21, 2022

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jun 21, 2022

Bumps esbuild from 0.14.43 to 0.14.47.

Release notes

Sourced from esbuild's releases.

v0.14.47

  • Make global names more compact when ||= is available (#2331)

    With this release, the code esbuild generates for the --global-name= setting is now slightly shorter when you don't configure esbuild such that the ||= operator is unsupported (e.g. with --target=chrome80 or --supported:logical-assignment=false):

    // Original code
    exports.foo = 123
    // Old output (with --format=iife --global-name=foo.bar.baz --minify)
    var foo=foo||{};foo.bar=foo.bar||{};foo.bar.baz=(()=>{var b=(a,o)=>()=>(o||a((o={exports:{}}).exports,o),o.exports);var c=b(f=>{f.foo=123});return c();})();
    // New output (with --format=iife --global-name=foo.bar.baz --minify)
    var foo;((foo||={}).bar||={}).baz=(()=>{var b=(a,o)=>()=>(o||a((o={exports:{}}).exports,o),o.exports);var c=b(f=>{f.foo=123});return c();})();

  • Fix --mangle-quoted=false with --minify-syntax=true

    If property mangling is active and --mangle-quoted is disabled, quoted properties are supposed to be preserved. However, there was a case when this didn't happen if --minify-syntax was enabled, since that internally transforms x['y'] into x.y to reduce code size. This issue has been fixed:

    // Original code
    x.foo = x['bar'] = { foo: y, 'bar': z }
    // Old output (with --mangle-props=. --mangle-quoted=false --minify-syntax=true)
    x.a = x.b = { a: y, bar: z };
    // New output (with --mangle-props=. --mangle-quoted=false --minify-syntax=true)
    x.a = x.bar = { a: y, bar: z };

    Notice how the property foo is always used unquoted but the property bar is always used quoted, so foo should be consistently mangled while bar should be consistently not mangled.

  • Fix a minification bug regarding this and property initializers

    When minification is enabled, esbuild attempts to inline the initializers of variables that have only been used once into the start of the following expression to reduce code size. However, there was a bug where this transformation could change the value of this when the initializer is a property access and the start of the following expression is a call expression. This release fixes the bug:

    // Original code
    function foo(obj) {
      let fn = obj.prop;
      fn();
    }
    // Old output (with --minify)
    function foo(f){f.prop()}
    // New output (with --minify)
    function foo(o){let f=o.prop;f()}

... (truncated)

Changelog

Sourced from esbuild's changelog.

0.14.47

  • Make global names more compact when ||= is available (#2331)

    With this release, the code esbuild generates for the --global-name= setting is now slightly shorter when you don't configure esbuild such that the ||= operator is unsupported (e.g. with --target=chrome80 or --supported:logical-assignment=false):

    // Original code
    exports.foo = 123
    // Old output (with --format=iife --global-name=foo.bar.baz --minify)
    var foo=foo||{};foo.bar=foo.bar||{};foo.bar.baz=(()=>{var b=(a,o)=>()=>(o||a((o={exports:{}}).exports,o),o.exports);var c=b(f=>{f.foo=123});return c();})();
    // New output (with --format=iife --global-name=foo.bar.baz --minify)
    var foo;((foo||={}).bar||={}).baz=(()=>{var b=(a,o)=>()=>(o||a((o={exports:{}}).exports,o),o.exports);var c=b(f=>{f.foo=123});return c();})();

  • Fix --mangle-quoted=false with --minify-syntax=true

    If property mangling is active and --mangle-quoted is disabled, quoted properties are supposed to be preserved. However, there was a case when this didn't happen if --minify-syntax was enabled, since that internally transforms x['y'] into x.y to reduce code size. This issue has been fixed:

    // Original code
    x.foo = x['bar'] = { foo: y, 'bar': z }
    // Old output (with --mangle-props=. --mangle-quoted=false --minify-syntax=true)
    x.a = x.b = { a: y, bar: z };
    // New output (with --mangle-props=. --mangle-quoted=false --minify-syntax=true)
    x.a = x.bar = { a: y, bar: z };

    Notice how the property foo is always used unquoted but the property bar is always used quoted, so foo should be consistently mangled while bar should be consistently not mangled.

  • Fix a minification bug regarding this and property initializers

    When minification is enabled, esbuild attempts to inline the initializers of variables that have only been used once into the start of the following expression to reduce code size. However, there was a bug where this transformation could change the value of this when the initializer is a property access and the start of the following expression is a call expression. This release fixes the bug:

    // Original code
    function foo(obj) {
      let fn = obj.prop;
      fn();
    }
    // Old output (with --minify)
    function foo(f){f.prop()}
    // New output (with --minify)
    function foo(o){let f=o.prop;f()}

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Jun 21, 2022
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.14.43 to 0.14.47.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/master/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.14.43...v0.14.47)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/esbuild-0.14.47 branch from ae8af05 to 1aab824 Compare June 21, 2022 00:12
@ybiquitous ybiquitous self-assigned this Jun 21, 2022
@github-actions
Copy link
Contributor

npm diff --diff=esbuild@0.14.43 --diff=esbuild@0.14.47 --diff-unified=2
diff --git a/bin/esbuild b/bin/esbuild
index v0.14.43..v0.14.47 100755
--- a/bin/esbuild
+++ b/bin/esbuild
@@ -1,3 +1,4 @@
 #!/usr/bin/env node
+"use strict";
 var __create = Object.create;
 var __defProp = Object.defineProperty;
diff --git a/install.js b/install.js
index v0.14.43..v0.14.47 100644
--- a/install.js
+++ b/install.js
@@ -1,25 +1,9 @@
+"use strict";
 var __create = Object.create;
 var __defProp = Object.defineProperty;
-var __defProps = Object.defineProperties;
 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
 var __getOwnPropNames = Object.getOwnPropertyNames;
-var __getOwnPropSymbols = Object.getOwnPropertySymbols;
 var __getProtoOf = Object.getPrototypeOf;
 var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __propIsEnum = Object.prototype.propertyIsEnumerable;
-var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
-var __spreadValues = (a, b) => {
-  for (var prop in b || (b = {}))
-    if (__hasOwnProp.call(b, prop))
-      __defNormalProp(a, prop, b[prop]);
-  if (__getOwnPropSymbols)
-    for (var prop of __getOwnPropSymbols(b)) {
-      if (__propIsEnum.call(b, prop))
-        __defNormalProp(a, prop, b[prop]);
-    }
-  return a;
-};
-var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
 var __copyProps = (to, from, except, desc) => {
   if (from && typeof from === "object" || typeof from === "function") {
@@ -102,6 +86,6 @@
     stdio: "pipe"
   }).toString().trim();
-  if (stdout !== "0.14.43") {
-    throw new Error(`Expected ${JSON.stringify("0.14.43")} but got ${JSON.stringify(stdout)}`);
+  if (stdout !== "0.14.47") {
+    throw new Error(`Expected ${JSON.stringify("0.14.47")} but got ${JSON.stringify(stdout)}`);
   }
 }
@@ -148,5 +132,5 @@
 }
 function installUsingNPM(pkg, subpath, binPath) {
-  const env = __spreadProps(__spreadValues({}, process.env), { npm_config_global: void 0 });
+  const env = { ...process.env, npm_config_global: void 0 };
   const esbuildLibDir = path2.dirname(require.resolve("esbuild"));
   const installDir = path2.join(esbuildLibDir, "npm-install");
@@ -154,5 +138,5 @@
   try {
     fs2.writeFileSync(path2.join(installDir, "package.json"), "{}");
-    child_process.execSync(`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.14.43"}`, { cwd: installDir, stdio: "pipe", env });
+    child_process.execSync(`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.14.47"}`, { cwd: installDir, stdio: "pipe", env });
     const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath);
     fs2.renameSync(installedBinPath, binPath);
@@ -203,5 +187,5 @@
 }
 async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
-  const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.14.43"}.tgz`;
+  const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.14.47"}.tgz`;
   console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`);
   try {
diff --git a/lib/main.js b/lib/main.js
index v0.14.43..v0.14.47 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -1,25 +1,9 @@
+"use strict";
 var __create = Object.create;
 var __defProp = Object.defineProperty;
-var __defProps = Object.defineProperties;
 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
 var __getOwnPropNames = Object.getOwnPropertyNames;
-var __getOwnPropSymbols = Object.getOwnPropertySymbols;
 var __getProtoOf = Object.getPrototypeOf;
 var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __propIsEnum = Object.prototype.propertyIsEnumerable;
-var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
-var __spreadValues = (a, b) => {
-  for (var prop in b || (b = {}))
-    if (__hasOwnProp.call(b, prop))
-      __defNormalProp(a, prop, b[prop]);
-  if (__getOwnPropSymbols)
-    for (var prop of __getOwnPropSymbols(b)) {
-      if (__propIsEnum.call(b, prop))
-        __defNormalProp(a, prop, b[prop]);
-    }
-  return a;
-};
-var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
 var __export = (target, all) => {
   for (var name in all)
@@ -320,4 +304,5 @@
   let define = getFlag(options, keys, "define", mustBeObject);
   let logOverride = getFlag(options, keys, "logOverride", mustBeObject);
+  let supported = getFlag(options, keys, "supported", mustBeObject);
   let pure = getFlag(options, keys, "pure", mustBeArray);
   let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean);
@@ -381,4 +366,11 @@
     }
   }
+  if (supported) {
+    for (let key in supported) {
+      if (key.indexOf("=") >= 0)
+        throw new Error(`Invalid supported: ${key}`);
+      flags.push(`--supported:${key}=${supported[key]}`);
+    }
+  }
   if (pure)
     for (let fn of pure)
@@ -755,6 +747,6 @@
       isFirstPacket = false;
       let binaryVersion = String.fromCharCode(...bytes);
-      if (binaryVersion !== "0.14.43") {
-        throw new Error(`Cannot start service: Host version "${"0.14.43"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
+      if (binaryVersion !== "0.14.47") {
+        throw new Error(`Cannot start service: Host version "${"0.14.47"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
       }
       return;
@@ -1148,5 +1140,6 @@
         } else {
           try {
-            buildOrServeContinue(__spreadProps(__spreadValues({}, args), {
+            buildOrServeContinue({
+              ...args,
               key,
               details,
@@ -1155,5 +1148,5 @@
               runOnEndCallbacks: result.runOnEndCallbacks,
               pluginRefs: result.pluginRefs
-            }));
+            });
           } catch (e) {
             handleError(e, "");
@@ -1163,5 +1156,6 @@
     } else {
       try {
-        buildOrServeContinue(__spreadProps(__spreadValues({}, args), {
+        buildOrServeContinue({
+          ...args,
           key,
           details,
@@ -1170,5 +1164,5 @@
           runOnEndCallbacks: (result, logPluginError2, done) => done(),
           pluginRefs: null
-        }));
+        });
       } catch (e) {
         handleError(e, "");
@@ -1265,5 +1259,5 @@
               sendRequest(refs, { command: "rebuild", key }, (error2, response2) => {
                 if (error2) {
-                  const message = { pluginName: "", text: error2, location: null, notes: [], detail: void 0 };
+                  const message = { id: "", pluginName: "", text: error2, location: null, notes: [], detail: void 0 };
                   return callback2(failureErrorWithLog("Build failed", [message], []), null);
                 }
@@ -1548,5 +1542,5 @@
   } catch {
   }
-  return { pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 };
+  return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 };
 }
 function parseStackLinesV8(streamIn, lines, ident) {
@@ -1647,4 +1641,5 @@
   for (const message of messages) {
     let keys = {};
+    let id = getFlag(message, keys, "id", mustBeString);
     let pluginName = getFlag(message, keys, "pluginName", mustBeString);
     let text = getFlag(message, keys, "text", mustBeString);
@@ -1668,4 +1663,5 @@
     }
     messagesClone.push({
+      id: id || "",
       pluginName: pluginName || fallbackPluginName,
       text: text || "",
@@ -1868,5 +1864,5 @@
 }
 var _a;
-var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.43";
+var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.47";
 var esbuildCommandAndArgs = () => {
   if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
@@ -1932,5 +1928,5 @@
   }
 };
-var version = "0.14.43";
+var version = "0.14.47";
 var build = (options) => ensureServiceIsRunning().build(options);
 var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
@@ -2027,4 +2023,6 @@
   if (options.wasmURL)
     throw new Error(`The "wasmURL" option only works in the browser`);
+  if (options.wasmModule)
+    throw new Error(`The "wasmModule" option only works in the browser`);
   if (options.worker)
     throw new Error(`The "worker" option only works in the browser`);
@@ -2041,5 +2039,5 @@
     return longLivedService;
   let [command, args] = esbuildCommandAndArgs();
-  let child = child_process.spawn(command, args.concat(`--service=${"0.14.43"}`, "--ping"), {
+  let child = child_process.spawn(command, args.concat(`--service=${"0.14.47"}`, "--ping"), {
     windowsHide: true,
     stdio: ["pipe", "pipe", "inherit"],
@@ -2155,5 +2153,5 @@
   });
   callback(service);
-  let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.43"}`), {
+  let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.47"}`), {
     cwd: defaultWD,
     windowsHide: true,
@@ -2171,5 +2169,5 @@
   let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
   let worker = new worker_threads2.Worker(__filename, {
-    workerData: { workerPort, defaultWD, esbuildVersion: "0.14.43" },
+    workerData: { workerPort, defaultWD, esbuildVersion: "0.14.47" },
     transferList: [workerPort],
     execArgv: []
@@ -2180,5 +2178,5 @@
     let error = new Error(`Build failed with 1 error:
 error: ${text}`);
-    let errors = [{ pluginName: "", text, location: null, notes: [], detail: void 0 }];
+    let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }];
     error.errors = errors;
     error.warnings = [];
diff --git a/package.json b/package.json
index v0.14.43..v0.14.47 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
 {
   "name": "esbuild",
-  "version": "0.14.43",
+  "version": "0.14.47",
   "description": "An extremely fast JavaScript and CSS bundler and minifier.",
   "repository": "https://github.com/evanw/esbuild",
@@ -16,24 +16,24 @@
   },
   "optionalDependencies": {
-    "esbuild-android-64": "0.14.43",
-    "esbuild-android-arm64": "0.14.43",
-    "esbuild-darwin-64": "0.14.43",
-    "esbuild-darwin-arm64": "0.14.43",
-    "esbuild-freebsd-64": "0.14.43",
-    "esbuild-freebsd-arm64": "0.14.43",
-    "esbuild-linux-32": "0.14.43",
-    "esbuild-linux-64": "0.14.43",
-    "esbuild-linux-arm": "0.14.43",
-    "esbuild-linux-arm64": "0.14.43",
-    "esbuild-linux-mips64le": "0.14.43",
-    "esbuild-linux-ppc64le": "0.14.43",
-    "esbuild-linux-riscv64": "0.14.43",
-    "esbuild-linux-s390x": "0.14.43",
-    "esbuild-netbsd-64": "0.14.43",
-    "esbuild-openbsd-64": "0.14.43",
-    "esbuild-sunos-64": "0.14.43",
-    "esbuild-windows-32": "0.14.43",
-    "esbuild-windows-64": "0.14.43",
-    "esbuild-windows-arm64": "0.14.43"
+    "esbuild-android-64": "0.14.47",
+    "esbuild-android-arm64": "0.14.47",
+    "esbuild-darwin-64": "0.14.47",
+    "esbuild-darwin-arm64": "0.14.47",
+    "esbuild-freebsd-64": "0.14.47",
+    "esbuild-freebsd-arm64": "0.14.47",
+    "esbuild-linux-32": "0.14.47",
+    "esbuild-linux-64": "0.14.47",
+    "esbuild-linux-arm": "0.14.47",
+    "esbuild-linux-arm64": "0.14.47",
+    "esbuild-linux-mips64le": "0.14.47",
+    "esbuild-linux-ppc64le": "0.14.47",
+    "esbuild-linux-riscv64": "0.14.47",
+    "esbuild-linux-s390x": "0.14.47",
+    "esbuild-netbsd-64": "0.14.47",
+    "esbuild-openbsd-64": "0.14.47",
+    "esbuild-sunos-64": "0.14.47",
+    "esbuild-windows-32": "0.14.47",
+    "esbuild-windows-64": "0.14.47",
+    "esbuild-windows-arm64": "0.14.47"
   },
   "license": "MIT"
diff --git a/lib/main.d.ts b/lib/main.d.ts
index v0.14.43..v0.14.47 100644
--- a/lib/main.d.ts
+++ b/lib/main.d.ts
@@ -1,5 +1,5 @@
 export type Platform = 'browser' | 'node' | 'neutral';
 export type Format = 'iife' | 'cjs' | 'esm';
-export type Loader = 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary' | 'default';
+export type Loader = 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary' | 'copy' | 'default';
 export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent';
 export type Charset = 'ascii' | 'utf8';
@@ -22,4 +22,6 @@
   /** Documentation: https://esbuild.github.io/api/#target */
   target?: string | string[];
+  /** Documentation: https://esbuild.github.io/api/#supported */
+  supported?: Record<string, boolean>;
 
   /** Documentation: https://esbuild.github.io/api/#mangle-props */
@@ -149,4 +151,5 @@
 
 export interface Message {
+  id: string;
   pluginName: string;
   text: string;
@@ -403,4 +406,5 @@
 
 export interface PartialMessage {
+  id?: string;
   pluginName?: string;
   text?: string;
  • Size: 116.1 KB → 115.2 KB (-935 B)
  • Files: 7 → 7 (±0)

Posted by ybiquitous/npm-diff-action v1.3.1 (Node.js v18.4.0; npm v8.12.2)

@ybiquitous ybiquitous changed the title build(deps-dev): bump esbuild from 0.14.43 to 0.14.47 fix(deps): bump esbuild from 0.14.43 to 0.14.47 Jun 21, 2022
@ybiquitous ybiquitous merged commit 0e82d26 into main Jun 21, 2022
@ybiquitous ybiquitous deleted the dependabot/npm_and_yarn/esbuild-0.14.47 branch June 21, 2022 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant