This only transpiles one package to start with: di/
It ensures that package transpiles without errors, so no one can
introduce non-TypeScript syntax.
Next step is to widen the task inputs to cover additional packages.
See design doc for the migration:
https://docs.google.com/document/d/14RJLhu6uuv7NchFkAb6PKzOOO0L7l3Z507eKWzkEUhQ/edit
A convenience task 'ts2dart' is added for developing ts2dart, and
it runs all of the angular code through the transpiler to collect errors.
* `npm install` now does a full install; auxiliary installation steps
have been integrated into the `postinstall` script.
* Updated developer docs `DEVELOPER.md` accordingly; also added
instructions to dev docs for performing full tests (via `npm test`) --
same as those run on Travis.
* Reorg in tests so that JS tests can run without a Dart env.
Partly fixes#945 **under the assumption that when running JS tests
locally, `ChromeCanary` is the desired browser to use**. Note that CI
tests (Travis) still uses `DartiumWithWebPlatform` across the board
(Maybe because ChromeCanary isn't being installed?)
Fixes#1012.
Closes#1010
Limitations because of preview status (see #960):
- does not yet use ShadowDOM
- does not use a builtin conditional like `if`
- uses a temporary bower repository
Closes#943
This adds a unit test to the transpiler. Existing tests are themselves transpiled to ES5, which makes it impossible to do some kinds of assertions. For example, this will be useful to repro https://github.com/angular/angular/issues/509.
In this change, the actual issue isn't fixed. It only adds the reproduction.
It uses the jasmine test runner, since it's already used by the docs test. That uses version 1 of Jasmine, which isn't ideal, but I want to be consistent for now.
I discussed with Tobias the possibility of switching to Mocha for these nodejs-based tests, and we might do that sometime later.
Export files are now directly under the module folder,
e.g. `core/core.js`. With this, an import like `core/core`
won’t need a path mapping (e.g. via `System.paths`) any more.
This adds the `src` folder to all other import statements as well.
- adds console and cloud reporter (via Google BigQuery).
- makes parameters of tests explicit and modifiable.
- removes `detect` and `ignoreGc` mode from benchpress
as these can result in unstable numbers.
- use performance log of chromedriver / appium to get timeline data
for calculating metrics for benchmarks
- change all benchmarks to be made of a standalone application
and a protractor test that collectes timeline data
- fix and simplify benchmarks
- add dart2js to build
- remove benchpress
Closes#330
simplify:
- use same html file for dart and JS
- build benchmarks automatically when doing `gulp build`
- centralize configuration
modularize:
- move all build tasks into separate node.js modules under
`tools/build`.
changes:
- the `build` folder is now the `dist` folder
Closes#284
The app is writen in ES6 and transpiles to ES5 and dart as part of the
usual build.
The app contains a component, a directive and a services wired together
through dependency injection.
Before Each:
- gulp build
For es5:
- gulp serve
- open 'localhost:8000/js/examples/lib/hello_world/'
For dart:
- gulp examples/pub.serve
- open 'localhost:8080'
This was failing on Travis because the `pub install` would run before
copying of `pubspec.yml` happened. In fact, I don’t understand how this
worked at all because `gulp.dest` seems to be not forwarding files and
so anything after `gulp.dest` does not get called at all.
Here is the failing Travis build:
https://travis-ci.org/angular/angular/builds/40005692
This changes `modules/build.dart/pubspec` task to use `gulp-changed`
instead of a custom implementation and use a wrapper around `gulp.dest`
to forward files.
For Karma, the source mapa are inlined inside each source file.
For `build/*` output, separate `*.map` file is created.
This changes the API of `tools/transpiler/index.js`. I believe this API
is only used in `gulp-traceur.js` and `karma-traceur-preprocessor.js`.
Instead of returning the transpiled string, `compile()` returns a result
object such as:
```js
{
js: ‘transpiled code’,
sourceMap: null || {}
}
```
Closes#20
`pub get` is now only executed when the `pubspec.yaml` in the `modules`
folder is different than the `pubspec.yaml` in the `build/dart` folder.
Generates the file `build/dart/_analyzer.dart` that imports all modules
to run `dart analyzer` against all of them. The build will fail whenever
there are errors, warnings or hints in `dart analyzer`.
Changes the sources so that `dart analyzer` does not report any
error, warning or hint.
Closes#40
* remove `wraps` syntax enhancements for imports
and support new `import * as module from ...` syntax
- default imports are the wrong construct for importing
everything from a module
* moved tests from transpiler to jasmine and karma
- transpiler tests are included when running karma in main project folder
- transpiler is reloaded after every test run in karma,
so no need to restart karma when the transpiler has been changed.
- removed own gulp build for transpiler and `postinstall.sh`
as they are no more needed.
- transpiler tests are now executed in Dart AND JavaScript (used to be executed
only in Dart), which allowed to catch some bugs (see the bug with the
import specification above).
* made tests work in dart as well by using the following hack:
- dependencies are loaded from the `build` folder, which makes
running `gulp build` necessary before running karma for dart
- for this to work,
the dependencies are included in main `pubspec.yaml` of project
- reason for the hack: `karma-dart` loads all `packages` urls
directly from disc (should rather use the karma file list)
* added explicit annotations `FIELD`, `ABSTRACT`, ... to `facade/lang.*`
- needed for now that we can run tests and don't get errors for undefined
annotations.
* added `README.md` with details about the build and tests
Note: karma with dart is still not working
because of how `karma-dart` loads `package:…` dependencies.
Usage:
```
karma start karma-js.conf.js
karma start karma-dart.conf.js
```
Make sure to set `DARTIUM_BIN` env variable.
Refactors `js2dart`:
- live outside of the traceur module (`tools/js2dart/index.js`)
so it can be reused by gulp and karma
- automatically build the sources in memory,
so that `js2dart` can be used without running `gulp build` first
- provide a way to specify the moduleName of a compilation run
independently of the input filename. This helps error messages
and source maps (not yet enabled) to report the correct file name
Changes project setup:
- add module `test_lib` that contains the primitives for tests
(e.g. `describe`, `it`, …)
- clean up some sources that had errors in them
- module names in transpiled js and dart files don’t contain
`lib`, `test` nor `src` any more (e.g. `di/di`).
When chaining a `pubspec.yaml` we automatically run `pub get`.
In `gulp build` we also run `dartanalyzer` for all files
that have the pattern:
`<module>/lib/<module>.dart`
Closes#13Closes#5Closes#2