Commit Graph

11 Commits

Author SHA1 Message Date
Christopher Allen
f931b2eb36 Reexport global.globalThis as Blockly.utils.global (#5534)
Fixes #5503

This makes the value of Blockly.utils.global the same as it was
before PR #5451.
2021-09-24 18:47:43 +01:00
Christopher Allen
8ab8536739 refactor: Migrate Blockly.ConnectionType to named exports (#5533)
* refactor: Migrate Blockly.ConnectionType to named exports
* Add corresponding information to renamings.js
2021-09-24 17:38:08 +01:00
Himanshu
3629ed5f65 refactor: Rename Blockly.connectionTypes to Blockly.ConnectionType (#5407)
* Renamed Blockly.connectionTypes to Blockly.ConnectionType
* Renamed core/connection_types.js to connection_type.js
* Add entry to renamings.js for renaming of Blockly.connectionTypes

Co-authored-by: Christopher Allen <cpcallen+git@google.com>
2021-09-24 12:45:10 +01:00
Beka Westberg
f77526e558 Move browser event utils from utils.js to browser_events.js (#5464)
* fix: move browser event utils to browserEvents

* fix: mark browser event utils in utils as deprecated

* fix: move uses of browser event funcs to browserEvents

* fix: remove browserEvents definition of noEvent

* fix: add renames for browser event utils

* docs: add suggested alternatives for browser event utils

* fix: change deprecations to stubs

* fix: PR comments
2021-09-17 14:49:01 -07:00
Aaron Dodson
7aab18409f Migrate selected from Blockly to Blockly.common (#5489)
* Add getSelected/setSelected to core/common.js

* Migrate core to use Blockly.common.getSelected/setSelected instead of Blockly.selected

* Migrate demos to use Blockly.common.getSelected/setSelected instead of Blockly.selected

* Remove Blockly.selected

* Use variable instead of calling common.getSelected() multiple times

* Add accessor for selected on Blockly

* Add renaming record for Blockly.selected -> Blockly.common.getSelected/setSelected
2021-09-17 11:42:43 -07:00
Christopher Allen
dbf10cf167 Clean up get/set accessor definitions (#5488)
* Use Object.defineProperties instead of .defineProperty when
  installing get and set accessors for previously-mutable exports.

* Add entries to renamings.js where feasible (i.e., for static rather
  than instance properties).

(Don't do blockly.js yet, to avoid merge conflicts.)
2021-09-17 19:30:21 +01:00
Aaron Dodson
42a3920ece Note Blockly.alert/confirm/prompt/hueToHex/hideChaff migrations in renamings.js (#5475) 2021-09-16 13:06:21 -07:00
Christopher Allen
d202ae0201 Don't monkey-patch Blocky.utils.xml.document (#5461)
Use Blockly.utils.xml.setDocument instead.
2021-09-14 19:55:31 +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
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
24d73be1c3 docs: Create renamings.js to collect renamed API entries (#5426)
Create a file scripts/migration/renamings.js to collect information about renamed API entries. Start by filling it with the renamings already done to blockly.js.
2021-09-03 17:57:31 +01:00