This is an empty repo to make it easy to experiment with AtScript. Please note that this is a fork of the original AtScript Playground by the Angular team. It includes * an updated Traceur Version * a slightly modified RTTS-Assert Version to support at least Array as a generic type * a test suite to explain AtScript functionality
The repo was adjusted in conjunction with a yet to be linked blog post.
# Clone the repo... git clone https://github.com/zweitag/atscript-playground.git cd atscript-playground # Then, you need to install all the dependencies... (sudo if you need to) npm install npm install -g karma-cli gulp
In order to start experimenting with AtScript, please
# Run Gulp to watch the src folder and start a server on port 8000 gulp
and point your browser to
You may then experiment in
src/main.ats. If you want source maps use
You will find a set of tests for many of AtScript’s features in the
directory. In order to run the tests, please
# Run Gulp to watch and compile the tests gulp
and in another shell
# Run the test suite npm test
What are all the pieces involved?
Traceur is configured to transpile AtScript modules into AMD syntax and we use RequireJS to load the code in the browser. This is just temporary until we improve the ES Module Loader polyfill (more details).
typeAssertions: true option is used, Traceur generates run-time type assertions such as
assert.type(x, Object). The assert library does the actual run-time check. Of course, you can use your own assert library.
The idea with type assertions is that you only use them during the development/testing and when deploying, you use
Test runner that runs the tests in specified browsers, every time that you change a file.
Task runner to make defining and running the tasks simpler.