question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ARCHITECTURE: Migrate to TypeScript

See original GitHub issue

TypeScript is a strict superset of JavaScript that adds optional static typing and that adopts the latest ECMAScript features before they are broadly deployed by browser vendors. It gets transpiled to JavaScript for deployment, and the support for debugging using sourcemaps is currently good.

The following steps need to happen:

  • setup build system to use TypeScript and Rollup to bundle the (JavaScript) sources
  • convert JavaScript files to TypeScript by adding type annotation, particularly for arguments and return values
  • correct any errors that will be discovered as part of this process (mistyped property names is a common one)
  • switch the test harness from tape to jest

Once completed, the codebase will be easier to maintain and the MathLive interface will have a “native” TypeScript interface (instead of the current one which is generated from JSDoc annotations and is not as expressive as desirable as a result). This will make the integration of MathLive in TypeScript projects easier. On the other hand, this should be transparent for JavaScript projects using MathLive, as the regular JavaScript API will still be available.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
NSoiffercommented, Apr 27, 2020

It looks pretty good, but options: any is not helpful. It would be much more helpful to have a comment to explain the options or maybe better from a code correctness point of view, eliminate “any” and be specific about what the options really are from a type point of view.

Similarly, “string” is not helpful – what values can the string take on?

I did spot a bug dealing with links on http://cortexjs.io/docs/mathlive/#("core"%3Anamespace).(ParseMode%3Atype):

textToSpeechRulesOptions?: {[key: string]: string};A set of key/value pairs that can be used to configure the speech rule engine.Which options are available depends on the speech rule engine in use. There are no options available with MathLive’s built-in engine. The options for the SRE engine are documented {@link:https://github.com/zorkow/speech-rule-engine | here}

One the webpage, that link is just plain text, not a clickable link.

1reaction
physedocommented, Apr 27, 2020

Very Good

Read more comments on GitHub >

github_iconTop Results From Across the Web

DevTools architecture refresh: migrating DevTools to TypeScript
How we migrate Chrome DevTools from the Closure Compiler type checker to TypeScript.
Read more >
How to Migrate Application From JavaScript to TypeScript
Ts-migrate has plugin architecture with multiple code modification scripts - codemods. They have access to code information via the TypeScript language ...
Read more >
Why we migrated to Typescript after all - Medusajs
As part of our mission to provide the best possible developer experience, we've begun migrating our project to Typescript. Here's how and why....
Read more >
Sentry Migrates Its Frontend to Typescript - Lessons Learned
After debating the pros and cons, the decision was made to incrementally convert the existing React codebase to TypeScript. The conversion ...
Read more >
Quick Tips For Migrating from JavaScript to TypeScript
This blog post contains some tips I learned while migrating some JavaScript files to TypeScript of an open-source project.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found