Commit Graph

231 Commits

Author SHA1 Message Date
dependabot[bot]
063c8ad91e chore: Bump google-closure-compiler from 20210601.0.0 to 20211006.0.0 (#5592)
* Bump google-closure-compiler from 20210601.0.0 to 20211006.0.0

Bumps [google-closure-compiler](https://github.com/google/closure-compiler-npm) from 20210601.0.0 to 20211006.0.0.
- [Release notes](https://github.com/google/closure-compiler-npm/releases)
- [Commits](https://github.com/google/closure-compiler-npm/compare/v20210601.0.0...v20211006.0.0)

---
updated-dependencies:
- dependency-name: google-closure-compiler
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Remove deleted option from Closure Compiler arguments

The closure compiler no longer supports the undefinedNames warning
group (and indeed even prior to deletion it didn't do anything for
some time).

Per @lauraharker, enabling checkVars, missingProperties and
strictMissingProperties gives about the same check coverage; we
already enable the first two, while the third was already listed
but commented out for the time being.

* Provide externs for base.js functions

Per comment: fixes compiler errors from build:debug.

* Fix erroneous import

Blockly.serialization.ISerializer uses named exports, so we need to
destructure the import.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christopher Allen <cpcallen+git@google.com>
2021-10-15 22:30:14 +01: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
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
alschmiedt
1504c999b8 fix: updates the release task to build typings for msgs (#5495) 2021-09-22 17:08:26 -07:00
kozbial
6fc90213a6 Merge branch 'develop' into merge-develop-to-goog_module 2021-09-21 16:04:33 -07:00
Rachel Fenichel
d83eb1364b fix: enable missingRequire in build_tasks (#5510) 2021-09-21 13:19:55 -07: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
alschmiedt
28fadf8c15 Sets flag to true (#5454) 2021-09-17 11:15:20 -07:00
Aaron Dodson
42a3920ece Note Blockly.alert/confirm/prompt/hueToHex/hideChaff migrations in renamings.js (#5475) 2021-09-16 13:06:21 -07:00
alschmiedt
5b1586ee1b test: update mocha tests to use goog_module (#5440)
* Use goog.module in mocha tests

* Fix compiler warnings

* Make test helpers a module

* Name test modules Blockly.test.*

This is to be more consistent with how non-test modules are named.

Also remove top-level goog.require of TestHelpers (now
Blockly.test.helpers) since requiring a side-effect-less module does
nothing.

* Convert block_test.js and comment_test.js to goog.module syntax

* Address PR comments

* Goog modulify tests

* Goog modulify toolbox helpers

* Fixes imports and moves common tests from workspace_test.js to a helper file.

* Update test deps after rebase

Co-authored-by: Christopher Allen <cpcallen+git@google.com>
2021-09-16 13:00:38 -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
Maribeth Bottorff
744e0ecb3d Quiet the typings script unless you tell it to be verbose. (#5362) 2021-08-13 12:58:18 -07:00
Maribeth Bottorff
50e470ccb1 Quiet the typings script unless you tell it to be verbose. (#5359) 2021-08-12 10:15:35 -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
2a62c06a92 Update script to use python3 command 2021-08-10 16:43:08 -07:00
Neil Fraser
52d280e615 Recompile of JSON to JS messages.
Delete unused Klingon message.
Remove '.' from message that confusingly appears after a filename.
2021-08-05 10:39:22 -07:00
kozbial
c74c1bf416 wording update 2021-07-29 15:24:45 -07:00
kozbial
34042519f4 Add regex lookarounds to check for require overlaps 2021-07-29 15:24:45 -07:00
kozbial
87a714fff8 Add handling for modules that are not leaf nodes 2021-07-29 11:29:51 -07:00
kozbial
311373230f Fix help log 2021-07-29 09:25:55 -07:00
kozbial
7495fad6b3 Add missing period and fix typo 2021-07-27 11:54:17 -07:00
kozbial
3fbbedf6f1 Fix typos and update wording again 2021-07-27 11:54:17 -07:00
kozbial
f64e8df486 Update wording 2021-07-27 11:54:17 -07:00
kozbial
636cd58add Add comment to top of convert-file script for reference to syntax used throughout the file 2021-07-27 11:54:17 -07:00
Monica Kozbial
1360b5bb49 Apply fixes for convert-file script (#5206) 2021-07-23 18:10:38 -07:00
Monica Kozbial
96ec93f91e Remove deconstructing properties and update logic (#5202) 2021-07-23 14:52:42 -07:00
Monica Kozbial
9d29bff713 Ask before deconstructing properties for a require (#5169) 2021-07-22 10:01:41 -07:00
Monica Kozbial
720059e502 Fix bugs (#5175) 2021-07-22 09:59:02 -07:00
Monica Kozbial
efdc9e3afa Support filepath as first argument and cleanup (#5168) 2021-07-22 09:11:54 -07:00
Monica Kozbial
96420f0daf Add command to deploy beta version of demos (#4958) 2021-07-21 11:53:52 -07:00
kozbial
8d6f2626cd Remove command to add missing nullability modifiers 2021-07-20 19:02:36 -07:00
kozbial
e6817778db fix formatting and help 2021-07-20 19:02:36 -07:00
kozbial
5e3209b6f5 Remove extra logging line 2021-07-20 19:02:36 -07:00
kozbial
972f9bc386 Fix bugs caused by Blockly being a require 2021-07-20 19:02:36 -07:00
kozbial
b2ed132ebb Fix bug where script was incorrectly reporting missing requires 2021-07-20 19:02:36 -07:00
kozbial
edfb87fd61 Update more grep calls 2021-07-20 15:48:44 -07:00
kozbial
41eead78ff Update grep calls 2021-07-20 15:48:44 -07:00
kozbial
89e4151810 Update commands to be OSX compatible 2021-07-20 15:48:44 -07:00
kozbial
5f5b437025 Add script for partially automating goog.module conversion steps 2021-07-20 15:48:44 -07:00
Christopher Allen
2bdf2627af Configure eslint and Closure Compiler to accept ES6 2021-07-13 23:54:36 +01:00
Christopher Allen
d313ec804a Merge branch 'develop' into goog.module-prep
This resolves a conflict in `blockly_uncompressed.js`, and missing
updates to `test/deps.js`, caused by PR #5041.
2021-07-13 22:16:35 +01:00