* chore: rename .eslintrc.js to eslint.config.js
* chore: Rename eslint.config.js to eslint.config.mjs.
* refactor: Migrate ESLint config to new flat format.
* chore: Remove old per-directory and global ignore ESLint config files.
* fix: Allowlist JSDoc tag aliases.
* fix: Don't require @license in tests/*.
* fix: Add NodeJS globals to several files that run under Node.
* chore: Remove now-unneeded ESLint directives in core.
* chore: Remove invalid/unneeded ESLint directives.
* fix: Fix invalid use of `await` outside of an `async` function.
* fix: Improve screenshot error message.
* fix: Update ESLint config file to not warn on existing violations.
* chore: Remove suppressions of rules that weren't triggering.
* chore: Fix package-lock.json.
* refactor(events): Use "export ... from" where applicable
* refactor(events): Introduce EventType enum
Introduce an enum for the event .type values. We can't actually
use it as the type of the .type property on Abstract events,
because we want to allow developers to add their own custom
event types inheriting from this type, but at least this way we
can be reasonably sure that all of our own event subclasses have
distinct .type values—plus consistent use of enum syntax
(EventType.TYPE_NAME) is probably good for readability overall.
Put it in a separate module from the rest of events/utils.ts
because it would be helpful if event utils could use
event instanceof SomeEventType
for type narrowing but but at the moment most events are in
modules that depend on events/utils.ts for their .type
constant, and although circular ESM dependencies should work
in principle there are various restrictions and this
particular circularity causes issues at the moment.
A few of the event classes also depend on utils.ts for fire()
or other functions, which will be harder to deal with, but at
least this commit is win in terms of reducing the complexity
of our dependencies, making most of the Abstract event subclass
module dependent on type.ts, which has no imports, rather than
on utils.ts which has multiple imports.
* chore(deps): Add pretter-plugin-organize-imports
* chore: Remove insignificant blank lines in import sections
Since prettier-plugin-organize-imports sorts imports within
sections separated by blank lines, but preserves the section
divisions, remove any blank lines that are not dividing imports
into meaningful sections.
Do not remove blank lines separating side-effect-only imports
from main imports.
* chore: Remove unneded eslint-disable directives
* chore: Organise imports
* fix: JSON deserialization not firing variable create events for blocks
* fix: extract logic for checking added variables and firing event to checkNewVariables function
We must continue to support existing XML and JSON serialization formats since they are in external databases.
The decision was taken not to make the save formats compatible with older versions of Blockly. We could not think of a convincing use-case for a newer Blockly's output to be read by an older Blockly. If such a case appears, then our decision should change.
Resolves#8095.
* feat: Invalid Blocks
* Rename the new json property from invalid to invalidReasons.
* Merged isValid into isEnabled.
* Minor fixes.
* More minor fixes.
* Reverting some stuff that didn't need to change.
* Addressing PR feedback.
* Update the BlockInfo interface to match State.
* Make BlockChange.disabledReason private.
* add saveIds param and logic to save correctly
* remove whitespace
* add saveIds to recursive calls
* run format
* change name from addIds to saveIds
* add saveIds test
* change blockId on false saveIds to undefined
* fix(build): Restore erroneously-deleted filter function
This was deleted in PR #7406 as it was mainly being used to
filter core/ vs. test/mocha/ deps into separate deps files -
but it turns out also to be used for filtering error
messages too. Oops.
* refactor(tests): Migrate advanced compilation test to ES Modules
* refactor(build): Migrate main.js to TypeScript
This turns out to be pretty straight forward, even if it would
cause crashing if one actually tried to import this module
instead of just feeding it to Closure Compiler.
* chore(build): Remove goog.declareModuleId calls
Replace goog.declareModuleId calls with a comment recording the
former module ID for posterity (or at least until we decide
how to reformat the renamings file.
* chore(tests): Delete closure/goog/*
For the moment we still need something to serve as base.js for
the benefit of closure-make-deps, so we keep a vestigial
base.js around, containing only the @provideGoog declaration.
* refactor(build): Remove vestigial base.js
By changing slightly the command line arguments to
closure-make-deps and closure-calculate-chunks the need to have
any base.js is eliminated.
* chore: Typo fix for PR #7415
* fix: make JSON use render queue
* fix: updating disabled for JSON system
* fix: make XML use render queue
* chore: make flyout use render queue explicitly
* chore: move input and input types into new directory
* feat: define and export new input types
* feat: modify blocks to construct individual inputs
* chore: transition code to use actual type checks
* chore: fixup input type type
* chore: format
* chore: fixup PR comments
* chore: fix build
* refactor(xml): Move textToDom to core/utils/xml.ts
This function being in core/xml.ts was the cause for the last
remaining circular import in core/ (between variables.ts and
xml.ts).
Moving it to utils/xml.ts makes sense anyway, since there is
nothing Blockly-specific about this function.
Fixes#6817.
* fix(closure): Reenable goog.declareModuleId multiple-call check
Reenable an assertion which check to make sure that
goog.declareModuleId is not called more than once in a module
(and which also catches circular imports amongst ES modules, which
are not detected by closure-make-deps).
* chore(tests,demos): Augo-migrate use of textToDom
Testing the migration file entry by auto-migrating all uses of
Blockly.Xml.textToDom to Blockly.utils.xml.textToDom.
* chore(blocks): Manually migrate remaining use of textToDom
Update the one remaining call to textToDom (in blocks/lists.ts)
to the function's new location - also removing the last use of
the Blockly.Xml / core/xml.ts) module from this file.
* docs(xml): Remove unneeded @alias per comments on PR #6818
* fix(imports): Remove unused import
* chore: add linting for tsdoc
* chore: don't require types on return
* chore: remove redundant fileoverview from ts
* chore: change return to returns and add some newlines
* chore: remove license tag
* chore: don't require params/return docs
* chore: remove spurious struct tags
* Revert "chore: change return to returns and add some newlines"
This reverts commit d6d8656a45.
* chore: don't auto-add param names
* chore: disable require-param bc it breaks on this
* return to returns and add line breaks
* chore: configure additional jsdoc rules
* chore: run format
* Revert "chore: remove license tag"
This reverts commit 173455588a.
* chore: allow license tag format
* chore: only require jsdoc on exported items
* chore: add missing jsdoc or silence where needed
* chore: run format
* chore: lint fixes
* refactor: Remove uses of AnyDuringMigration from trashcan.ts.
* refactor: Remove uses of AnyDuringMigration in bubble.ts.
* refactor: Remove uses of AnyDuringMigration from connection_checker.ts.
* refactor: Remove uses of AnyDuringMigration from connection_db.ts.
* refactor: Remove uses of AnyDuringMigration in contextmenu_items.ts.
* refactor: Remove uses of AnyDuringMigration from grid.ts.
* refactor: Remove uses of AnyDuringMigration from i_drag_target.ts.
* refactor: Remove uses of AnyDuringMigration from i_ast_node_location_svg.ts.
* refactor: Remove uses of AnyDuringMigration from i_ast_node_location_with_block.ts.
* refactor: Remove uses of AnyDuringMigration from i_autohideable.ts.
* refactor: Remove uses of AnyDuringMigration from i_block_dragger.ts.
* refactor: Remove uses of AnyDuringMigration from i_bounded_element.ts.
* refactor: Remove uses of AnyDuringMigration from i_bubble.ts.
* refactor: Remove uses of AnyDuringMigration from i_collapsible_toolbox_item.ts.
* refactor: Remove uses of AnyDuringMigration from i_connection_checker.ts.
* refactor: Remove uses of AnyDuringMigration from i_contextmenu.ts.
* refactor: Remove uses of AnyDuringMigration in i_copyable.ts.
* refactor: Remove uses of AnyDuringMigration from i_deleteable.ts.
* refactor: Remove uses of AnyDuringMigration from i_delete_area.ts.
* refactor: Remove uses of AnyDuringMigration in i_flyout.ts.
* refactor: Remove uses of AnyDuringMigration in i_keyboard_accessible.ts.
* refactor: Remove uses of AnyDuringMigration in i_metrics_manager.ts.
* refactor: Remove uses of AnyDuringMigration from i_movable.ts.
* refactor: Remove uses of AnyDuringMigration in i_positionable.ts.
* refactor: Remove uses of AnyDuringMigration in i_selectable_toolbox_item.ts.
* refactor: Remove uses of AnyDuringMigration from i_selectable.ts.
* refactor: Remove uses of AnyDuringMigration in i_serializer.ts.
* refactor: Remove uses of AnyDuringMigration from i_styleable.ts.
* refactor: Remove uses of AnyDuringMigration in i_toolbox.ts.
* refactor: Make non-null checks explicit.