kzc

Results 96 comments of kzc

> `var crypto = await import("crypto");` A dynamic `import()` + `await` is less efficient than a static `import` for side-effect-free node built-in modules: ```js import crypto from "crypto"; ``` This...

try: ``` sleep 99999 | esbuild main.ts --outfile=out.mjs --watch & ``` or ``` sleep 99999 | nohup esbuild main.ts --outfile=out.mjs --watch & ```

I think this should be a plugin or an opt-in. I personally wouldn't want a bundler to replace `__dirname` and `__filename` with absolute paths by default even if the target...

[13.7.5.1](https://www.ecma-international.org/ecma-262/6.0/#sec-for-in-and-for-of-statements-static-semantics-early-errors) Static Semantics: Early Errors ... ``` IterationStatement : for ( ForDeclaration in Expression ) Statement for ( ForDeclaration of AssignmentExpression ) Statement ``` * It is a Syntax Error...

If Babel errors out on `for(let x of[1]){let x=1}` then it's probably a Babel bug. Generally if code runs on V8 (Chrome/Node) and Firefox then it's valid. Safari has had...

FWIW the Babel 7.4.5 repl link above did not produce the (incorrect) syntax error for `for(let x of[1]){let x=1}` on my Chrome and Firefox browsers until the `es2015` or `es2015-loose`...

The bug appears to be in [babel-plugin-transform-for-of](https://github.com/babel/babel/blob/eae7a333166eb76ed7e66f50efb7902fda4b247b/packages/babel-plugin-transform-for-of/src/index.js). In the repl disable all presets and only enable that specific plugin. Not much code there. Should be easy for someone to isolate.

This is amusing... in the Babel REPL if you disable all presets and **only** enable these two plugins **in this specific order** it will work correctly for `for(let x of[1]){let...

Sure, it could be fixed in `transform-for-of` with some duplication of work or additional dependencies, but plugin reordering might be a legitimate fix as well. This isn't the first time...

Not sure what core rollup changes will be made in this PR at this early stage, but be sure to test it with https://github.com/mjackson/rollup-plugin-url-resolve as it already handles `http:`/`https:` URL...