-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Blockly codebase to Typescript #5857
Comments
I've been experimenting with this in my fork. I've deleted a large portion of the project structure for the moment and renamed all of the js files to ts. If you would like to work with me on this i am more than happy to accept help. Most of the work i've been doing is using tools i'm making myself to do some simple find and replaces, although some syntax tree parsing seems to now be in order to handle things such converting the prototypes to classes, so that's my current focus. The branch i am currently on is mostly to see how far i can get with this and then once it is done i will create a new branch that i will squash the changes that are needed onto without having the messy history involved in the experimentation. Feel free to contact me and check out my branch |
@daniel-brenot sure, can you send me a link to the relevant branch on your fork? I've been working through the ES6 classes part: #5860 and associated pull requests. I've been using a tool to do the class conversions, then touching it up as needed. Some classes can't be converted yet, often because we're not calling After class conversions the most critical thing is to get the build process working. |
I'm looking into lebab for the automatic conversion. I'm experementing with multiple ways of doing most of the work automatically since the repository is so large. My branch can be found here: https://github.com/daniel-brenot/blockly |
Part of this is that it may be prudent to separate some of the work for blockly into separate repositories for things such as generators for different languages. |
Separate repositories, or just separate issues for tracking each piece of work? The swap to Typescript tooling will not involve making separate repositories, because that expands the scope of the work well past a quarter. In the future we want to move generators, block definitions, and some other files out of core and into plugins, but we need to have clear migration paths for developers and generally minimize disruption where possible. |
Makes sense. In my local version i'm going to try to make typescript compile each one of the separate parts into a separate file with separate definitions to keep it compatible with how it seems to currently be done. |
I'm moving the task tracking here. [Edit: Moved into the top level comment] |
cool |
I'm going to close this because it looks like we haven't been using it for task tracking in over a year. |
Where is the tracking happening currently? Would love to stay up to date with the progress. |
I don't think any work is currently being done to convert more things to typescript. All of the external-facing code (I.e. everything but tests) has already been converted. Although we do have a few issues open for improving what we've got: |
Steps for this update. These are not necessarily in order, and some will be broken out as separate bugs.
Old Tracking List:
tsconfig.json
. (Set up typescript compilation #5892)package.json
to run the ts compiler and then the closure compiler. (Set up typescript compilation #5892)package.json
to clean up generated files when needed. (Set up typescript compilation #5892)Must happen pre merge:
@enums
for formatting issues. [beka]KeyCodes
incore/utils/keycodes.ts
. [christopher]@typedef
s for lost JSDocs. [beka]@typedef
s that were static properties on classes [beka]declareLegacyNamespace
calls [christopher]blockly.js
toblockly.ts
[christopher]Can happen post merge:
@protected
properties that have been changed to parameter properties [beka]compose
is commented out in BlockSvg [beka]Export interface types that were exported fromblockly.js
[beka]Object.defineProperties
[christopher]Object.defineProperties
[beka]AnyDuringMigration
in defs toany
[beka]@param
s, listing all@param
s even when annotation adds no information, etc.block.workspace
not nullable [aaron]Optional niceties:
Deal withWe were actually doing this correctly.IRegistrableField
trying to include a static property in an interfaceAdditional portions of the Blockly codebase (outside of
core/
to migrate:blocks/
andgenerators/
: Convertblocks/
andgenerators/
to TypeScript #6828tests/
or portions thereof?scripts/
or portions thereof?The text was updated successfully, but these errors were encountered: