* fix(build): Correctly handle out-of-order chunks
It turns out that closure-calculate-chunks does not guarantee that
calculated chunks will be output in the same order as the
entrypoints, so modify getChunkOptions so that it no longer makes
that assumption.
* refactor(build): Introduce NAMESPACE_PROPERTY; rename NAMESPACE_OBJECT
Rename the constant NAMESPACE_OBJECT to NAMESPACE_VARIABLE to
better explain its actual meaning, and introduce
NAMESPACE_PROPERTY to specify what property the namespace object
will be stored in (and change the previous value, "internal_",
to "__namespace__" to reduce the chance of conflicts with
properties created by the output of Closure Compiler).
* refactor(build): Always save namespace object on chunk exports object
This is so that chunks whose parent chunk is not the root chunk
(chunks[0]) can obtain the namespace object. (See following commit.)
* fix(build): Correct handling of chunk dependencies
Previously getChunkOptions and chunkWrapper incorrectly assumed
that a chunk could have more than one dependency.
In fact, each chunk can have only a single dependency, which is
its parent chunk. It is used only to retrieve the namespace
object, which is saved on to the exports object for the chunk so
that any child chunk(s) can obtain it.
Update getChunkOptions and chunkWrapper (making the latter
longer but more readable) accordingly.
* refactor(build): Rename/repurpose chunk.exports -> .reexport
And remove chunk.importAs, since it was no longer being used
anywhere.
* fix: remove unnecessary s from reexports
Co-authored-by: alschmiedt <aschmiedt@google.com>
* feat(tests): Add a test script for the renamings file
* Make scripts/migration/renamings.js a valid JSON5 file.
* Add a schema for it in tests/migration/renamings-schema.json.
* Add a script to test one against the other, as
tests/migration/validate-renamings. It is a node.js script
that will exit 0 if the renamings file is valid, or 1 if it
is not (and print a not-very-helpful error message from which
is possible, with some effort, to deduce what the error is.)
* fix: convert to JSON5 and refactor example
* fix: convert keys to new key names
* fix: change versions to arrays instead of objects
* fix: fix version numbers
* fix: associate renames with the version where they were added
* fix: fixup example
* fix: put older renames at the bottom, and newer renames at the top
* fix: enable renamings test in run_all_tests
* fix: put newer renames back at the bottom
This reverts commit efe070e344.
* fix(tests): add missing additionalProperties: false to schema
And fix the resulting validation error in the example entry.
* chore(tests): Improve wording of example entry; add extra examples
Tweaked line wrapping of some existing entries (example and
acutal) that were otherwise untouched.
* feat: add dropDownDiv renaming to new database
* feat(tests): Check for duplicate entries for the same module
Also fixed extraneous whitespace in run_all_tests.sh
* fix(tests): Make validate-renamings.js compatible with node.js v12
Also remove success message, to adhere to usual unix convention
(silence implies success) as eslint does, and reduce unecessary
npm test output clutter.
* fix(tests): Fixes for PR #5980
* Fix typos.
* Remove redundant check.
Co-authored-by: Beka Westberg <bwestberg@google.com>
* Revert "fix: lint"
This reverts commit 050956d105.
* Revert "fix: run mocha as a module"
This reverts commit 4dac25ae99.
* Revert "move to modules, but break mocha"
This reverts commit 220d7bbd1d.
* refactor(tests): Migrate tests/compile/main.js to goog.module
* feat(tests): Enable --debug for test:compile:advanced; demote errors
* Enable the --debug flag when running the
buildAdvancedCompilationTest gulp task.
* Remove partialAlias diagnostic group from `JSC_ERROR`, demoting
JSC_PARTIAL_NAMESPACE to warning.
Reverts "Revert 'fix(tests): Enable --debug for test:compile:advanced;
fix some errors (#5959)'".