Commit Graph

392 Commits

Author SHA1 Message Date
Christopher Allen
335ff199d7 refactor: Update uncompiled-mode dependency loading for playground, tests (#5715)
* chore: rename module Blockly.blocks.Lists to ....lists

All the other Blockly.blocks modules have lower-case names.  This
one being named with an upper-case initial appears to have been a
typo on my part.

This module name is not mentioned anywhere else in the source code
(though it will be soon!) so no other files need to be edited.
Further, it does not appear anywhere in the last release (which
before PR #5696) so it is not necessary to add an entry in
renamings.js for this change.

* chore(build): Rationalise deps.js, deps.mocha.js

* Include blocks/*.js (Blockly.blocks.*) in tests/deps.js, since
  these modules are used in the playground.  (They are goog.provide
  modules loaded via <script> tags, so their absence from deps.js
  does not cause errors - but it will when they are migrated to
  goog.module and must be loaded via goog.require.)

* Filter the entries in deps.mocha.js so that it includes only the
  additional mocha test modules (i.e. those not mentioned in deps.js
  already).

* refactor: Load blocks and generators using goog.require
2021-11-17 00:04:45 +00:00
Neil Fraser
1fcae953fc fix: Quote Msg prop name to survive compile (#5703) 2021-11-10 12:45:19 -08:00
Rachel Fenichel
f14a1c8034 chore: fix more lint (#5676)
* chore: fix assorted lint

* chore: clang-format

* chore: clang-format
2021-11-08 16:41:52 -08:00
Christopher Allen
beefe361a3 fix!(blocks): Rename Blockly.Blocks.* modules to Blockly.blocks.* (#5696)
Use Blockly.blocks.* for blocks modules, leaving the Blockly.Blocks
name for the block dictionary object.

This resolves a problem with advanced compilation of Blockly Games,
 where, in the compressed output, (the minified name of)
 Blockly.Blocks gets overwritten, with the dictionary object defined in
 core/blocks.js being replaced by an empty namespace object
 created by the provides of Blockly.Blocks.* in blocks/*.js. Without
 this fix, some block definitions end up being created in the
 dictionary and some on the namespace object—with chaos
 predictably ensuing.
2021-11-08 18:35:38 +00:00
Rachel Fenichel
c75e944f06 chore: remove references to JSON extraction (#5683) 2021-11-05 18:28:52 -07:00
Rachel Fenichel
6dc0f90959 chore: replace var with const and let in blocks directory (#5626)
* chore: use const and let in blocks/lists.js

* chore: use const and let in blocks/logic.js

* chore: use const and let in blocks/loops.js

* chore: use const and let in blocks/math.js

* chore: use const and let in blocks/procedures.js

* chore: use const and let in blocks/text.js

* chore: use const and let in blocks/variables_dynamic.js

* chore: use const and let in blocks/variables.js

* fix: updateShape_ variable scoping

* fix: declarations in switch clauses

* other: change while loops to for loops

* fix: fix violation of no-cond-assign
2021-10-21 14:25:37 -07:00
Rachel Fenichel
e8d6f7f408 chore: auto-fix violations of comma-dangle rule (#5625) 2021-10-21 09:01:51 -07:00
Neil Fraser
90b3f75d82 Remove @author tags (#5601)
Our files are up to a decade old, and have churned so much, that the initial author of the file no longer has much meaning.

Furthermore, this will encourage developers to post to the developer group, rather than emailing Googlers (usually me) directly.
2021-10-15 09:50:46 -07:00
Neil Fraser
c929b3015b chore: Convert == to === and != to !== where possible. (#5599) 2021-10-15 09:17:04 -07:00
Christopher Allen
16b6d4526a refactor: Rename Blockly.Blocks, migrate to named exports (#5515)
* Rename Blockly.Blocks to Blockly.blocks
  Because it does not export a type as its default export.

  Part of #5073.

* Name default export of Blockly.blocks Blocks.

  Use named exports in Blockly.blocks by giving the former default
  export the name Blocks.

  Part of #5153.

* Reexport Blockly.blocks from blockly.js

* Document the format of renamings.js better.
2021-09-24 19:12:03 +01:00
kozbial
6fc90213a6 Merge branch 'develop' into merge-develop-to-goog_module 2021-09-21 16:04:33 -07:00
Beka Westberg
ee78b41987 feat: upgrade block defs to have JSO serialization hooks (#5329)
* Respect nulls from blocks.save

* Upgrade list blocks to use JSO serialization

* Upgrade logic blocks to use JSO serialization

* Upgrade math blocks to use JSO serialization

* Upgrade text blocks to use JSO serialization

* Upgrade procedure blocks to use JSO serialization

* Add more mutator tests

* Fix firing enabled events

* PR Comments
2021-09-20 13:08:35 -07:00
Neil Fraser
ae39fb9e23 Add supressPrefixSuffix to if/else block
Alternatively, this could be done by using an extension, rather than JSON.  I have no preference.
Issue #5268.
2021-08-04 10:19:25 -07:00
Christopher Allen
1197afcee7 Fix JSDoc type annotations causing closure-make-deps warnings
Some type annotations were missing curly brackets, which makes
closure-make-deps emit uninteresting warnings.  Now any output
from the command will be informative and related to whatever
one is presently working on.
2021-07-12 03:17:14 +01:00
Neil Fraser
d919b0af21 Update JSDoc from Array.<> to Array<>
Same with Object.
2021-05-27 21:30:26 -07:00
Grayson Nix
3d22f8401e Issue #4475 fix (#4758)
* Issue #4475 fix
2021-04-08 16:01:16 -07:00
Maribeth Bottorff
55a453dab9 update break block even if it's not the dragged block (#4533) 2020-12-14 11:40:25 -08:00
Beka Westberg
04ea0f1397 Fixes mutators considering insertion markers during compose (#4449)
* Fix markers for lists, logic, and text

* Fix insertion markers in procedure mutators
2020-11-17 13:32:36 -08:00
Monica Kozbial
dd0d5aee53 Adding procedure tests and handling procedures instantiated without name (#4428)
* Expand procedure tests and fix bug with default ids

* Add tests

* Remove xml_procedures_test.js and add non-overlapping test cases into procedures_test.js
2020-11-06 11:48:48 -08:00
Rachel Fenichel
7288c66294 Rename connectionTypeChecker->connectionChecker 2020-07-16 17:40:13 -06:00
Rachel Fenichel
e24f3cef9b Add isDragging to canConnectWithReason and delete newly unused code paths. 2020-07-16 17:40:13 -06:00
Rachel Fenichel
bb8348befd Move to a single canConnect function, and update tests 2020-07-16 17:40:12 -06:00
Rachel Fenichel
c743a92bb9 Start work on connection type checker 2020-07-16 17:40:12 -06:00
Monica Kozbial
638ecf6023 Adding getter to procedures call for arguments_. (#3983) 2020-06-22 15:28:31 -07:00
Beka Westberg
79ce850cf8 Fix procedure callers accessing private vars 2020-04-11 16:16:25 -07:00
Monica Kozbial
a9223b0b22 Typo fixes. (#3769) 2020-03-25 15:47:27 -07:00
Jakub Vrána
00bb99e0ff Add non-nullable modifier to return type of functions never returning null (#3742) 2020-03-16 08:14:47 -07:00
Beka Westberg
fabb8c44b1 Fix procedure args handling case incorrectly 2020-02-23 10:12:08 -08:00
Beka Westberg
5445cf4cf8 Add comments to break block change listener. 2020-02-19 14:40:28 -08:00
Beka Westberg
392d25eb39 fix: Break breaking undo. 2020-02-18 16:01:18 -08:00
Neil Fraser
4e2f8e6e02 Use SPDX licences.
This is a followup to #3127.
At the time, SPDX licenses were pending approval by Google.
2020-02-11 13:27:20 -08:00
Sam El-Husseini
0bc8960d79 Update list and text create block to right align its value inputs (#3667) 2020-01-30 17:05:00 -08:00
Monica Kozbial
e2b510662c Fixing typo on "programmatically". (#3654) 2020-01-24 15:10:22 -08:00
Beka Westberg
6d1bb201f7 feat: Improved procedure arg interaction. (#3527)
* feat: Improved procedure arg interaction.

* Added docs.

* Fixed typos and typings.

* Fixed typings?

* Changed visibility to private.
2020-01-07 13:55:46 -08:00
Beka Westberg
1ce97d1c50 Added checking if the block is disposed before trying to reconnect in logic_compare block. 2019-11-04 14:41:45 -08:00
Neil Fraser
22c1eba546 Make warnings an optional module. 2019-11-01 11:52:12 -07:00
Neil Fraser
123f436e04 Add parens around inline assignments (#3381) 2019-10-31 15:17:35 -07:00
Sam El-Husseini
52bef4463c Fix warnings related to connections. (#3306)
* Fix warnings related to connections.
2019-10-23 17:56:52 -04:00
Sam El-Husseini
664cc3d6cd Fix warnings related to number of arguments passed. (#3270) 2019-10-17 11:47:30 -05:00
Sam El-Husseini
2ac4149d98 Misc compiler warnings. (#3172)
* Fix misc compiler warnings. Use ws.getToolbox() instead of ws.toolbox_
2019-10-07 11:06:56 -07:00
Sam El-Husseini
d0772ad496 Fix compiler warnings related to fields. (#3144)
* Fix compiler warnings related to fields.
2019-10-03 15:58:46 -07:00
Neil Fraser
b46a4fe286 Bring our license format up to date (#3127)
* Google changed from an Inc to an LLC.

This happened back in 2017 but we didn’t notice.  Officially we should update files from Inc to LLC when they are changed as part of regular edits, but this is a nightmare to remember for the next decade.

* Remove project description/titles from licenses

This is no longer part of Google’s header requirements.  Our existing descriptions were useless (“Visual Blocks Editor”) or grossly obselete (“Visual Blocks Language”).

* License no longer requires URL.

* Fix license regexps.
2019-10-02 14:46:56 -07:00
Neil Fraser
a1e3973499 Make block comments an optional module. (#3053)
Measured as a 5 KB *increase* in code size, but that's because some other commit just landed between my tests. It's like running down an up escalator.
2019-09-19 14:53:28 -07:00
Neil Fraser
84a814cda1 Make mutator an optional module. (#3048) 2019-09-19 11:39:55 -07:00
Beka Westberg
093467aed1 Added More Procedure Unit Tests (#2630)
* Added more procedure unit tests.

* Cleanup from rebase.

* Cleanup.
2019-09-18 16:14:06 -07:00
Neil Fraser
0add3a5e3e Add require statements to all block files. 2019-09-18 13:00:44 -07:00
Neil Fraser
5650fe51a2 Typos. 2019-09-12 18:24:48 -07:00
Rachel Fenichel
6f4476c962 Textarea Field, Multiline Block (from acbart) (#2663)
* Field Textarea, text_multiline block, generators
2019-09-11 17:57:46 -07:00
Rachel Fenichel
f717add5a5 Block annotations (#2997)
* Replace `@this Blockly.Block` with `@this {Blockly.Block}` in all block files.

* Fix 9 compiler warnings (JSC_USED_GLOBAL_THIS)
2019-09-11 17:50:52 -07:00
RoboErikG
a7b560db81 Revert "Mark Blockly.Constants.Colour and .Lists depreacted. (#1797)"
This reverts commit b2cb96b5b1.
2019-09-05 15:34:20 -07:00