Commit Graph

1218 Commits

Author SHA1 Message Date
Christopher Allen
ff9320f8d9 Migrate core/utils/xml.js to goog.module syntax (#5459)
* Migrate core/utils/xml.js to ES6 const/let

* Migrate core/utils/xml.js to goog.module

  The document() function is renamed to getDocument() so as to avoid
  shadowing the global of the same name.

* clang-format core/utils/xml.js

* Call monkey-patchable exports.global internally too

  This fixes Node test failures due to the monkey-patching of
  Blockly.utils.xml.global in scripts/package/node/core.js not being
  able to affect the target calls in createElement and createTextNode.
2021-09-14 15:51:06 +01:00
Christopher Allen
f9d0caa112 Migrate core.global.js to named exports (#5451)
This is part of #5153 but is being prioritised because we want remove
the declareLegacyNamespace calls from the core/utils/*.js modules and
then reexport them explicitly via utils.js, and it turns out that
doing so results in the exports object of this module being passed to
Object.freeze - which fails on the global object, which can't be made
non-extensible!

The new name chosen for the former default export is globalThis, since
it is intended to have the same value as the global variable of that
name; see:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis
2021-09-14 14:39:29 +01:00
Christopher Allen
09fb59f6ee Fix deps.js (#5452)
Running npm run build:deps in goog_module makes a change to tests/deps.js that was previously committed by PR #5441 but which appears to have been inadvertently undone by #5222.
2021-09-10 22:16:48 +01:00
Christopher Allen
7a2e23876e Migrate core/msg.js to goog.module syntax (#5448)
* Migrate core/msg.js to goog.module
* Migrate core/msg.js named requires
2021-09-10 18:10:23 +01:00
Aaron Dodson
53061ac6e5 Migrate core/touch_gesture.js to goog.module syntax (#5449)
* Migrate core/touch_gesture.js to ES6 const/let

* Migrate core/touch_gesture.js to goog.module

* Migrate core/touch_gesture.js to named requires

* clang-format core/touch_gesture.js

* Remove Blockly prefix from Touch
2021-09-09 14:19:32 -07:00
Aaron Dodson
646a931d77 Migrate core/tooltip.js to goog.module syntax (#5222)
* Migrate core/tooltip.js to ES6 const/let

* Migrate core/tooltip.js to goog.module

* Migrate core/tooltip.js to named requires

* clang-format core/tooltip.js

* Fix exports of mutable fields in core/tooltip.js

* Don't assign a value when exporting visible in core/tooltip.js
2021-09-09 12:45:16 -07:00
Christopher Allen
79b814018e Migrate core/utils.js to goog.module syntax (#5446)
* Add missing requires for Blockly.utils.*
  - Blockly.utils.svgPaths in core/rendered_connection.js
  - Blockly.utils.colour in core/toolbox/category.js
  - Blockly.utils.KeyCodes in core/toolbox/toolbox.js
* Migrate core/utils.js to ES6 const/let
* Migrate core/utils.js to goog.module
* Migrate core/utils.js named requires
* clang-format core/utils.js
2021-09-09 17:25:53 +01: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
Christopher Allen
2d89a36e7d Migrate core/utils/useragent.js to goog.module syntax (#5435)
* Migrate core/utils/useragent.js to ES6 const/let
* Migrate core/utils/useragent.js to goog.module
* Migrate core/utils/useragent.js named requires
* clang-format core/utils/useragent.js
2021-09-07 18:48:18 +01:00
Christopher Allen
c31895dc60 fix: Add missing require for Blockly.utils.object, .Size (#5427)
Some files were using Blockly.utils.object.inherits (or .mixin) without
having imported Blockly.utils.object.

Similarly, trashcan.js tried to use utils.Size as a constructor
instead of importing Size from Blockly.utils.Size.
2021-09-03 22:45:54 +01: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
alschmiedt
6be7bc1b2b Merge pull request #5207 from alschmiedt/migrate_dropdown
Migrate dropdown to goog.module syntax
2021-08-24 13:08:43 -07:00
Aaron Dodson
4751eea529 Migrate core/events/ws_comment_events.js to goog.module syntax (#5380)
* Split provides in core/events/ws_comment_events.js into individual files

* Migrate core/events/events_comment_* to ES6 const/let

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

* Migrate core/events/events_comment_* to named requires

* clang-format core/events/events_comment_*

* Revert now-unnecessary changes to tests/mocha/event_test.js

* Update fileoverview comments for separated comment event classes
2021-08-24 08:00:27 -07:00
alschmiedt
c349db1a2e Adds test deps back in 2021-08-19 17:14:05 -07:00
alschmiedt
168b71e964 Updates to the new pattern for testing private 2021-08-19 17:07:05 -07:00
alschmiedt
3d75bd6493 Attempt to fix tests 2021-08-19 17:03:55 -07:00
alschmiedt
f29d795a7e Migrate core/dropdowndiv.js to goog.module 2021-08-19 16:58:45 -07:00
kozbial
40474324f6 Migrate core/renderers/zelos/measurables/inputs.js to goog.module 2021-08-19 10:40:53 -07:00
kozbial
7037a15011 Migrate core/utils/global.js to goog.module 2021-08-19 10:40:26 -07:00
kozbial
cf5c38c3f5 Migrate core/utils/svg.js to goog.module 2021-08-19 09:36:57 -07:00
kozbial
c85714b1c6 Migrate core/renderers/zelos/measurables/rows.js to goog.module 2021-08-19 09:35:26 -07:00
kozbial
3e1099e2b8 Split classes from core/renderers/zelos/measurables/rows.js into multiple files 2021-08-19 09:35:26 -07:00
kozbial
d37df416e1 Migrate core/renderers/zelos/measurables/row_elements.js to goog.module 2021-08-18 15:57:53 -07:00
kozbial
30fe1aacec Migrate core/metrics_manager.js to goog.module 2021-08-18 09:54:19 -07:00
kozbial
7974e6325b Split classes from core/metrics_manager.js into multiple files 2021-08-18 09:54:19 -07:00
kozbial
2ea51db549 Migrate core/renderers/zelos/renderer.js to goog.module 2021-08-18 09:43:17 -07:00
kozbial
3be64d78aa Migrate core/theme/classic.js to goog.module 2021-08-18 09:36:31 -07:00
kozbial
221f0b9c42 Migrate core/theme/zelos.js to goog.module 2021-08-18 09:16:16 -07:00
kozbial
9561cb20c9 Migrate core/touch.js to goog.module 2021-08-17 14:42:31 -07:00
kozbial
974c73f0b9 Migrate core/renderers/measurables/connections.js to goog.module 2021-08-17 12:41:28 -07:00
kozbial
d50247664a Split classes from core/renderers/measurables/connections.js into multiple files 2021-08-17 12:41:28 -07:00
kozbial
d6eb6c14ef Migrate core/renderers/zelos/path_object.js to goog.module 2021-08-17 12:31:31 -07:00
kozbial
6bf554643a Migrate core/renderers/measurables/rows.js to goog.module 2021-08-17 09:41:32 -07:00
kozbial
11f4479faf Split classes from core/renderers/measurables/rows.js into multiple files 2021-08-17 09:41:32 -07:00
Aaron Dodson
dbe7aaa8c8 Migrate core/renderers/measurables/row_elements.js to goog.module syntax (#5381)
* Split provides in core/renderers/measurables/row_elements.js into individual files

* Migrate core/renderers/measurables/row_elements.js to ES6 const/let

* Migrate core/renderers/measurables/row_elements.js to goog.module

* Migrate core/renderers/measurables/row_elements.js to named requires

* clang-format core/renderers/measurables/row_elements.js
2021-08-16 15:54:11 -07:00
kozbial
1cd9e1c8ea Migrate core/renderers/thrasos/info.js to goog.module 2021-08-16 11:23:51 -07:00
kozbial
9daf2f3be1 Migrate core/renderers/thrasos/renderer.js to goog.module 2021-08-16 11:01:50 -07:00
Aaron Dodson
9046ce165b Migrate core/widgetdiv.js to goog.module syntax (#5331)
* Migrate core/widgetdiv.js to ES6 const/let

* Migrate core/widgetdiv.js to goog.module

* Migrate core/widgetdiv.js to named requires

* clang-format core/widgetdiv.js

* Mark WidgetDiv.DIV as deprecated and refactor callers to use setters/getters

* Fix deprecation date

* Refactor tests to make setDiv() in core/widgetdiv.js test-only

* Fix type annotations for WidgetDiv.DIV and move test cleanup into sharedTestTeardown
2021-08-16 10:23:50 -07:00
Aaron Dodson
26195a6d9c Migrate core/renderers/minimalist/info.js to goog.module syntax (#5364)
* Migrate core/renderers/minimalist/info.js to goog.module

* Migrate core/renderers/minimalist/info.js to named requires

* clang-format core/renderers/minimalist/info.js
2021-08-16 08:49:49 -07:00
Aaron Dodson
1e32aee7ac Migrate core/renderers/minimalist/constants.js to goog.module syntax (#5363)
* Migrate core/renderers/minimalist/constants.js to goog.module

* Migrate core/renderers/minimalist/constants.js to named requires

* clang-format core/renderers/minimalist/constants.js
2021-08-16 08:48:56 -07:00
Aaron Dodson
8e3cf41d2b Migrate core/renderers/minimalist/renderer.js to goog.module syntax (#5365)
* Migrate core/renderers/minimalist/renderer.js to goog.module

* Migrate core/renderers/minimalist/renderer.js to named requires

* clang-format core/renderers/minimalist/renderer.js
2021-08-16 08:24:36 -07:00
kozbial
42ce46bdd8 Migrate core/renderers/zelos/marker_svg.js to goog.module 2021-08-12 17:04:18 -07:00
kozbial
a0980ae3be Migrate core/renderers/zelos/info.js to goog.module 2021-08-12 16:00:29 -07:00
kozbial
8073b0e282 Migrate core/renderers/zelos/drawer.js to goog.module 2021-08-12 13:20:24 -07:00
Aaron Dodson
ee3f4d257b Migrate core/utils/string.js to goog.module syntax (#5059)
* Migrate core/utils/string.js to ES6 const/let

* Migrate core/utils/string.js to goog.module

* clang-format core/utils/string.js

* Migrate core/utils/string.js to current exports convention

* Convert two remaining vars to lets in core/utils/string.js
2021-08-12 11:44:08 -07:00
Aaron Dodson
c86c8f8e92 Migrate core/variables.js to goog.module syntax (#5321)
* Migrate core/variables.js to ES6 const/let

* Migrate core/variables.js to goog.module

* Migrate core/variables.js to named requires

* clang-format core/variables.js

* Add JSDoc and make testdeps function test-only

* Fix return type for getTestDeps

* Migrate to new style of exposing methods for mocking in core/variables.js
2021-08-12 09:55:38 -07:00
kozbial
d6dc3807e9 Migrate core/renderers/common/debugger.js to goog.module 2021-08-12 09:53:30 -07:00
kozbial
c539c53981 Migrate core/renderers/zelos/constants.js to goog.module 2021-08-12 09:46:10 -07:00
Maribeth Bottorff
13fdf601b7 Merge branch 'goog_module' of github.com:google/blockly into module_aria 2021-08-11 17:22:12 -07:00
Maribeth Bottorff
f1e8f75f75 Merge branch 'goog_module' of github.com:google/blockly into bubble-module 2021-08-11 17:12:33 -07:00