* Bump ws from 7.4.4 to 7.5.1
Bumps [ws](https://github.com/websockets/ws) from 7.4.4 to 7.5.1.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.4...7.5.1)
---
updated-dependencies:
- dependency-name: ws
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
* Bump lodash from 4.17.19 to 4.17.21
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)
---
updated-dependencies:
- dependency-name: lodash
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
* Initial commit for appengine deploy action
* Update comments to be more descriptive
* Get deploy files from the correct directory
Previous path was `_deploy/`. New path is `../_deploy`.
* Create Github Action to comment on PR while develop is frozen (#5006)
* Create develop_freeze_comment.yml
* Update comments
* Fix typo and update uses
* Add test message
* Revert "Create Github Action to comment on PR while develop is frozen (#5006)" (#5013)
This reverts commit 8c635b5fbc.
* Revert "Get deploy files from the correct directory"
* Bump hosted-git-info from 2.8.4 to 2.8.9 (#4980)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.4 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.4...v2.8.9)
---
updated-dependencies:
- dependency-name: hosted-git-info
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Pull Request template for goog.module PRs
Provide a standard pull request template more suited to PRs doing
goog.module conversions.
There's no way to pick a non-default template when creating a PR
manually, but this one can be used by adding
"&?template=goog_module.md" to the
https://github.com/cpcallen/bugs/compare/ URL.
* Update goog_module.md with suggested fixes
* Fix typos.
* Reinstate "Proposed Changes" section.
* Mark text that should be edit with ALL CAPS.
* Bump normalize-url from 4.5.0 to 4.5.1
Bumps [normalize-url](https://github.com/sindresorhus/normalize-url) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/sindresorhus/normalize-url/releases)
- [Commits](https://github.com/sindresorhus/normalize-url/commits)
---
updated-dependencies:
- dependency-name: normalize-url
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
* Bump trim-newlines from 3.0.0 to 3.0.1
Bumps [trim-newlines](https://github.com/sindresorhus/trim-newlines) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/sindresorhus/trim-newlines/releases)
- [Commits](https://github.com/sindresorhus/trim-newlines/commits)
---
updated-dependencies:
- dependency-name: trim-newlines
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
* Bump path-parse from 1.0.6 to 1.0.7
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)
---
updated-dependencies:
- dependency-name: path-parse
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
* Bump postcss from 7.0.35 to 7.0.36 (#4928)
Bumps [postcss](https://github.com/postcss/postcss) from 7.0.35 to 7.0.36.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/7.0.35...7.0.36)
---
updated-dependencies:
- dependency-name: postcss
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Rollup of all Q3 message changes (#5565)
Courtesy of Translatewiki
* Add Croatian to Code demo (#5583) (#5611)
Contributed courtesy of Lidija Kralj.
* chore: create release.yml (#5588)
* Create release.yml
* chore: update release.yml
* chore: update dependabot messages and labels (#5653)
The same as #5618, but against master because dependabot ignores changes on develop.
* chore: Create separate report_clang_format workflow in master branch (#5670)
The initial version of this workflow just uses `console.log` to report
the context of the `context` object. It is hoped that there will
be enough information in this context to identify the PR to comment on,
without the `check_clang_format` workflow having to upload a
'build artefact' of some kind - see example of what I hoe to avoid
starting at `ReceivePR.yml` here:
https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
A follow-up PR will (if possible) add the code to create comments
when `check_clang_format` fails.
Part of #5659.
* chore: Remove spurious extra `on` clause in report_clang_format.yml (#5671)
Removes an unwanted `on` clause that was overlooked in #5670 by author and reviewer.
* chore: More spelunking in GitHub Action data (#5673)
Looking for information about PR that triggered original
check_clang_format run.
* chore: revert github action (#5675)
* fix: Don't try to set text fields to null on cancel (#5692)
Mobile users get a window.prompt as an input, if they press the cancel button the return value is null. Don't attempt to set the value of the field to null.
Caused errors in the custom note field which inherits from FieldTextInput. Detected in Blockly Games Music.
This PR is for the master branch and includes a recompile. The develop branch has changed enough that a cherrypick from develop to master won't work. The bug in question represents a significant number of the errors being reported from Blockly Games.
* Update dependabot.yml (#5705)
* chore: run clang-format
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Monica Kozbial <6621618+moniika@users.noreply.github.com>
Co-authored-by: Christopher Allen <cpcallen+git@google.com>
Co-authored-by: Neil Fraser <fraser@google.com>
Co-authored-by: alschmiedt <aschmiedt@google.com>
* chore: Remove requires that duplicate those in blockly.js
* refactor: Remove core/requires.js, make blockly.js be entry point
It sort of makes sense, doesn't it?
The only remaining require not duplicated in `blockly.js` was that for
`Blockly.themes.Classic`, but it is already required by
`Blockly.themes` (itself required by `Blockly`).
* fix(test): Fix advanced compilation test
- Fix loading of blocks in `tests/compile/main.js` caused by
recent `goog.module`-ification work.
- Fix problem caused by ADVANCED_OPTIMISATIONS renaming the Msg
property on the fake Blockly object created by the
translation-loading hack in `blockly.js`.
* chore(build): Reenable advanced compilation test
Fixes#5602.
* chore: Fix inadvertent block migration inconsistencies
- Reinstate `goog.require`s-for-side-effects that were inadvertently
removed.
- Always use a destructuring import for `defineBlocksWithJsonArray`.
- Consistently use `CONSTANT_CASE` names for block-common objects.
(We could alternatively always use `camelCase` names, but since
all the `MIXIN`s and `EXTENSIONS` remain all-uppercase this seems
the more consistent.)
* chore: Fix import ordering
* chore: Clean up NPM package module wrappers
- Slightly improve documentation for each file based on helpful
explanations given by @samelhusseini.
- Removed redundant code---e.g., loading `javascript_compressed.js`
creates and sets Blockly.JavaScript as a side effect, so there is
no need to set `Blockly.JavaScript = BlocklyJavaScript` in
`dist/javascript.js` (generated from `scripts/package/javascript.js`).
- Remove possibly harmful code---e.g., `Blockly.Msg` is initialised
with a null-prototype object in `blockly_compressed.js` and that
initial object should under no circumstances be replaced.
- Remvoe downright misleading code---e.g., `dist/blocks.js` previously
_appeared_ to replace Blockly.Blocks with an empty object, but in
fact the `Blockly` name referred at that point to the exports object
from `blocks_compressed.js`, which would randomly get a useless
`{}`-valued `.Blocks` property tacked on to it; similarly, code in
`dist/browser.js` (generated from `scripts/package/browser/index.js`)
appeared to copy definitions from `BlocklyBlocks` to `Blockly.Blocks`,
but the former would always be (the aforementioned) empty object,
making this code ineffective.
* chore: Improve chunk definition / UMD generation
Make several improvements to the chunks global and chunkWrapper
function:
- Document chunk definition format (and improve the names of
of the documented properties).
- Replace the chunk `.namespace` property with two others:
- `.exports` names the variable/property to be returned by the
factory function, and which will be set on the global object if
the module is loaded in a browser.
- `.importAs` names the parameter that this chunk's exports value
is to be passed to the factory function of other chunks which
depend on this one. (This needs to be different because e.g.
`Blockly.blocks` is not a valid parameter name.)
- Change the definition for the blocks chunk to export Blockly.Blocks
(i.e., the block definition dictionary) as blocks_compressed.js
did previous to PR #5721 (chunked compilation), rather than the
(empty and soon to vanish) Blockly.blocks namespace object.
This is a win for backwards compatibility, though it does mean that
if we want to expose the `loopTypes` export from `blocks/loops.js`
we will need to find a different way to do so.
* refactor: convert generators/python/colour.js to goog.module
* refactor: convert generators/python/colour.js to named requires
* chore: run clang-format
* refactor: convert generators/python/lists.js to goog.module
* refactor: convert generators/python/lists.js to named requires
* chore: run clang-format
* refactor: convert generators/python/logic.js to goog.module
* refactor: convert generators/python/logic.js to named requires
* chore: run clang-format
* refactor: convert generators/python/loops.js to goog.module
* refactor: convert generators/python/loops.js to named requires
* chore: run clang-format
* refactor: convert generators/python/math.js to goog.module
* refactor: convert generators/python/math.js to named requires
* chore: run clang-format
* refactor: convert generators/python/procedures.js to goog.module
* refactor: convert generators/python/procedures.js to named requires
* chore: run clang-format
* refactor: convert generators/python/text.js to goog.module
* refactor: convert generators/python/text.js to named requires
* chore: run clang-format
* refactor: convert generators/python/variables_dynamic.js to named requires
* refactor: convert generators/python/variables.js to named requires
* chore: run clang-format
* refactor: convert generators/python.js to goog.module
* refactor: convert generators/python.js to named requires
* chore: run clang-format
* chore: remove spurious @private annotations
* chore: rebuild
* refactor: convert generators/lua.js to goog.module
* refactor: convert generator/lua.js to named requires
* chore: run clang-format
* refactor: convert generators/php/colour.js to goog.module
* refactor: convert generators/php/colour.js to named requires
* chore: run clang-format
* refactor: convert generators/php/lists.js to goog.module
* refactor: convert generators/php/lists.js to named requires
* chore: run clang-format
* refactor: convert generators/php/logic.js to goog.module
* refactor: convert generators/php/logic.js to named requires
* chore: run clang-format
* refactor: convert generators/php/loops.js to goog.module
* refactor: convert generators/php/loops.js to named requires
* chore: run clang-format
* refactor: convert generators/php/math.js to goog.module
* refactor: convert generators/php/math.js to named requires
* chore: run clang-format
* refactor: convert generators/php/procedures.js to goog.module
* refactor: convert generators/php/procedures.js to named requires
* chore: run clang-format
* refactor: convert generators/php/text.js to goog.module
* refactor: convert generators/php/text.js to named requires
* chore: run clang-format
* refactor: convert generators/php/variables.js to goog.module
* refactor: convert generators/php/variables.js to named requires
* chore: run clang-format
* refactor: convert generators/php/variables_dynamic.js to goog.module
* refactor: convert generators/php/variables_dynamic.js to named requires
* refactor: convert generators/php.js to goog.module
* refactor: convert generators/php.js to named requires
* chore: run clang-format
* chore: rebuild deps.js
* refactor: convert generators/lua/colour.js to goog.module
* refactor: convert generators/lua/colour.js to named requires
* chore: run clang-format
* refactor: convert generators/lua/lists.js to goog.module
* refactor: convert generators/lua/lists.js to named requires
* chore: run clang-format
* fix: use getListIndex helper function in lua list generators
* refactor: convert generators/lua/logic.js to goog.module
* refactor: convert generators/lua/logic.js to named requires
* chore: run clang-format
* refactor: convert generators/lua/loops.js to goog.module
* refactor: convert generators/lua/loops.js to named requires
* chore: run clang-format
* refactor: convert generators/lua/math.js to goog.module
* refactor: convert generators/lua/math.js to named requires
* chore: run clang-format
* refcator: convert generators/lua/procedures.js to goog.module
* refactor: convert generators/lua/procedures.js to named requires
* chore: run clang-format
* chore: rebuild deps.js
* refactor: convert generators/lua/text.js to goog.module
* refactor: convert generators/lua/text.js to named requires
* refactor: convert generators/lua/variables_dynamic.js to goog.module
* refactor: convert generators/lua/variables_dynamic.js to named requires
* chore: run clang-format on text.js
* refactor: convert generators/lua/variables.js to goog.module
* refactor: convert generators/lua/variables.js to named requires
* chore: run clang-format
* chore: make a lua generator function internal
* chore: rebuild deps.js
* refactor: convert generators/javascript.js to goog.module
* refactor: convert generators/javascript.js to named requires
* chore: run clang-format
* refactor: convert generators/dart/variables.js to goog.module
* refactor: convert generators/dart/variables.js to named requires
* chore: run clang-format
* refactor: convert generators/dart/variables_dynamic.js to goog.module
* refactor: convert generators/dart/variables_dynamic.js to named requires
* refactor: convert generators/dart/text.js to goog.module
* refactor: convert generators/dart/text.js to named requires
* chore: run clang-format
* refactor: convert generators/dart/procedures.js to goog.module
* refactor: convert generators/dart/procedures.js to named requires
* chore: run clang-format
* refactor: convert generators/dart/math.js to goog.module
* refactor: convert generators/dart/math.js to named requires
* chore: run clang-format
* refactor: convert generators/dart/loops.js to goog.module
* refactor: convert generators/dart/loops.js to named requires
* chore: run clang-format
* refactor: convert generators/dart/logic.js to goog.module
* refactor: convert generators/dart/logic.js to named requires
* chore: run clang-format
* refactor: convert generators/dart/lists.js to goog.module
* refactor: convert generators/dart/lists.js to named requires
* chore: run clang-format
* refactor: convert generators/dart/colour.js to goog.module
* refactor: convert generators/dart/colour.js to named requires
* chore: rebuild deps.js
* chore: lint
* refactor: convert generators/javascript/colour.js to goog.module
* refactor: convert generators/javascript/colour.js to named requires
* chore: run clang-format
* refactor: convert generators/javascript/lists.js to goog.module
* refactor: convert generators/javascript/lists.js to named requires
* chore: run clang-format
* refactor: convert generators/javascript/logic.js to goog.module
* refactor: convert generators/javascript/logic.js to named requires
* chore: run clang-format
* refactor: convert genereators/javascript/math.js to goog.module
* refactor: convert generators/javascript/math.js to named requires
* chore: rebuild deps.js
* refactor: convert generators/javascript/procedures.js to goog.module
* refactor: convert generators/javascript/procedures.js to named requires
* chore: run clang-format
* refactor: Turn .getSurroundLoop into a (Block) method
This considerably simplifies the code in the genrators, obviating
the need for generators to import Blockly.Constants.Loops, and
allowing the compiler to remove blocks/loops.js from the first
(Blockly) chunk of the compilation.
(The latter could and should have been arranged by making the
generator chunks depend on the blocks chunk, but that is no longer
necessary.)
* refactor: Migrate blocks/loops.js to goog.module
* refactor: Migrate blocks/loops.js named requires
* chore: clang-format blocks/loops.js
* chore: migrate generators/javascript/text.js to goog.module
* chore: convert generators/javascript/text.js to named requires
* refactor: convert generators/javascript/variables.js to goog.module
* refactor: convert generators/javascript/variables_dynamic to goog.module
* chore: revert #5730
* fix: Fix compile failure due to incorrect visibility
The CONTROL_FLOW_IN_LOOP_CHECK_MIXIN is intended to be used outside of
blocks/ (it is, in particular, used in generators/) so it should have
been marked @public from the beginning.
* chore: migrate generators/dart.js to goog.module
* chore: migrate generators/dart.js to named requires
* chore: Update generators/dart.js to alphabetize imports
Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>
Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>
* chore: fix some missing requires in generators
* chore: fix missing requires in dart block generators
* chore: replace Blockly.isNumber with Blockly.utils.string.isNumber in generators
* chore: fix more missing requires in block generators
* Migrate blocks/procedures.js to goog.module
* Migrate blocks/procedures.js named requires
* clang-format blocks/procedures.js
* chore: Factor common methods out of block definitions
Addressing comments on PR #5736.
Also:
- Ensure that the `comma-dangle` rule will not be applied to
function parameter lists (even when multi-line).
- Update tests/node/.eslintrc.json to make the environment
node-specific and not pinned to es6.
* Migrate blocks/colour.js to goog.module
* Migrate blocks/colour.js named requires
This causes an apparently harmless reordering of the files for the
first chunk.
* clang-format blocks/colour.js
This constant is used to specify the alignment of
an Input, so it should live in the same file as the Input class.
I've done this as a separate named export, but it could alternatively
be made a static member of Input (i.e., Input.Align with only Input
being exported by name).
Where mocha tests were referring to Blockly.constants.ALIGN.*
without actually requiring Blockly.constants, I have reverted
them to refer to Blockly.ALIGN_* instead (pending conversion
to named requries).
Part of #5073.
* chore(build): Add "all" modules for blocks & generators
These modules (Blockly.blocks.all and Blockly.<Generator>.all) will
be the entry points for the corresponding chunks.
They also make it easier to pull in all the modules in each package
(e.g. for playground and tests).
It is necessary to set the Closure Compiler dependency_mode to
SORT_ONLY as otherwise it tries to compile the "all" modules before
their dependencies, which fails.
The only impact on the _compressed.js files is the addition of a short
string to the very end of each file, e.g.:
var module$exports$Blockly$JavaScript$all={};
* chore(deps): Add devDependency on closure-calculate-chunks
* feat(build): First pass at chunked complation
Add a new buildCompiled gulp target (npm run build:compiled) that
uses closure-calculate-chunks to do chunked compliation of core/,
blocks/ and generators/ all in a single pass.
This work is incomplete: the resulting *_compressed.js files don't
(yet) have UMD wrappers.
* chore(build): Generate chunk wrappers
A first pass; this does not have support for a namespace object yet.
* refactor(build): Use chunked compilation by default
Remove old "compressed" gulp tasks in favour of new "compiled" task.
* chore(build): Remove cruft from buildCompiled
Remove unneeded `done` parameter and commented-out options that had
been cargo-culted from the old build pipeline.
* fix(build): Fix test failures caused by new build pipeline
- Exclude closure/goog/base.js from compiler input; use
externs/goog-externs.js instead.
- Have the build:debug and build:strict targets only build the first
chunk (blockly_compressed.js).
- Fix namespace entries for blocks and generators.
* fix(build): Fix build failures on node v12
closure-calculate-chunks requires node.js v14 or later.
When running on node.js v14 or later have getChunkOptions save
the output of closure-calculate-chunks to
scripts/gulpfiles/chunks.json. When running on older versions of
node.js have it use this checked-in, cached output instead of
attempting to run closure-calculate-chunks.
* chore(build): enable --rename_prefix_namespace
This will allow modules in blocks/ and generators/ to use
goog.require to obtain the exports object of goog.modules from
core/.
* fix(build): Always build all chunks
The previous commit enabled --rename_prefix_namespace option to
Closure Compiler, and this causes the buildCompressed target to
work fine when run without --debug or --strict, but adding either
of those flags (as for example when `npm test` runs
`npm run build:debug`) causes an issue:
- Because of many compiler errors in blocks/ and generators/,
a previous commit added a hack to only build the first chunk
when doing debug/strict builds.
- When asked to build only one chunk, Closure Compiler ignores the
--rename_prefix_namespace flag, because it 'correctly' infers
that there are no later chunks that will need to access global
variables from the first chunk.
- This causes a test failure, because `npm test` first runs
`npm run build`, which generates a valid blockly_compressed.js,
but this is then overrwritten by an invalid one when it next runs
`npm run build:debug`.
(The invalid one is missing all `$.` prefixes on 'global' variables,
including on Blockly, so the wrapper's last two lines -
"$.Blockly.internal_ = $;" and "return $.Blockly" - fail.)
The fix is to add appropriate @suppress annotations to blocks/*.js and
generators/**/*.js and then remove the first-chunk-only hack.
* refactor(build): Just build once
Since the previous commit caused `npm run build:debug` to do
everything that `... build:compressed` does - and to produce
byte-for-byte identical output - it doesn't make sense to run
both when testing. To that end:
- Replace the build:debug and build:strict package scripts that
did `gulp buildCompressed --...` with new scripts build-debug
and build-strict that do `gulp build --...` instead.
(The target names are changed so as to extend our existing naming
convention as follows: a target named "foo:bar" does some sub-part
of the job done by target "foo", but a target named "foo-bar" does
all the work of the target "foo" with some extra options.)
- build:debug:log and build:strict:log are similarly replaced with
build-debug-log and build-strict-log.
- Modify run_all_tests.js to just do `npm run build-debug` instead of
doing both `npm run build` and `npm run build:debug`.
- Also remove the 'build:blocks' script that should have been removed
when the buildBlocks gulp task was deleted previously.
* refactor(build): Compile with base_minimal.js instead of base.js
Introduce a (very!) cut-down version of closure/goog/base.js named
base_minimal.js that is used as input to the compiler as an
alternative to using externs/goog-externs.js (which will be deleted
once the buildAdvancedCompilationTest target has been updated).
This will allow use of goog.setTestOnly since it will now exist in
compiled mode, and allows the changes made in 5b112db to filter
base.js out of the files for the first chunk to be reverted.
(It also obliges a change to the compiled-mode check in blockly.js.)
* fix(build): Fix buildAdvanceCompilationTest
- In build_tasks.js:
- Replace the old compile() function with a new one factored out of
buildCompiled().
- Update buildAdvancedCompilationTest to use the new compile()
and other helpers created in the meantime.
- Remove no-longer-used maybeAddClosureLibrary().
- Remove externs/{block,generator,goog}-externs.js, which are no longer
used by any compile pipeline.
- Update core/blockly.js to fix issue with detection of compiled mode
when using ADVANCED_OPTIMISATIONS.
- Update only other use of globalThis, in core/utils/xml.js, to
consistently treat it as a dictionary object.
- Update instructions in tests/compile/index.html.
This commit is sort-of-a-prerequisite to #5602; test:compile:advanced
was previously working but the generated `main_compresed.js` would
throw errors upon loading.
The e.pageX (and .pageY) checks aren't strict enough. 0 is a perfectly valid coordinate.
Checking for the existence of changedTouches is an easier way to distinguish a PointerEvent from a TouchEvent.
* Add new connection checks and tests
* Enable concurrent output and previous connections on blocks
* and remove assumption from unplug().
* Make changes compatible with new module system
* Fix issue do to Connection class change.
. and change some var's to const's now that that appears to be ok ;-)
* Fix more code that assumes only one of output and previous connections
* Change function name as per PR comment
* Fix lint errors
* Fix clang format issues
* chore: move remaining function definitions out of blockly.js
* chore: record renamings
* chore: add aliases to moved function jsdoc
* chore: add deprecation warnings in blockly.js
* chore: fix bad merge
* chore: move functions in response to PR comments
* chore: move isNumber to utils.string