Commit Graph

1747 Commits

Author SHA1 Message Date
Tobias Bosch 674848648a feat(facade): add support for `Date`
Also refactors the dart transpilar to expose
the type mappings for future changes.
2015-02-17 16:02:46 -08:00
Tobias Bosch f6284f2a55 feat(benchpress): rewritten implementation
Limitations:
- cloud reporter is not yet supported any more
2015-02-16 11:43:27 -08:00
Tobias Bosch 44845839a6 fix(transpiler): support arrow functions with complex body in named arguments 2015-02-16 10:48:44 -08:00
Tobias Bosch 013e1faf27 fix(build): support transpile to commonjs 2015-02-11 13:09:52 -08:00
Tobias Bosch 729e38af19 feat(build): add npm publish script
Also fixes gulpfile:
- `runSequence` needs to be called with `done` callback
- `es5build` should only run when the task executes…
2015-02-10 16:28:28 -08:00
Tobias Bosch dd532fee72 feat(build): add package.json and README.md for publishing to npm 2015-02-10 11:52:42 -08:00
Tobias Bosch 69bba9b5df feat(build): transpile to es6
Transpile all sources first to es6 which we can publish and then
to es5. Also merge the generated source maps into once map.
2015-02-10 11:27:22 -08:00
Yegor Jbanov 320c089dcc feat(packaging): automatically copy LICENSE to dist folders 2015-02-09 14:02:42 -08:00
Tobias Bosch f39c6dc2c7 fix(setup): use upstream traceur with explicit patches
Also correct the transpile to ES6

Also support generics correctly

All patches are hooked in via `/tools/transpiler/index.js`
https://github.com/google/traceur-compiler/issues/1700
https://github.com/google/traceur-compiler/issues/1699
https://github.com/google/traceur-compiler/issues/1708
https://github.com/google/traceur-compiler/issues/1625
https://github.com/google/traceur-compiler/issues/1706
2015-02-06 17:04:08 -08:00
Marc Laval 6bfa48bc64 refactor(directives): Drop ng- prefix from all angular directives and rename NgRepeat to Foreach
fixes #532

Closes #539
2015-02-06 09:24:50 -08:00
Alex Eagle 93c18f5396 fix(build): Escape dollar signs in dart-transpiled string literals
Escape dollar signs in string literals - dart should not interpolate them.
Closes #509
2015-02-05 18:00:14 -08:00
Yegor Jbanov 9f6b6cc50c chore(packaging): update imports in tools 2015-02-05 15:58:15 -08:00
Yegor Jbanov bfdcb6c77c chore(build): ignore [info] analyzer warnings 2015-02-05 15:47:13 -08:00
Alex Eagle e20d9dd073 feature(build): add nodejs-based unit test for dart transpiler.
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.
2015-02-05 11:55:49 -08:00
Tobias Bosch 05ffdc9b44 refactor(build): explicitly mention `src` folder in imports
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.
2015-02-05 11:55:48 -08:00
Tobias Bosch b1e76c550e feat(build): auto format the generated dart code.
Fixes #480
Closes #504
2015-01-30 11:10:12 -08:00
Tobias Bosch 62f08d38db fix(tests): don’t fail on current chrome canary 2015-01-28 17:01:32 -08:00
Rado Kirov ec5cb3eb66 feat(package): introduce a catch-all package angular.
modules/angular has no implementation, but depends on all the pieces
that make angular - core, di, directives, etc. It is the package that
all client apps will depend on.
2015-01-23 10:31:24 -08:00
Marc Laval 368cc29d48 fix(gulpfile): fix the pubbuild task on Windows
Closes #349
2015-01-22 15:30:52 -08:00
Tobias Bosch 22653707d9 fix(perf): cloud reporter, calculate insertId correctly so that we don’t loose rows! 2015-01-21 10:40:03 -08:00
Tobias Bosch 5f5ed06713 feat(perf): cloud reporter should retry in case of a timeout 2015-01-20 13:06:37 -08:00
Tobias Bosch ed7d1cf060 feat(perf): cloud reporter, more generic table layout 2015-01-20 13:06:37 -08:00
Jeff Cross a2b58202a0 feat(benchpress): add getStringParameter method to support text and radio inputs 2015-01-15 13:38:31 -08:00
Jeff Cross 39977bd3c2 fix(benchpress): add filter for when cloud config is not present 2015-01-15 13:38:31 -08:00
Tobias Bosch d02c0accbb refactor(benchmarks): add cloud reporter, add params
- 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.
2015-01-15 09:09:05 -08:00
Vojta Jina 0f8f4801bd chore: use fork Traceur with disabled getters/setters
It also includes better debugging class method names for WTF.
2015-01-08 16:03:32 -08:00
Tobias Bosch 77aa3ed61b feat(benchpress): show more metrics and make the run mode configurable
Shows the metrics:
script, render, gcAmount, gcAmountInScript, gcTime

Run modes:
- detect: auto detect whether to force gc
- forceGc: forces a gc before every run and ignores no runs
- noGcInScript: ignore runs that have gc while a script was executing
- plain: does not force gc nor ignore runs

Closes #368
2015-01-07 16:37:52 -08:00
Tobias Bosch 82b1601a31 refactor(benchmarks): rename `timeBenchmark` into `benchmark` 2015-01-07 16:37:52 -08:00
Tobias Bosch 458b2d7215 docs(bench press): add clarifying comment 2015-01-07 16:37:51 -08:00
Tobias Bosch fe2a09bc7f refactor(perf): e2e tests and benchpress should be written in es6 2015-01-06 15:32:49 -08:00
Victor Berchet f04967ad37 chore(traceur): update to 0.0.79
fixes #8
2015-01-06 08:21:43 -08:00
Tobias Bosch 6f303121c6 refactor(perf): introduce benchpress2
Major changes:
- make API more reusable
- format output nicely
- only force gc if needed

Regarding forcing gc:
Forcing gc can change script execution time.
We now don't force gc at first and ignore results where gc happens during script execution.
When we ignored too many results, we switch to forcing gc.

Closes #339
2015-01-05 17:49:50 -08:00
vsavkin 0a4d6170ba fix(gulpfile): fix the dartanalyzer task 2014-12-30 10:32:06 -08:00
Tobias Bosch 3a80c4197d refactor(perf): move navigation into test files and rename `runSimpleBenchmark` 2014-12-29 16:58:31 -08:00
Tobias Bosch 35ac3f3d97 feat(perf): measure error and stop automatically when the numbers are good enough. 2014-12-29 16:58:31 -08:00
vsavkin f06433fb58 feat(test_lib): implement SpyObject 2014-12-29 13:27:17 -08:00
vsavkin 965f70bfbe feat(transpiler): implement @IMPLEMENTS 2014-12-29 12:29:00 -08:00
Tobias Bosch df4ac0dd33 refactor(perf): use webdriver to execute benchmarks
- 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
2014-12-23 22:22:55 -08:00
vsavkin d985045983 fix(build): disable the analysis of third-party libs 2014-12-12 16:24:53 -08:00
Rado Kirov 60456c8b89 feat(ng-repeat): initial implementaion of ng-repeat.
- adds support for content bindings via '[]'.
- directives module
2014-12-11 11:23:02 -08:00
Tobias Bosch 1cd848df55 fix(build): analyze examples and benchmarks again 2014-12-08 12:00:48 -08:00
Tobias Bosch 8db77f2405 refactor(build): simplify and modularize
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
2014-12-05 16:30:36 -08:00
Tommy Odom f088e9ef15 feat(transpiler): Transform for..of to Dart as for..in
fixes #53
2014-12-03 10:48:48 +01:00
Misko Hevery 044625a098 chore: Make field declarations explicit
This used to be valid code:

```
class Foo {
  constructor() {
    this.bar = ‘string’;
  }
}
```

This will now fail since ‘bar’ is not explicitly
defined as a field. We now have to write:

```
class Foo {
  bar:string; // << REQUIRED
  constructor() {
    this.bar = ‘string’;
  }
}
```
2014-11-24 16:35:39 -08:00
Victor Berchet f864aa1f8e fix(class fields): handle untyped fields 2014-11-19 23:12:14 +01:00
Vojta Jina c68e78075a feat(transiler/dart): re-export imported vars
```
import {Foo} from ‘./foo’;
var localVar = true;
export {Foo, localVar};

===>

import ‘./foo’ show Foo;
export ‘./foo’ show Foo;
var localVar = true;
```

Closes #41
2014-11-12 07:01:14 -08:00
Vojta Jina c5153175b6 fix(transpiler/dart): re-exporting only some bindings
```
export {Foo, Bar} from ‘./foo’;
==>
export ‘./foo’ show Foo, Bar;
```
2014-11-12 07:01:14 -08:00
Tobias Bosch 7a70f8f92d feat(compiler): initial version of the compiler.
Supports:
- binds text nodes, element properties and directive properties
- locates decorator, component and template directives.
- inline templates of components

The compiler is built using a pipeline design,
see core/src/compiler/pipeline package.

Integration tests to show how the compiler, change_detection and DI work
together:
core/test/compiler/integration_spec.js
2014-11-11 17:55:50 -08:00
Tommy Odom 93f6d26f68 feat(transpiler): Transform template strings to triple quoted Dart strings 2014-11-10 16:49:51 -08:00
Rado Kirov 4f416694a5 bug(transpiler): Support optional arguments in annotations.
Clean-up: move annotaitons out of fixtures/annotations, since we have
the @CONST annotation in the transpiler already.
2014-11-10 13:47:30 -08:00
Vojta Jina d16d6a02ab feat(transpiler): class fields for Dart 2014-11-07 10:29:48 -08:00
Tommy Odom 8e6326f838 feat(transpiler): allow @CONST annotation on class
Closes #148
2014-11-05 15:44:34 -08:00
Vojta Jina 7d0a83a24c chore(gulp-traceur): better error reporting
Use original filename when printing errors (instead of the output).
2014-11-05 11:42:23 -08:00
Vojta Jina 1dc5a22f07 chore: source maps for Karma/Gulp
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
2014-11-05 11:19:02 -08:00
Marc Laval e1c84e02f8 chore: adds Windows support for build
Closes #104
2014-10-28 21:04:30 -07:00
Victor Berchet 94958e084e fix(super): `super()` now means call the proto of the current function.
See https://github.com/google/traceur-
compiler/commit/6732e5eddf203ae02bcfb8faea837590bf32c061
2014-10-27 22:26:38 +01:00
vsavkin 035dc5ba44 feat(transpiler): add support for getters 2014-10-16 16:11:18 -04:00
vsavkin 1a7d5160f2 use Promise instead of Future 2014-10-12 17:47:52 -04:00
vsavkin f524a89cb6 feat(injector): add support for default bindings 2014-10-12 17:29:02 -04:00
vsavkin ee1e54cf0a feat(transpiler): add support for named params to new expressions 2014-10-12 17:21:50 -04:00
Misko Hevery a9896ed391 design: view instantiation test 2014-10-10 20:54:33 -07:00
Vojta Jina 2d19e7122b refactor(transpiler): instanceof 2014-10-09 15:22:21 -07:00
Vojta Jina c7e9d10f0b test(transpiler): add spec for instanceof 2014-10-09 15:22:20 -07:00
Vojta Jina 85ee62cb0d chore(transpiler): show filepath when error happens 2014-10-09 15:17:53 -07:00
Vojta Jina 94e556465b fix(transpiler): only call transform/visit when defined
Our custom ParseTree classes should not expect that every
transformer/visitor defines the methods to transform/visit them.
2014-10-09 15:08:30 -07:00
Victor Berchet d1b90e125b feat(transpiler): add support for arrow functions
fixes #28
2014-10-09 14:44:07 -07:00
vsavkin 1214f423b4 feat(transpiler): implement optional params 2014-10-09 14:27:32 -07:00
Victor Berchet 5818c3bf28 refactor(named parameters): mimic original traceur architecture 2014-10-08 12:53:55 +02:00
Vojta Jina 38340ce8d9 test(transpiler): add a cycle import spec 2014-10-07 17:35:22 -07:00
Vojta Jina 6efb7f9017 transpiler: normalize Dart library name
`file2module` was used for normalizing paths where `-` is fine.
This normalizes non-word characters only when generating the Dart
library name.
2014-10-07 17:35:22 -07:00
Vojta Jina cfc5fdc60d chore: use es6-module-loader
Switch Traceur to use modules=“instantiate” and use es6-module-loader.
This setup supports cyclic dependencies.
2014-10-07 17:35:22 -07:00
vsavkin b2199632c7 feat(injector): initial implementaion of dynamic injector 2014-10-03 15:35:33 -04:00
Victor Berchet 089a2f1b62 feat(transpiler): constructor and typed field semantics
fixes #11 (constructor and typed field semantics)
fixes #42 (Should we infer class property types from ctor args ?)
fixes #17 (number (js) should map to num (dart))

Closes #45
2014-10-02 21:02:47 -07:00
Tobias Bosch 33af1d0b39 chore(build): execute `pub get` only if a pubspec.yaml changed and run `dart analyzer` on all dart files
`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
2014-10-02 16:10:08 -07:00
vsavkin 64fe73e20d feat(transpiler): handle named params 2014-10-02 17:31:04 -04:00
Chirayu Krishnappa 78d758b4bb fixes to get tests green with karma dart 2014-10-01 19:58:22 -07:00
Chirayu Krishnappa c7feaba1cb feat(DartWriter): support string interpolation 2014-10-01 17:06:17 -07:00
Victor Berchet cff47d4f8e fix(DartWriter): number (js) maps to num (dart) 2014-10-01 11:22:47 -07:00
Victor Berchet 64d3cc68f0 refactor(transpiler): split the monolithic dart transformer
fixes #24

The new architecture conforms with the Traceur architecture.
2014-09-30 16:15:35 +02:00
Tobias Bosch 1907c590c8 refactor: removed stale build file 2014-09-29 14:21:38 -07:00
Tobias Bosch c79f0c3472 refactor: simplify and make tests work in JS and Dart
* 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
2014-09-28 21:50:38 -07:00
Tobias Bosch 39c03e67e6 refactor: rename `js2dart` to `transpiler` 2014-09-26 17:44:42 -07:00
Vojta Jina c3b442ea53 chore: karma with JS, Dart
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`).
2014-09-26 16:53:54 -07:00
Tobias Bosch 7e3005e705 fix(js2dart): make tests work again 2014-09-26 09:54:32 -07:00
Victor Berchet a75a3d0b31 refactor(js2dart): use the parent functionalities as mush as possible
Closes #18
2014-09-26 09:54:24 -07:00
Victor Berchet 2cc1a4c354 refactor(js2dart): refactor dart library statement
fixes #12
closes #16
2014-09-26 09:39:37 -07:00
Misko Hevery 87dd88ff0c fix: correct library not to have lib and dart in name. 2014-09-26 09:23:04 -07:00
Tobias Bosch 100d66222c build: execute `pub get` and `dart analyzer`
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 #13
Closes #5
Closes #2
2014-09-25 17:56:05 -07:00
Misko Hevery b42111a608 design: added record interface 2014-09-25 16:53:32 -07:00
Tobias Bosch 97f6ceb27b moved submodules into this project 2014-09-25 14:30:10 -07:00
Tobias Bosch 61ceed5bf6 moved submodules into the repo 2014-09-25 14:29:51 -07:00
Misko Hevery 8afa421d75 first chunk of interfaces that are valid via dart analyzer 2014-09-25 13:51:50 -07:00
Tobias Bosch 47bd68b33d update js2dart 2014-09-25 10:44:42 -07:00
Tobias Bosch 57b3297bf6 refactor: always use js2dart traceur and make examples run again 2014-09-24 20:20:59 -07:00
Tobias Bosch e5224d2cb3 chore(build): make watch faster / only build what is needed 2014-09-21 22:02:28 -07:00
Tobias Bosch 88aac42c6d chore(build): update to updated version in js2dart 2014-09-20 18:40:17 -07:00
Tobias Bosch afa7616464 build - refactor 2014-09-19 13:59:28 -07:00