Commit Graph

203 Commits

Author SHA1 Message Date
Beka Westberg
e2eaebec47 fix: convert the Workspace class to an ES6 class (#5977)
* fix: run conversion script on workspace

* fix: cleanup from conversion script

* fix: make debug build happy

* fix: tests

* fix: format

* fix: format
2022-03-16 13:22:03 -07:00
Aaron Dodson
328cd35d10 refactor: Migrate Blockly.Events.Abstract to named exports (#5916) 2022-02-04 15:32:33 -08:00
Rachel Fenichel
df2eafb8dd refactor: move properties into constructors and convert to classes (#5822)
* refactor: move properties to constructor in block_drag_surface.js

* refactor: move properties to constructor in block_svg.js

* refactor: move properties to constructor in block.js

* refactor: move properties to constructor in bubble.js

* refactor: move properties to constructor in connection.js

* refactor: move properties to constructor in flyout_base.js

* refactor: move properties to constructor in flyout_button.js

* refactor: move properties to constructor in generator.js

* refactor: move properties to constructor in grid.js

* refactor: move properties to constructor in input.js

* refactor: move properties to constructor in mutator.js

* refactor: move properties to constructor in scrollbar.js

* refactor: move properties to constructor in trashcan.js

* refactor: move properties to constructor in warning.js

* refactor: move properties to constructor in workspace_audio.js

* refactor: move properties to constructor in workspace_drag_surface_svg.js

* refactor: move properties to constructor in workspace_svg.js

* refactor: move properties to constructor in workspace.js

* refactor: move properties to constructor in zoom_controls.js

* chore: rebuild

* refactor: convert zoom_controls.js to es6 class and format

* refactor: convert workspace_audio.js to es6 class and format

* refactor: convert workspace_dragger.js to es6 class and format

* refactor: convert workspace_drag_surface_svg.js to es6 class and format

* refactor: convert variable_model.js to es6 class and format

* refactor: convert variable_map.js to es6 class and format

* refactor: convert theme.js to es6 class and format

* chore: remove bad comment
2022-01-06 13:13:40 -08:00
Rachel Fenichel
075385c87c chore: move remaining functions out of utils.js (#5714)
* chore: move arrayRemove to a new utils.array namespace

* chore: move getBlockTypeCounts out of utils.js

* chore: remove last functions from utils.js

* chore: reorder imports

* chore: add re-export for runAfterPageLoad
2021-11-15 18:12:45 -08:00
Aaron Dodson
3851b14627 refactor: Migrate to named exports (#5623)
* refactor: Migrate to named exports

* fix: Sort requires

* fix: Remove duplicate deps
2021-10-20 15:53:23 -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
d2d5dc4b71 fix: Use require instead of requireType for interfaces (#5568)
But only if the interface is used in an @implements or @extends
declaration.

Fixes #5450
2021-09-29 17:44:21 +01:00
Monica Kozbial
49bc2b1ae4 Replace namespace annotation with class annotation in files that define a class (#5566) 2021-09-28 15:57:09 -07:00
Monica Kozbial
d8fbe1b05b Add namespace and alias annotations to jsdoc (#5550)
* Add annotations to files under core/events

* Add annotations to files under core/interfaces

* Add annotations to files under core/keyboard_nav

* Add annotations to files under core/renderers

* Add annotations to files under core/serialization

* Add annotations to files under core/theme

* Add annotations to files under core/toolbox

* Add annotations to files under core/utils

* Add annotations to files under core
2021-09-27 14:42:54 -07:00
alschmiedt
2b34748e0e chore: remove declareLegacyNamespace from events (#5532)
- Adds an extra events/utils.js file to hold helper methods related to events.
2021-09-24 14:20:32 -07:00
Aaron Dodson
e0693a65d2 chore: Remove declareLegacyNamespace() from files in core (#5525)
* chore: Remove declareLegacyNamespace() from files in core

* fix: Update missing/errant re-exports in blockly.js
2021-09-23 14:48:52 -07:00
kozbial
900dfc7c68 Remove references to fully qualified namespace 2021-09-22 09:37:47 -07:00
kozbial
fd251dae22 Merge branch 'goog_module' into merge-develop-to-goog_module 2021-09-22 09:27:52 -07:00
Rachel Fenichel
3adfaaf6d9 chore: named exports for block* files (#5512)
* chore: named export for block.js

* chore: named export for block_drag_surface.js

* chore: named export for block_dragger.js

* chore: named export for block_svg.js

* Fix import ordering

* chore: fix imports using requireType

* Remove extra require
2021-09-22 08:46:19 -07:00
kozbial
6fc90213a6 Merge branch 'develop' into merge-develop-to-goog_module 2021-09-21 16:04:33 -07:00
Apoorv Garg
dfba00701e fix: getBlocksByType not filtering out insertion markers (#5430)
* maxInstance fix

* requested changes applied
2021-09-09 11:33:03 -07:00
Christopher Allen
a6471c4276 Rename Blockly.utils.IdGenerator to idGenerator and move Blockly.utils.genUid to there (#5441)
* Rename Blockly.utils.IdGenerator -> idGenerator
* Move genUid from Blockly.utils to Blockly.utils.idGenerator
2021-09-09 17:08:44 +01:00
Neil Fraser
49fcbc8411 Use Blockly.utils.arrayRemove (#5420)
Recently added code doesn't use existing utility function.
2021-09-03 11:40:55 -07:00
Aaron Dodson
a3b52aaab3 Migrate core/events/events.js to goog.module syntax (#5302)
* Migrate core/events/events.js to ES6 const/let

* Migrate core/events/events.js to goog.module

* Migrate core/events/events.js to named requires

* clang-format core/events/events.js

* Migrate Blockly core to use getRecordUndo/setRecordUndo

* Update core/events.js to reflect latest guidance around exporting mutable fields
2021-08-26 08:53:31 -07:00
Christopher Allen
4c40378b9a Use goog.requireType when importing interfaces (etc.) (#5343)
* 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.
2021-08-11 18:50:45 +01:00
kozbial
a7fcf881fa Add missing eslint disable line for required interface 2021-08-10 11:20:03 -07:00
kozbial
7eedf623d5 Change private static variable to local variable. 2021-08-09 14:59:22 -07:00
kozbial
e10be5444f clang-format core/workspace.js 2021-08-09 14:59:22 -07:00
kozbial
74b5a12c6d Migrate core/workspace.js named requires 2021-08-09 14:59:22 -07:00
kozbial
ac4fa41cb3 Migrate core/workspace.js to goog.module 2021-08-09 14:59:22 -07:00
kozbial
5f669a7607 Migrate core/workspace.js to ES6 const/let 2021-08-09 14:59:22 -07:00
kozbial
b834d9026b Add requireType calls for Blockly.WorkspaceComment and Blockly.WorkspaceCommentSvg 2021-08-06 18:05:53 -07:00
kozbial
ef0fcdbcdd Split Blockly.BlocklyOptions into a separate file 2021-08-05 10:50:44 -07:00
Neil Fraser
e661c92a36 More JSDoc improvements 2021-05-27 21:30:26 -07:00
Neil Fraser
f64c11d74e Make JSDoc object nullability more strict.
Also make Blockly.utils.deprecation.warn apply to properties.
2021-05-27 21:30:26 -07:00
Neil Fraser
d919b0af21 Update JSDoc from Array.<> to Array<>
Same with Object.
2021-05-27 21:30:26 -07:00
Sam El-Husseini
f2f878db8c Fix multiple strict require warnings (#4793) 2021-04-21 16:46:04 -07:00
Sam El-Husseini
63d26dc186 Add extra requires check (#4677)
* Add extra requires check
2021-03-05 09:50:51 -08:00
Sam El-Husseini
5780399750 Use registry for creating the no-category flyout (#4659)
* Use registry for creating the horizontal / vertical flyout
2021-03-01 10:00:47 -08:00
Sam El-Husseini
ab8a11784d Fix event related missing requires (#4656)
* Fix event related missing requires
2021-02-25 14:28:11 -08:00
Rachel Fenichel
2360a12493 Fix remaining trivial missing requireTypes 2021-02-19 13:17:14 -08:00
alschmiedt
a8f28c6b11 Metrics refactor (#4627) 2021-02-10 16:19:56 -08:00
Beka Westberg
af9be6d9c3 Update some inline docs in block.js (#4241)
* Update some inline docs in block.js

* Fix build error
2020-09-01 10:27:17 -07:00
Rachel Fenichel
98b436031c Use registry for connection checker 2020-07-17 10:51:39 -06:00
Rachel Fenichel
809148b435 Fix compiler errors 2020-07-16 17:40:13 -06:00
Rachel Fenichel
7288c66294 Rename connectionTypeChecker->connectionChecker 2020-07-16 17:40:13 -06:00
Rachel Fenichel
01d33ce2e7 Fix type checks 2020-07-16 17:40:13 -06:00
Rachel Fenichel
c743a92bb9 Start work on connection type checker 2020-07-16 17:40:12 -06:00
Maribeth Bottorff
e4bbd451a3 Use Context Menu registry for block-level menu options (#4032)
Use registry for block-level context menu items.
2020-07-10 19:11:48 -07:00
Rachel Fenichel
c9c8af12a7 Remove some old deprecated functions 2020-07-08 17:31:16 -07:00
Monica Kozbial
8a2caf5c32 Distinguish between unset maxInstance and set to 0. (#3949) 2020-06-09 16:38:16 -07:00
Sam El-Husseini
1052f7548b Enable unusedPrivateMembers check (#3924)
* Add unusedPrivateMembers check
2020-05-28 17:44:16 -07:00
Sam El-Husseini
317834ff59 Add accessibility interfaces and fix navigation types (#3908)
* Add accessibility interfaces and fix navigation types
2020-05-21 11:18:10 -07:00
Sam El-Husseini
fd916fdb9b Bounding Box interface (#3906)
* Add an interface describing a bounding box registered on the workspace

* Clear the bounding box array

* PR comments

* Update chromedriver
2020-05-19 18:06:11 -07:00