This is part of #5153 but is being prioritised because we want remove
the declareLegacyNamespace calls from the core/utils/*.js modules and
then reexport them explicitly via utils.js, and it turns out that
doing so results in the exports object of this module being passed to
Object.freeze - which fails on the global object, which can't be made
non-extensible!
The new name chosen for the former default export is globalThis, since
it is intended to have the same value as the global variable of that
name; see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis
Create a file scripts/migration/renamings.js to collect information about renamed API entries. Start by filling it with the renamings already done to blockly.js.
* Use goog.requireType when importing I* interfaces
Interfaces have no code, so should never be referred to outside of
(JSDoc) comments, and so the modules that define only interfaces never
need to be goog.require'd - goog.requireType is always sufficient.
This commit fixes imports of all modules whose name matches
/(.*\.)?I[A-Z]*/ - i.e., the hungarian-notation named ones in
core/interfaces/.
* Use goog.requireType when only using import for type specifications
Where a module is imported only to used in JSDoc comments it can
(and should) be goog.requireType'd instead of goog.require'd.
* Remove spurious eslint-disable no-unused-vars
There were a few cases where modules were being imported with
goog.require (because they are referred to in code, not just JSDoc
comments) but were prefaced by a spurious eslint suppress.
Remove these, restoring the invariant that an import gets an eslint
if and only if it is a requireType.
* Remove obsolete Closure Compiler error group
stricterMissingRequire has been superceded by missingRequire, and now
causes a Java null pointer exception if supplied.
An intermediate version of this code read:
fs.mkdir(demoStaticTmpDir, {recursive: true}), done);
but apparently `fs.mkdir` doesn't honour the recursive option, so I
tried to revert the change but munged it instead.
This commit cleans up the mess I made.
* New gulp task buildDeps (npm run build:deps) to create tests/deps.js.
* Old gulp task buildUncompressed is deleted.
* blockly_uncompressed.js is now handwritten.
* And simplified; in particular, BLOCKLY_BOOT is gone.
* And linted!
* For consistency with the Closure documentation and base.js,
consistently refer to what blockly_uncompressed.js is used for as
"uncompiled mode" rather than "uncompressed mode" (but don't yet
rename it to blockly_uncompiled.js)
I had forgotten that I needed to change the value of BUILD_DIR
in several different places.
Added comments warning future editors about this as well as filing
issue #5007 to track fixing this properly.
Despite being misconfigured and therefore failing, the typescript
and metadata test scripts were exiting with status 0, indicating
successful completion. These have been fixed so they should fail
on any error, including misconfiguration.
- Reconfigure package_tasks.js to use BUILD_DIR from config.js
(i.e., build/) rather than repository root as source of files to
package.
- Add check to packageTasks.package to ensure that certain required
files exist in BUILD_DIR, to verify that buildTasks.build and
typings.typings have been run.
- Fix packageUMDBundle to use generated, rather than checked-in
version of en.js.
- Fix packageDTS to use the generated (rather than checked-in)
versions of blockly.d.ts and msg/*.d.ts.
- Modify run_all_tests.sh to run packageTasks.package before running
node tests, since they depend on it. Previously this was only
working because 'npm install' runs the 'prepare' script, which would
run the 'package' script - so the code being tested by the node tests
was not the current source but whatever precomipled code had
previously been checked in.
- Remove the 'prepare' script from package.json, since it is no longer
needed (and is now broken, since it requires that build and typings
have been done first.) Note that no scripts at all are included in
the version of package.json that is created in dist/ and subsequently
included in the published npms, so this deletion does not affect what
happens when the Blockly npm in installed - it only affects what
happens when 'npm install' is run after the blockly repo is cloned.
- Factor out the actual recompilation steps from releaseTasks.recompile.
- Rename releaseTasks.recomple to recompileDevelop, since it deals
specifically with the develop branch. (The npm script name is
unchanged.)
- Ensure that a full recompile and repackage is done before publishing
(beta and non-beta) npms.
* Modify scripts/gulpfiles/typings.js to write typings to BUILD_DIR.
* Modify tests/scripts/compile_typings.sh to check compilability of
resulting output from BUILD_DIR.
* Rename checkin script to checkin:built, add a checkin:typings script
to do the same for .d.ts files, and a new checkin script to do both.
* Have recompile run checkin:typings.
The documented release process is to do npm run recompile, merge the
resulting branch to develop, and then do npm run relase, which does
not do another build.
This process should probably be changed, but for the moment ensure
that npm run recompile (as well as npm run package:beta) runs
buildTasks.checkinBuilt after each .build to preserve the old procedure.