-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add missing extern composition methods for global Set object #4213
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
Open
ecrider
wants to merge
1
commit into
google:master
Choose a base branch
from
ecrider:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not @const {number} if it's readonly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must say it's a very stable codebase and one that can still compete to this day with new fancy bleeding-edge compilers, bundlers, transpilers - even in terms of raw performance from optimized code, which is more than impressive, it's insane. A little out of fashion maybe, for most seem overly complicated, rough around the edges, demanding to adapt, pale in comparison I heard. There are thousands of articles on how to make friends with TypeScript for example, but for Closure-Compiler there is almost nothing there - there is no mastering it without diving deep into the source code. That said, as a development utility it's nearly impossible to replace because of how reliable it is, a striking contrast to the majority of tools that are used in the JavaScript supply ecosystem.
I like to think it saves me $10k for every single thing it doesn't break when deployed into "enterprise-grade production pipelines" - and just that would make me a billionaire because there are a lot of things that can break at any time in those piles of corporate manure. Problems can be solved by simply introducing some new dependencies, worked well so everyone kept doing it - if something works, it works... until it doesn't.
To be honest most of those infrastructures keeping our lights on is already broken beyond repair at a fundamental level, waiting to implode - looks pretty solid from up far, but when you get curious, go down there, look close enough - you see a graveyard, a tomb filled with nothing but corpses conducting electrical current, empty husks on a life support from daemonized routines and terabytes of cache in random-access memory. All those places maintained by skeleton crews of underpaid people - gnomes, good spirits coming out at night and conducting minor repairs, tending to those failing server racks, basically carrying our glorious, highly advanced civilisation on their backs, postponing doomsday and saving the world by sitting there in the dark and knowing exactly what machines can and what machines cannot be rebooted ever. Do not despair though, calvary is coming - they will soon be liberated, freed from their dungeons by none other than Sam Altman himself arriving on a white horse, with a pardon letter, universal basic income and a ChatGPT terminal strapped to his saddlebag. Glory to mankind.
This is not a rant, it's a love letter to Closure Compiler, I needed that, just let me be.
But I digress...
There are some ES6 polyfills being dynamically injected by the compiler, early enough to be included in general code optimisation, they also rely on extern definitions. Basically "size" property is supposed to be read-only, but it can't be really because Set polyfills need to be able to reassign this value under the hood.
closure-compiler/src/com/google/javascript/jscomp/js/es6/set.js
Lines 97 to 100 in 0b52016
My understanding is that we should mark it as read-only property, but without declaring it as actual constant - doing so would trigger warnings in advanced mode that would be hard to debug for users since it's internal matter - they wouldn't be able to find the offender in their codebase, nor suppress it.
When defining as constant and trying to build the entire thing there are warnings in place complaining about it.