-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Break up and remove core/internal_constants.js
and core/constants.js
#5158
Labels
Milestone
Comments
Actually, come to think of it, we should probably also go over |
core/internal_constants.js
core/internal_constants.js
and core/constants.js
.
core/internal_constants.js
and core/constants.js
.core/internal_constants.js
and core/constants.js
5 tasks
This was referenced Nov 29, 2021
This was referenced Jan 19, 2022
Ok I did some work on this but I am planning on putting it down for now. The current state of this is:
All the values in internal_constants that still need a new home:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background
#5140 is an important precursor to finishing the first pass of migrating
goog.provides
togoog.module
by removing side effects fromcore/constants.js
, which previously modified theBlockly
object by adding a large number of assorted@constant
properties to it.In order not to advertise any new API surface, these constants have been redeclared in
core/internal_constants.js
(rather thancore/contstants.js
), which is marked@package
to prevent their use outside ofcore
.Proposal
CONSTANT_CASE
and, to comply with style guide rules forbidding mutable exports, and either becore/blockly.js
should be replace by a getter/setter pair to provide backward compatibility.@enum
where appropriate.Specific recommendations
OPPOSITE_TYPE
should be moved toconnection_type.js
—and possibly also be renamed to make code that uses it is more readable—e.g.,let x = oppositeConnectionType[y]
instead of… = OPPOSITE_TYPE[y]
. (There's no rule that requires objects that happen never to be mutated to be declared inCONSTANT_CASE
.)The text was updated successfully, but these errors were encountered: