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

Yarn PnP Linux Faliure on Install #1656

Closed
ham-zeal opened this issue Oct 4, 2021 · 6 comments
Closed

Yarn PnP Linux Faliure on Install #1656

ham-zeal opened this issue Oct 4, 2021 · 6 comments

Comments

@ham-zeal
Copy link

ham-zeal commented Oct 4, 2021

intro

hello @evanw , thanks for all the killer stuff. there's a new issue i've found that relates only to yarn PnP and only on linux. This Repo will allow you to reproduce, but to save time here is the issue:

it broke

how to see the issue?

run:

yarn --inline-builds

on any linux os.

how to see if not on linux

run:

yarn fail:docker

what do you see?

 > [5/5] RUN yarn --inline-builds:
#9 0.689 ➤ YN0000: ┌ Resolution step
#9 0.698 ➤ YN0000: └ Completed
#9 0.699 ➤ YN0000: ┌ Fetch step
#9 0.841 ➤ YN0000: └ Completed
#9 0.845 ➤ YN0000: ┌ Link step
#9 0.879 ➤ YN0008: │ esbuild@npm:0.13.3 must be rebuilt because its dependency tree changed
#9 1.192 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR /usr/app/.yarn/unplugged/esbuild-npm-0.13.3-0c72846e03/node_modules/esbuild/lib/yarn-pnp-esbuild: 1: /usr/app/.yarn/unplugged/esbuild-npm-0.13.3-0c72846e03/node_modules/esbuild/lib/yarn-pnp-esbuild: Syntax error: "&" unexpected
#9 1.192 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR child_process.js:830
#9 1.192 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     throw err;
#9 1.192 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     ^
#9 1.193 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR
#9 1.193 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR Error: Command failed: /usr/app/.yarn/unplugged/esbuild-npm-0.13.3-0c72846e03/node_modules/esbuild/lib/yarn-pnp-esbuild --version
#9 1.193 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at checkExecSyncError (child_process.js:790:11)
#9 1.193 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Object.execFileSync (child_process.js:827:15)
#9 1.194 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Object.<anonymous> (/usr/app/.yarn/unplugged/esbuild-npm-0.13.3-0c72846e03/node_modules/esbuild/bin/esbuild:99:26)
#9 1.194 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Module._compile (internal/modules/cjs/loader.js:1085:14)
#9 1.194 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
#9 1.194 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Module.load (internal/modules/cjs/loader.js:950:32)
#9 1.194 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Function.external_module_.Module._load (/usr/app/.pnp.cjs:9590:14)
#9 1.194 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
#9 1.194 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at internal/main/run_main_module.js:17:47 {
#9 1.194 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   status: 2,
#9 1.194 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   signal: null,
#9 1.195 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   output: [ null, null, null ],
#9 1.195 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   pid: 50,
#9 1.195 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   stdout: null,
#9 1.195 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   stderr: null
#9 1.195 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR }
#9 1.201 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR child_process.js:830
#9 1.201 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     throw err;
#9 1.202 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     ^
#9 1.202 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR
#9 1.202 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR Error: Command failed: node /usr/app/.yarn/unplugged/esbuild-npm-0.13.3-0c72846e03/node_modules/esbuild/bin/esbuild --version
#9 1.202 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR /usr/app/.yarn/unplugged/esbuild-npm-0.13.3-0c72846e03/node_modules/esbuild/lib/yarn-pnp-esbuild: 1: /usr/app/.yarn/unplugged/esbuild-npm-0.13.3-0c72846e03/node_modules/esbuild/lib/yarn-pnp-esbuild: Syntax error: "&" unexpected
#9 1.202 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR child_process.js:830
#9 1.202 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     throw err;
#9 1.202 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     ^
#9 1.202 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR
#9 1.202 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR Error: Command failed: /usr/app/.yarn/unplugged/esbuild-npm-0.13.3-0c72846e03/node_modules/esbuild/lib/yarn-pnp-esbuild --version
#9 1.202 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at checkExecSyncError (child_process.js:790:11)
#9 1.202 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Object.execFileSync (child_process.js:827:15)
#9 1.203 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Object.<anonymous> (/usr/app/.yarn/unplugged/esbuild-npm-0.13.3-0c72846e03/node_modules/esbuild/bin/esbuild:99:26)
#9 1.203 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Module._compile (internal/modules/cjs/loader.js:1085:14)
#9 1.203 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
#9 1.203 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Module.load (internal/modules/cjs/loader.js:950:32)
#9 1.203 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Function.external_module_.Module._load (/usr/app/.pnp.cjs:9590:14)
#9 1.203 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
#9 1.203 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at internal/main/run_main_module.js:17:47 {
#9 1.203 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   status: 2,
#9 1.203 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   signal: null,
#9 1.203 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   output: [ null, null, null ],
#9 1.203 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   pid: 50,
#9 1.204 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   stdout: null,
#9 1.204 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   stderr: null
#9 1.204 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR }
#9 1.204 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR
#9 1.204 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at checkExecSyncError (child_process.js:790:11)
#9 1.204 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Object.execFileSync (child_process.js:827:15)
#9 1.204 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at validateBinaryVersion (/usr/app/.yarn/unplugged/esbuild-npm-0.13.3-0c72846e03/node_modules/esbuild/install.js:64:32)
#9 1.204 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Object.<anonymous> (/usr/app/.yarn/unplugged/esbuild-npm-0.13.3-0c72846e03/node_modules/esbuild/install.js:98:3)
#9 1.204 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Module._compile (internal/modules/cjs/loader.js:1085:14)
#9 1.204 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
#9 1.204 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Module.load (internal/modules/cjs/loader.js:950:32)
#9 1.204 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Function.external_module_.Module._load (/usr/app/.pnp.cjs:9590:14)
#9 1.204 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
#9 1.204 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     at internal/main/run_main_module.js:17:47 {
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   status: 1,
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   signal: null,
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   output: [
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     null,
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     Buffer(0) [Uint8Array] [],
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     Buffer(1144) [Uint8Array] [
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR        47, 117, 115, 114,  47,  97, 112, 112,  47,  46, 121,  97,
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR       114, 110,  47, 117, 110, 112, 108, 117, 103, 103, 101, 100,
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR        47, 101, 115,  98, 117, 105, 108, 100,  45, 110, 112, 109,
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR        45,  48,  46,  49,  51,  46,  51,  45,  48,  99,  55,  50,
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR        56,  52,  54, 101,  48,  51,  47, 110, 111, 100, 101,  95,
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR       109, 111, 100, 117, 108, 101, 115,  47, 101, 115,  98, 117,
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR       105, 108, 100,  47, 108, 105,  98,  47, 121,  97, 114, 110,
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR        45, 112, 110, 112,  45, 101, 115,  98, 117, 105, 108, 100,
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR        58,  32,  49,  58,
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR       ... 1044 more items
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     ]
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   ],
#9 1.205 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   pid: 43,
#9 1.206 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   stdout: Buffer(0) [Uint8Array] [],
#9 1.206 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   stderr: Buffer(1144) [Uint8Array] [
#9 1.206 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR      47, 117, 115, 114,  47,  97, 112, 112,  47,  46, 121,  97,
#9 1.206 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     114, 110,  47, 117, 110, 112, 108, 117, 103, 103, 101, 100,
#9 1.206 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR      47, 101, 115,  98, 117, 105, 108, 100,  45, 110, 112, 109,
#9 1.206 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR      45,  48,  46,  49,  51,  46,  51,  45,  48,  99,  55,  50,
#9 1.206 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR      56,  52,  54, 101,  48,  51,  47, 110, 111, 100, 101,  95,
#9 1.206 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     109, 111, 100, 117, 108, 101, 115,  47, 101, 115,  98, 117,
#9 1.206 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     105, 108, 100,  47, 108, 105,  98,  47, 121,  97, 114, 110,
#9 1.206 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR      45, 112, 110, 112,  45, 101, 115,  98, 117, 105, 108, 100,
#9 1.206 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR      58,  32,  49,  58,
#9 1.206 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR     ... 1044 more items
#9 1.206 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR   ]
#9 1.206 ➤ YN0000: │ esbuild@npm:0.13.3 STDERR }
#9 1.210 ➤ YN0009: │ esbuild@npm:0.13.3 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-3033559e/build.log)
#9 1.210 ➤ YN0000: └ Completed in 0s 365ms
#9 1.215 ➤ YN0000: Failed with errors in 0s 527ms
------
executor failed running [/bin/sh -c yarn --inline-builds]: exit code: 1

does it work without pnp?

yes.

does it work on macos and windows?

yes, it's only on linux and only for PnP.

@evanw
Copy link
Owner

evanw commented Oct 5, 2021

I tried using https://gitpod.io/#https://github.com/ham-zeal/esbuilb-yarn-pnp-linux-build-issue to run this on Linux, but I can't reproduce the problem:

gitpod /workspace/esbuilb-yarn-pnp-linux-build-issue $ node -p process.platform
linux

gitpod /workspace/esbuilb-yarn-pnp-linux-build-issue $ yarn --version
3.0.2

gitpod /workspace/esbuilb-yarn-pnp-linux-build-issue $ yarn --inline-builds
➤ YN0065: Yarn will periodically gather anonymous telemetry: https://yarnpkg.com/advanced/telemetry
➤ YN0065: Run yarn config set --home enableTelemetry 0 to disable

➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0007: │ esbuild@npm:0.13.3 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 0s 400ms
➤ YN0000: Done in 0s 588ms

gitpod /workspace/esbuilb-yarn-pnp-linux-build-issue $ yarn fail:docker
Sending build context to Docker daemon  106.4MB
Step 1/5 : FROM node:14
14: Pulling from library/node
af4c2580c6c3: Pull complete 
4ea40d27a2cf: Pull complete 
523d612e9cd2: Pull complete 
8fee6a1847b0: Pull complete 
60cce3519052: Pull complete 
4bae1011637c: Pull complete 
ecf48b6c1f43: Pull complete 
856f69196742: Pull complete 
e86a512b6f8c: Pull complete 
Digest: sha256:167d0a4af6b4e0d0769086b871a36c25faed75b72705144cabbda70466cc0d8e
Status: Downloaded newer image for node:14
 ---> 8cf18d365a37
Step 2/5 : RUN mkdir -p /usr/app
 ---> Running in cfeff63e4079
Removing intermediate container cfeff63e4079
 ---> fdf535488e17
Step 3/5 : WORKDIR /usr/app
 ---> Running in 00364855109f
Removing intermediate container 00364855109f
 ---> 132a3fa018cf
Step 4/5 : COPY  . .
 ---> 13cab6bde93b
Step 5/5 : RUN yarn --inline-builds
 ---> Running in 1af598ada843
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0008: │ esbuild@npm:0.13.3 must be rebuilt because its dependency tree changed
➤ YN0000: └ Completed in 0s 348ms
➤ YN0000: Done in 0s 524ms
Removing intermediate container 1af598ada843
 ---> 425f83d7e3dd
Successfully built 425f83d7e3dd
Successfully tagged test:latest

Everything appears to work for me.

evanw added a commit that referenced this issue Oct 5, 2021
I'm not sure if this will fix anything, but it probably couldn't hurt.
@evanw
Copy link
Owner

evanw commented Oct 5, 2021

I did finally manage to reproduce the problem from scratch, but only by copying files that were already installed on macOS and then running them on Linux. In that case, Yarn's installation process breaks. This documentation seems relevant: https://yarnpkg.com/cli/rebuild/. Specifically this part:

Note that while Yarn forgets the compilation, the previous artifacts aren't erased from the filesystem and may affect the next builds (in good or bad). To avoid this, you may remove the .yarn/unplugged folder, or any other relevant location where packages might have been stored (Yarn may offer a way to do that automatically in the future).

So it looks like yarn's package management isn't idempotent. If you copy a directory tree containing a .yarn/unplugged folder from one OS to another, you need to delete that directory before running yarn again or the package directory may be corrupted. This appears to be by design. So the solution is to run some form of rm -fr .yarn/unplugged before running yarn. I've tried this solution out myself and fixes your issue. You have to delete the .yarn/unplugged folder after copying the files from the non-Linux OS to Linux but before running yarn.

@ham-zeal
Copy link
Author

ham-zeal commented Oct 5, 2021

you are absolutely right my dude, points to you for the thoroughness. i've pushed an update to the repo to prove your point, it doesn't fail if we manually clear out unplugged as you've indicated. i'm happy to close as upstream and will open in yarn repo.

@evanw
Copy link
Owner

evanw commented Oct 5, 2021

Can you try the version 0.13.4 of esbuild that I just released? I tried to make the install script more resilient in this situation even though it's not designed to be used like this. Now my Yarn PnP workaround should use separate paths for the executables for each platform so in theory multiple platforms can coexist simultaneously. So if you attempt to do this, I think it should actually work now. The trade-off is you'll end up wasting some file system space.

@ham-zeal
Copy link
Author

ham-zeal commented Oct 5, 2021

you're dead right again my guy. this branch totally works even in the failure mode.

to be fair if you're using yarn PnP and complaining about disk space you've missed the whole point lol

@evanw
Copy link
Owner

evanw commented Oct 5, 2021

Thanks for confirming! Closing this as fixed then.

@evanw evanw closed this as completed Oct 5, 2021
eduardoboucas pushed a commit to netlify/esbuild that referenced this issue Dec 3, 2021
* fix evanw#1327: improve lowered template literals

* fix(linker): order of css imported from js (evanw#1342)

* release notes for evanw#1342

* update compat-table

* fix for "export default class" transform (evanw#1346)

* publish 0.12.6 to npm

* add support for es5-style identifiers (evanw#1349)

* runtime: remove "__platform" flag

* runtime: remove "__profiler" flag

* runtime: check "for-of" not "=>" for es6 support

* fix evanw#1349: quote modern unicode object properties

* fix evanw#1355: ignore tsconfig.json in node_modules

* fix evanw#1357: "--metafile" with "--watch"

* fix(linker): add missing esm flag (evanw#1338)

* Allow OnResolve plugins to mark modules as side effect free (evanw#1313)

* publish 0.12.7 to npm

* fix evanw#1358: remove warning about source map comment

* publish 0.12.8 to npm

* fix evanw#1361: allow "this" with "--define"

* fix evanw#1372: css minification bug with !important

* publish 0.12.9 to npm

* avoid checking "browser" for other platforms

* add an "es2021" target

* Avoid exporting a pointer to a loop variable in linker (evanw#1389)

The Bazel nogo (Go lint config) errored when I tried to compile esbuild:

    compilepkg: nogo: errors found by nogo during build-time code analysis:
    external/com_github_evanw_esbuild/internal/bundler/linker.go:3309:27:
     exporting a pointer for the loop variable stmt (export_loop_ref)

The simplified code nogo complains about is:

    for _, stmt := range partStmts {
      stmt.Data = &js_ast.SImport{
        StarNameLoc: &stmt.Loc,
      }
    }

The problem is `&stmt.Loc` points to the mutated loop variable `stmt`.  After
the loop iteration ends, all stored pointers will point to the last value of
`partStmts[-1].Loc`.

An alternative solution is to shadow `stmt` at the beginning of the loop, but
this felt cleaner:

    stmt := stmt

The lint rule is defined by https://github.com/kyoh86/exportloopref.

* feat: mangle Infinity (evanw#1385)

* add support for shorten transform/translate3d (evanw#1390)

* css: implement minification for all matrix forms

* fix evanw#1397: support "s" in css attribute selectors

* publish 0.12.10 to npm

* fix evanw#1399: avoid "os.MkdirAll" to fix WebAssembly

* fix evanw#1396: improve invalid loader error message

* improve sync performance of js api by ~20x (evanw#1000)

* fix windows issues

* publish 0.12.11 to npm

* move unique key prefix from compile to scan phase

* add "C" to unique keys for chunks

* fix evanw#1044: correct relative paths for file loader

* fix a windows path issue

* publish 0.12.12 to npm

* Fix using JS synchronous API from from non-main threads (evanw#1411)

* publish 0.12.13 to npm

* keep wasm tests self-contained

* factor out some code related to "outfile"

* pull out relative-to-outbase code

* fix evanw#1404: "file" loader always copies to "outdir"

* publish 0.12.14 to npm

* fix evanw#1421: bug with css color lowering and "var()"

* avoid "var()" issues with other css minifications

* publish 0.12.15 to npm

* update the compat table

* allow out-of-range tagged template unicode escapes

* fix evanw#1426: remove warning about bad CSS "@" rules

* fix evanw#1470: allow "ES2021" in "tsconfig.json"

* fix evanw#1462: avoid worker_threads in node <v12.17.0

* fix evanw#1466: paths with "node:" prefix are external

* Consider `\` and `/` to be the same in file paths (evanw#1472)

* publish 0.12.16 to npm

* fix evanw#1455: bundler hoisting bug with var+for loops

* fix evanw#1418: private fields and logical assignment

* Abort esbuild if stdin is closed when serving (evanw#1449)

* release notes for evanw#1449

* fix evanw#1424: always generate private method names

* publish 0.12.17 to npm

* fix evanw#1483: UTF-8 and utf-8 are the same @charset

* improve error about missing sub-condition (evanw#1484)

* refactor(deno): use denoflate instead of compress (evanw#1482)

deno.land/x/denoflate is about 10% smaller, and a lot more polished and
up to date than deno.land/x/compress.

* fix evanw#1493: nullish coalescing assignment edge case

* fix evanw#1489: do not warn about "es3" in node_modules

* fix evanw#1497: "this" before "super()" when minifying

* avoid shadowing "expr" in "lowerClass"

* fix evanw#1498: variable shadowing broke class lowering

* fix: CSS import relative paths (evanw#1494)

* add release notes for evanw#1494

* publish 0.12.18 to npm

* move source map code to source map module

* css: add location info to rules

* css: printer returns result object

* move span object to logger

* css: add support for source maps

* add extension to source map tests

* add a basic css source map test

* fix evanw#519: release notes for css source maps

* fix evanw#1507: wrong ts class field side effect order

* publish 0.12.19 to npm

* avoid printing "</style" in CSS code (evanw#1509)

* attempt to fix flaky test

* update browser compat data

* fix evanw#1512: asi issue with "." and type parameters

* fix evanw#1509: make `</script` escape case-insensitive

* publish 0.12.20 to npm

* update to go version 1.17.0

* fix evanw#995: windows arm64 support

* run go format from go 1.17.0

* css: terminate source map comment before "*/"

* add windows 64-bit arm build to installer (evanw#995)

* publish 0.12.21 to npm

* fix evanw#1536: http range requests now use less memory

* fix evanw#1538: minify bug for "var()" and "box-shadow"

* publish 0.12.22 to npm

* fix evanw#1553: rest bindings in TypeScript arrow types

* fix evanw#1545: "watch" is not allowed with "buildSync"

* fix evanw#1552: keep names + minify + nested functions

* forbid "watch" w/ "buildSync" w/o "worker_threads"

* publish 0.12.23 to npm

* fix direct "eval" variable renaming edge case

* publish 0.12.24 to npm

* fix evanw#1560: bug with "!" after "new" in TypeScript

* capture and report parser panics

* fix parser panic due to "#a in #b in c"

* class static blocks are a parse error

* illumos 64-bit support (evanw#1562)

* release notes for evanw#1562

* publish 0.12.25 to npm

* feat: Optimizing the __require function (evanw#1580)

* release notes for evanw#1579

* move "NO_COLOR" handling into the logger itself

* add an "analyze metafile" api

* add import paths to analysis

* add a "verbose" flag to analysis

* fix evanw#1568: release notes for "--analyze"

* upgrade "golang.org/x/sys" (evanw#1572)

* publish 0.12.26 to npm

* fix evanw#1594: update manual compat table overrides

* replace math.MaxInt usage (evanw#1585)

This constant is only available in go >= 1.17, so I've inlined its value
so dependents don't have to upgrade their go version.

reference implementation: https://cs.opensource.google/go/go/+/refs/tags/go1.17:src/math/const.go;l=38

* fix evanw#1589: server "stop()" waits for active builds

* use "math.MaxUint32" not "math.MaxInt"

* update go 1.17.0 => go 1.17.1

* publish 0.12.27 to npm

* fix evanw#1599: U+30FB and U+FF65 in ES5 vs. ES6+

* fix evanw#1600: "++" and "--" on class private fields

* publish 0.12.28 to npm

* fix evanw#1614: proxy from "__require" to "require"

* fix evanw#1623: ignore class fields marked "abstract"

* "typeof identifier" has no side effects

* fix "__require" to have no side effects

* fix mangle syntax edge case with "==" and "!="

* fix missing return in "IsNumericValue"

* add "--analyze" to cli help text

* publish 0.12.29 to npm

* no side effects for "typeof x != undefined && x"

* separate "ignore annotations" from "tree shaking" (evanw#1625)

* install using "optionalDependencies" (evanw#1621)

* release notes

* publish 0.13.0 to npm

* fix release gh action to ignore nested headers

* fix the "esbuild" package in yarn 2+

* yarn pnp compat: copy binary into the current pkg

* publish 0.13.1 to npm

* fix evanw#1628: "export {}" with "--tree-shaking=true"

* fix cache condition in iswin_wasm (evanw#1630)

* publish 0.13.2 to npm

* add "preferUnplugged: false" to binary packages

This is a yarn-specific "package.json" flag and is being added at the recommendation of the Yarn team. Even though esbuild's binary packages are listed as optional dependencies of the main package, Yarn still installs all of them (even though only one applies to the current platform). And unlike npm, which always installs a given package into a directory on the file system, Yarn can represent a given package either as a zip file or as a directory of files. So ideally as many packages as possible are represented as zip files to minimize wasted space on the file system (since zip files are compressed). One of the heuristics that Yarn uses is to represent a package as a directory if it contains a file ending in ".exe" so unfortunately esbuild's three Windows packages are always stored as directories instead of as zip files, which means they are uncompressed and are larger than necessary. Specifying "preferUnplugged: false" should avoid this. Hopefully someday Yarn won't even install these packages on the file system in the first place to eliminate the wasted space completely.

See also:

* https://yarnpkg.com/configuration/manifest/#preferUnplugged
* yarnpkg/berry#3317 (comment)

* support type-only import/export specifiers (evanw#1637)

* publish 0.13.3 to npm

* fix evanw#1642: permission issues with install script

* basic support for ".mts" and ".cts" from TS 4.5

* fix evanw#1647: add a fallback for "npm --no-optional"

* make pnpapi workaround platform-specific (evanw#1656)

I'm not sure if this will fix anything, but it probably couldn't hurt.

* no optimizations with yarn 1 just in case (evanw#1656)

* fix evanw#1657: invalid css transform of margin/padding

* remove ".mts" and ".cts" from resolve extensions

* publish 0.13.4 to npm

* fix evanw#1113: improve watch mode accuracy (evanw#1676)

* disallow certain "<" in ".mts/.cts" files

* fix evanw#1665: don’t remove empty @Keyframes (evanw#1669)

* release notes for evanw#1665

* Don't emit "duplicate label" error across function scopes. (evanw#1671)

* release notes for evanw#1671

* publish 0.13.5 to npm

* Add NetBSD amd64 binary (evanw#1624)

* https in changelog, rebalance makefile

* Allow bundled esbuild with ESBUILD_BINARY_PATH (evanw#1678)

* feat: drop catch binding when optional catch binding is supported (evanw#1660)

* fix subtle minify issues with eval

* ts: forbid "declare" fields from being initialized

* ts: forbid "declare" on non-field class properties

* fix evanw#1675: run decorators for "declare" fields

* avoid direct eval retaining unused imports in ts

* publish 0.13.6 to npm

* update parcel 2 version in benchmark

* remove now-unnecessary "@parcel/transformer-typescript-tsc"

* remove old bundler versions

* update rollup and webpack too

* update benchmark image

* fix evanw#1682: always use the shortest css alpha value

* fix evanw#1680: match node's core module behavior

* update go 1.17.1 => 1.17.2

* fix wasm on go 1.17.2 (evanw#1684)

* update rollup tests so they work on node v16.11.1

* publish 0.13.7 to npm

* fix evanw#1425: super inside arrow inside lowered async

* add "and CSS" to package description

* fix evanw#1661: remove implicit trailing "/" in "[dir]"

* add a test for evanw#1362

* publish 0.13.8 to npm

* fix evanw#1702: invalid css transform of border-radius

* make yaml formatting consistent

* add simple end-to-end tests

* fix evanw#1703: handle silent "rename" syscall failure

* add pnpm end-to-end tests

* check end-to-end test output

* resolver: rename "pe" => "pj"

* remove unused range

* fix evanw#1691: support "imports" in "package.json"

* publish 0.13.9 to npm

* yarn berry end-to-end test

* try running end-to-end tests on github

* check that esbuild builds on go 1.13

* Use `io.SeekStart` instead of deprecated `os.SEEK_SET` (evanw#1701)

`os.SEEK_SET` has been deprecated since Go 1.7.
Ref: https://pkg.go.dev/os#pkg-constants

* add "check out code" to old go version ci

* update @next targets for npm and yarn

* link from code to docs for vs code autocomplete

* remove invalid "es7" option in tsconfig parser

* update the compat table

* Allow target for ES-Version to be uppercase (evanw#1718)

* fix evanw#1539: implement legal comments for css

* update to unicode 14

* add ".mts" and ".cts" to exports kind checking

* publish 0.13.10 to npm

* reorder some functions

* get tests working on node 17+

* also run async transform tests un-transformed

* run tests w/ node 16 not 14 to avoid hard-crash

Node 14 has some bug that results in an "unreachable code" panic. For the record, the traceback is as follows:

     1: node::NodePlatform::GetStackTracePrinter()::$_3::__invoke()
     2: V8_Fatal(char const*, ...)
     3: v8::internal::interpreter::BytecodeGenerator::VisitCompoundAssignment(v8::internal::CompoundAssignment*)
     4: v8::internal::interpreter::BytecodeGenerator::VisitNoStackOverflowCheck(v8::internal::AstNode*)
     5: v8::internal::interpreter::BytecodeGenerator::GenerateBytecodeBody()
     6: v8::internal::interpreter::BytecodeGenerator::GenerateBytecode(unsigned long)
     7: v8::internal::interpreter::InterpreterCompilationJob::ExecuteJobImpl()
     8: v8::internal::(anonymous namespace)::ExecuteSingleUnoptimizedCompilationJob(v8::internal::ParseInfo*, v8::internal::FunctionLiteral*, v8::internal::AccountingAllocator*, std::__1::vector<v8::internal::FunctionLiteral*, std::__1::allocator<v8::internal::FunctionLiteral*> >*)
     9: v8::internal::(anonymous namespace)::IterativelyExecuteAndFinalizeUnoptimizedCompilationJobs(v8::internal::Isolate*, v8::internal::Handle<v8::internal::SharedFunctionInfo>, v8::internal::Handle<v8::internal::Script>, v8::internal::ParseInfo*, v8::internal::AccountingAllocator*, v8::internal::IsCompiledScope*, std::__1::vector<v8::internal::FinalizeUnoptimizedCompilationData, std::__1::allocator<v8::internal::FinalizeUnoptimizedCompilationData> >*)
    10: v8::internal::Compiler::Compile(v8::internal::Handle<v8::internal::SharedFunctionInfo>, v8::internal::Compiler::ClearExceptionFlag, v8::internal::IsCompiledScope*)
    11: v8::internal::Compiler::Compile(v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Compiler::ClearExceptionFlag, v8::internal::IsCompiledScope*)
    12: v8::internal::Runtime_CompileLazy(int, unsigned long*, v8::internal::Isolate*)
    13: Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit
    14: Builtins_CompileLazy
    15: Builtins_InterpreterEntryTrampoline

* also run class lowering tests untransformed

* test coverage for super and object methods

* fix writing to a "super" property

* also handle "super" inside static class fields

* implement class static blocks (evanw#1729)

* publish 0.13.11 to npm

* enable tree shaking for empty "static {}" blocks

* fix evanw#1730: crash with legal comment and @import

* enable tree shaking of "Reflect" static methods

* implement "calc()" reduction for css (evanw#1731)

* publish 0.13.12 to npm

* fix evanw#1739: tree shaking bug with "var exports"

* border radius tests: use length instead of number

* Add css to help text for --loader (evanw#1744)

* allow empty string for CLI string arrays

* move "main fields" logic to a separate function

* make debug meta available to the entire resolver

* say if "main" is missing from main fields (evanw#1754)

* fix evanw#1755: merge adjacent selectors with same body

* add spack to benchmarks (not ready due to bugs)

* Shorten "top", "right" properties into "inset" property (evanw#1758)

* add credit to changelog

* publish 0.13.13 to npm

* chore: make build pass

* chore: update publishing scripts

Co-authored-by: Evan Wallace <evan.exe@gmail.com>
Co-authored-by: dmitrage <dmitrage@gmail.com>
Co-authored-by: Liu Bowen <Mr_lbw@outlook.com>
Co-authored-by: Chris Casola <chriscasola@gmail.com>
Co-authored-by: Joe Schafer <joe@jschaf.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: Weilin Shi <934587911@qq.com>
Co-authored-by: José Valim <jose.valim@gmail.com>
Co-authored-by: Luca Casonato <hello@lcas.dev>
Co-authored-by: Rongjian Zhang <pd4d10@gmail.com>
Co-authored-by: Dominik Hassler <hadfl@omnios.org>
Co-authored-by: FM <15306225869@163.com>
Co-authored-by: David Zukowski <david@zuko.me>
Co-authored-by: John Doe <you@example.com>
Co-authored-by: Georges Varouchas <georges.varouchas@gmail.com>
Co-authored-by: Pig Fang <g-plane@hotmail.com>
Co-authored-by: Eelco Lempsink <eelco@framer.com>
Co-authored-by: Nevkontakte <nevkontakte@users.noreply.github.com>
Co-authored-by: Greg Troxel <gdt@lexort.com>
Co-authored-by: Piotr Krawiec <piotr@krawiec.me>
Co-authored-by: 翠 / green <green@sapphi.red>
Co-authored-by: y-yagi <yuuji.yaginuma@gmail.com>
Co-authored-by: timse <tim.sebastian@gmail.com>
Co-authored-by: Dan Rosén <danr42@gmail.com>
Co-authored-by: Netlify Team Account 1 <netlify-team-account-1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants