* refactor(build): Don't use closure-calculate-chunks
Rewrite the getChunkOptions function to not use
closure-calculate-chunks, but instead just chunk the input files
(more or less) by subdirectory: first chunk is core/, second is
blocks/, etc.
This does make a material change to blockly_compressed.js,
because we end up feeding several empty modules that contain
only typescript interface declarations and which tsc
compiles to "export {};" in the input to Closure Compiler
(closure-calculate-chunks is smart enough to notice that
no other module depends on these), which results in ~1.7KiB of
superflous
var module$build$src$core$interfaces$i_ast_node_location_svg={};
declarations. This can be avoided by filtering such empty modules
out but that has been left for a future commit.
This adds the glob NPM package as a dev dependency, but gulp
and several other existing dev dependencies already depend on
it.
Build time is sped up by about a factor of 3x, due to removal
of the buildDeps step that was really slow:
$ time npm run build
before:
real 0m24.410s
user 0m16.010s
sys 0m1.140s
after:
real 0m8.397s
user 0m11.976s
sys 0m0.694s
* chore(build): Remove buildDeps task
* refactor: Remove $build$src infix from munged paths
Closure Compiler renames module globals so that they do not
clash when multiple modules are bundled together. It does so
by adding a "$$module$build$src$path$to$module" suffix (with
the module object istelf being named simply
"$module$build$src$path$to$module").
By changing the gulp.src base option to be build/src/ instead
of ./ (referring to the repostiory root), Closure Compiler
obligingly shortens all of these munged named by removing the
"$build$src" infix, reducing the size of the compressed chunks
by about 10%; blockly_compressed.js goes from 900595 to 816667
bytes.
* chore(build): Compute module object munged name from entrypoint
- Add modulePath to compute the munged name of the entrypoint
module from the entrypoint module filename, and use this
instead of hard-coded chunk.exports paths.
- Be more careful about when we are using poxix vs. OS-specific
paths, especially TSC_OUTPUT_PATH which is regularly passed
to gulp.src, which is documented as taking only posix paths.
- Rename one existing variable modulePath -> entryPath to try
to avoid confusion with new modulePath function.
* refactor(tests): Use shims instead of bootstrap to load Blockly
- Modify tests/generators/index.html to import the test shims
instead of using bootstrap.js to load Blockly.
- Modify test/generators/webdriver.js to have it wait for the
workspace to exist before calling loadSelected(). There was
previously a race which index.html had been winning, but
now webdriver.js is winning (and the tests failing because
there is no workspace yet when start() is called.
* chore(tests): Delete bootstrap.js etc.
- Delete bootstrap.js, bootstrap_helper.js, and bootstrap_done.mjs.
- Remove remaining references to bootstrap.js
* refactor(build): Remove deps npm script
buildDeps is now only needed by buildCompiled, not ever for
runnning in uncompressed mode, so:
- Remove the deps gulp task (and the deps npm script.
- Have the minify task run buildJavaScript and buildDeps directly.
Additionally, the buildAdvanceCompilationTest target hasn't
needed deps.js for some time (if ever), so skip having it run
buildDeps entirely.
* refactor(build): Repatriate DEPS_FILE to build_tasks.js
Since this is no longer used anywhere else it doesn't need to
live in common.js.
* fix(scripts): Remove vestigial references to deps.mocha.js
* docs(tests): Add additional explanatory note
* fix: update build path for windows
When using single quote on windows, e.g. 'build/src', the folder
are created with a single quote at the beginning `'build` and end
`src'`. This commit fixes this issue.
* fix: update python command and folder separator
Ensure that when running on windows, python command is python and
not python3. Also, separators are normalized to posix style `/` even on
windows system
* fix: add global PYTHON constant to run python command
* fix: simplify `path.sep` to forwadslash since it is cross-platform
* fix(syntax): replace double quote with single quote
Move tests/browser/test/.mocharc.js to tests/browser and use
__dirname to make the require directive work regardless of where
mocha is invoked from.
Simplify the browser:test script accordingly, taking advantage
also of the mocha default of running all tests in the test/
subdirectory.
* fix(generators): Changes to exports and access controls for TypeScript compatibility (#7295)
* fix(generators): Add missing declarations for Order enums
* chore(generators): Remove spurious whitespace
* fix(generators): Make provideFunction_ etc. public
Remove the protected declaration on provideFunction_ and
FUNCTION_NAME_PLACEHOLDER_ so they can be used from generator
functions written in TypeScript.
Not strictly part of #7283, but closely related and required to
fixing the related issue google/blockly-samples#1785.
* chore(generators): format
(cherry picked from commit d503fbb409)
* fix: Correct errors in `HSV_SATURATION`, `HSV_VALUE` accessors (#7297)
* fix: Correct errors in HSV_SATURATION, HSV_VALUE accessors
Fix the comment / message errors noted in
https://github.com/google/blockly/pull/7249#issuecomment-1638645810
* chore: Add renamings for HSV_SATURATION, HSV_VALUE
(cherry picked from commit 1bc4f67d78)
* release: Update version number to 10.0.2
---------
Co-authored-by: Christopher Allen <cpcallen+git@google.com>
* chore(deps): Bump @hyperjump/json-schema from 0.23.3 to 1.5.0
Bumps [@hyperjump/json-schema](https://github.com/hyperjump-io/json-schema) from 0.23.3 to 1.5.0.
- [Commits](https://github.com/hyperjump-io/json-schema/compare/v0.23.3...v1.5.0)
---
updated-dependencies:
- dependency-name: "@hyperjump/json-schema"
dependency-type: direct:development
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
* chore(tests): Compatibility updates to validate-renamings.js
A minimal set of updates to validate-renamings.js to make it
compatible with @hyperjump/json-schema v1.5. The main difference
is that that package now ships ESM rather than CJS modules,
forcing the script to use import rather than require, with
various knock-on effects (no __dirname variable, must be named
*.mjs, etc.)
* chore(tests) Remove unneeded IIFE
* chore(tests): Additional tidy-up of ESM version
Now that validate-renamings is an ES module, we can do some other
cleanup to it.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christopher Allen <cpcallen+git@google.com>
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo