-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Move to TypeScript build #296
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
Conversation
|
PR seems good in general, but I have a few comments and questions:
Last, I have to point out that while I am kind of skeptical of introducing TypeScript syntax into the core (possible barrier to entry for new contributors and found out tools like Flow that allow static type checking in pure JavaScript) the build system seems much better than the previous one which needed lots of different npm packages that do the job. |
Regarding Flow, that would be another way to get static typing but the power of it would only really unlock when you embrace explicit typing and other features of the language (which looks very similar to TypeScript). Regardless, they both look very similar to JavaScript and I'm not so sure worrying about potentially losing some contributions is worth avoiding type safe code. |
bin/build
Outdated
| ); | ||
| console.log(' OK.'); | ||
| mkdir -p build | ||
| browserify src/xterm.js --standalone Terminal -p [ tsify ] --outfile build/xterm.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TS 2 may have made this step redundant? https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#support-for-umd-module-definitions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this solves most of problems with TypeScript building.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked into this, while it does support outputting as umd module types only amd and system are supported with the --outFile argument. They recommend using browserify or webpack for bundling umds.
|
Do we have any idea why tests might be failing on Travis? |
|
It looks like you're running your mocha tests against ES6 code. |
|
I'll sync with master and fix up the tests soon 😃 |
This change is largely just moving files with minor tweaks to them to fix, the rest of the commit is build process changes: - The addons/ and test/ dirs have been moved to src/ - The build directory has been removed - TypeScript builds are output in out/, this is where tests are run - The demo now relies on the dist/ build which is performed as part of ./bin/build - Addons are now shipped under the ./build directory
|
Sure @Tyriar, let's move on. |
Refactor TS build and fix testing
A second much slimmer go at moving to TypeScript. Here's a summary:
--allowJsflag, this enables us to convert incrementally to TS