Skip to content

Update Blockly codebase to Typescript #5857

@rachel-fenichel

Description

@rachel-fenichel

Steps for this update. These are not necessarily in order, and some will be broken out as separate bugs.

Old Tracking List:

Must happen pre merge:

  • Check all @enums for formatting issues. [beka]
    • Fix KeyCodes in core/utils/keycodes.ts. [christopher]
  • Check all @typedefs for lost JSDocs. [beka]
  • Export @typedefs that were static properties on classes [beka]
  • Move comments that migrants put in the wrong place [beka]
  • Remove remaining declareLegacyNamespace calls [christopher]
  • Migrate blockly.js to blockly.ts [christopher]
  • Get Blockly to pass CI. [TBD]

Can happen post merge:

  • Fix any @protected properties that have been changed to parameter properties [beka]
  • Check that public parameter properties are correct [beka]
  • Investigate why compose is commented out in BlockSvg [beka]
  • Export interface types that were exported from blockly.js [beka]
  • Redefine properties that were defined using Object.defineProperties [christopher]
    • Check that we've properly deprecated all of the above properties, including any in blocks or generators. [beka]
  • Find new places to put the properties that were defined using Object.defineProperties [beka]
  • Implement piping sourcemaps from tsc to closure compiler [christopher]
  • Get generating type defs working [beka]
    • Rename instances of AnyDuringMigration in defs to any[beka]
  • Fix packaging sources (.ts instead of .js) [beka]
  • Get API Extractor Working
    • Get Maribeth set up with a branch that builds [beka]
    • Enable API Extractor. [maribeth]
    • Migrate JSDoc to TSDoc. [TBD]
      • Move any docs attached to property assignments to property definitions [TBD]
    • Figure out how to pipe the results of API Extractor to devsite [maribeth]
  • Update the Blockly style guide to document where we differ from the Google TS (or JS) styleguide
    • E.g., using TSDoc, requiring blank line before @params, listing all @params even when annotation adds no information, etc.
  • Update the renamings script to handle the new import structure for blocks and generators [beka]
  • Fix BlocklyOptions (which stopped actually defining anything during the goog.module migration) [beka]
  • Make block.workspace not nullable [aaron]
  • Add type information to interfaces [aaron]

Optional niceties:

  • Deal with IRegistrableField trying to include a static property in an interface We were actually doing this correctly.
  • Remove unused JSDoc attributes
  • Get ESLint to work with Typescript [maribeth]
  • Fix CSS formatting. E.g. common/constants [beka]
  • Look into DynamicShape in common/constants [beka]
  • Update everything to conform to the ts styleguide
  • Remove all instances of AnyDuringMigration [beka/aaron]
  • Revert changes to the BlockDefinition type (in /blocks) Update BlockDefinition type import in block definition files #6248

Additional portions of the Blockly codebase (outside of core/ to migrate:

Metadata

Metadata

Assignees

Labels

internalExternal contributions not accepted

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions