chore(deps): update dependency esbuild to v0.12.29 #769
No reviewers
Labels
No Label
area/internal-code
changes requested
confirmed
dependencies
duplicate
good first issue
help wanted
hosting
invalid
kind/bug
kind/feature
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/frontend#769
Loading…
Reference in New Issue
No description provided.
Delete Branch "renovate/esbuild-0.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
0.12.28
->0.12.29
Release Notes
evanw/esbuild
v0.12.29
Compare Source
Fix compilation of abstract class fields in TypeScript (#1623)
This release fixes a bug where esbuild could incorrectly include a TypeScript abstract class field in the compiled JavaScript output. This is incorrect because the official TypeScript compiler never does this. Note that this only happened in scenarios where TypeScript's
useDefineForClassFields
setting was set totrue
(or equivalently where TypeScript'starget
setting was set toESNext
). Here is the difference:Proxy from the
__require
shim torequire
(#1614)Some background: esbuild's bundler emulates a CommonJS environment. The bundling process replaces the literal syntax
require(<string>)
with the referenced module at compile-time. However, other uses ofrequire
such asrequire(someFunction())
are not bundled since the value ofsomeFunction()
depends on code evaluation, and esbuild does not evaluate code at compile-time. So it's possible for some references torequire
to remain after bundling.This was causing problems for some CommonJS code that was run in the browser and that expected
typeof require === 'function'
to be true (see #1202), since the browser does not provide a global calledrequire
. Thus esbuild introduced a shimrequire
function called__require
(shown below) and replaced all references torequire
in the bundled code with__require
:However, this broke code that referenced
require.resolve
inside the bundle, which could hypothetically actually work since you could assign your own implementation towindow.require.resolve
(see #1579). So the implementation of__require
was changed to this:However, that broke code that assigned to
window.require
later on after the bundle was loaded (#1614). So with this release, the code for__require
now handles all of these edge cases:typeof require
is stillfunction
even ifwindow.require
is undefinedwindow.require
can be assigned to either before or after the bundle is loadedrequire.resolve
and arbitrary other properties can still be accessedrequire
will now forward any number of arguments, not just the first oneHandling all of these edge cases is only possible with the Proxy API. So the implementation of
__require
now looks like this:Consider
typeof x
to have no side effectsThe
typeof
operator does not itself trigger any code evaluation so it can safely be removed if evaluating the operand does not cause any side effects. However, there is a special case of thetypeof
operator when the operand is an identifier expression. In that case no reference error is thrown if the referenced symbol does not exist (e.g.typeof x
does not throw an error if there is no symbol namedx
). With this release, esbuild will now considertypeof x
to have no side effects even if evaluatingx
would have side effects (i.e. would throw a reference error):Note that there is actually an edge case where
typeof x
can throw an error: whenx
is being referenced inside of its TDZ, or temporal dead zone (i.e. before it's declared). This applies tolet
,const
, andclass
symbols. However, esbuild doesn't currently handle TDZ rules so the possibility of errors thrown due to TDZ rules is not currently considered. This typically doesn't matter in real-world code so this hasn't been a priority to fix (and is actually tricky to fix with esbuild's current bundling approach). So esbuild may incorrectly remove atypeof
expression that actually has side effects. However, esbuild already incorrectly did this in previous releases so its behavior regardingtypeof
and TDZ rules hasn't changed in this release.Configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.