This fixes several minor indentation issues (instanceof precendence,
type declaration specificity, template string length calculation).
This should also fix some flip-flop situations with template strings.
Travis creates an empty node_modules directory when the cache is empty which confuses
our current script into thinking that it's ok to require fs-extra. While this is rare,
it's better not to depend on anything in node_modules when purging it, so I reimplemented
recorsive delete that we use to purse node_modules.
This change causes the build system to write a log file into the tmp folder after each build.
This file contains command line arguments that tell karma about all the added/changed/removed files
from the last build. Karma can then use this list instead of doing internal globbing which can be
very expensive especially for hte dart builds that contain thousands of files.
Closes#2437
One of the non-angular broccoli plugins returns a weird object. We can't
assume that all trees meet the contract that we expect them to meet, so
we do a typecheck before storing the result of the rebuild.
Closes#2662
BREAKING CHANGES:
- host actions don't take an expression as value any more but only a method name,
and assumes to get an array via the EventEmitter with the method arguments.
- Renderer.setElementProperty does not take `style.`/... prefixes any more.
Use the new methods `Renderer.setElementAttribute`, ... instead
Part of #2476Closes#2637
This implementation only works in JavaScript, while the Observable transpilation
story gets worked out. Right now, the service just makes a simple request,
and returns an Observable of Response.
Additional functionality will be captured in separate issues.
Fixes#2028
Once we add support for addedPaths then this implementation will be significantly faster than the original.
In the meantime we benefit from having stable output directory which solves issues with certain files disappearing
during rebuild of a tree that contains flatten and mergeTree plugins.
Closes#2418
It is very noisy, especially when multiple trees are used. Since the
tree differ is fairly quick, it's not measuring the real costs of a
plugin anyhow.
Closes#2378
clang-format 1.0.17 substantially improves formatting for fat arrow functions
and array literal detection. It also fixes a number of minor formatting issues.
It was confusing because the test.unit.dart task does ignore the initial, and
the logger was hardcoded to always ignore the first task, leading to the appearance
that a run was happening twice for no reason.
Also, fixed the "fake ignoreInitial" handling to not rely on a fake event, which
is not necessary.
Closes#2101
Use the `ProtoViewDto` created by the render `Compiler` to create a
`ChangeDetectorDefinition`.
From there, generate a subclass of `AbstractChangeDetector` for each
`ChangeDetectorDefinition`.
Run some basic unit tests for the dynamic and JIT change detectors on
pre-generated change detectors.
Previously we assumed that all input and ouput paths for broccoli trees are immutable, that turned out to be
incorrect.
By adding a tree stabilizer plugin in front of each diffing plugin, we ensure that the input trees
are stable. The stabilization is done via symlinks which is super cheap on platforms that support
symlinks. On Windows we currently copy the whole input directory, which is far from ideal. We should
investagate if using move operation on Windows is ok in the future to improve performance.
Closes#2051
But do it during the build process for cjs.
Right now we only need this when we transpile from ts
directly to es5. This is only the case in our
cis build, as for our browser build we only transpile
from ts to es6 via ts and then use traceur to do
the rest.
Previously, tree-differ would not correctly handle symlinks to deleted files, resulting in
an ENOENT errno being tossed by libuv.
This change fixes this to ensure that symlinks are safely handled, performantly.
Closes#1961
BREAKING CHANGE:
VmTurnZone has been renamed to NgZone.
- The public API has not chnanged,
- The "outer" zone is now named "mount" zone (private to NgZone).
Before this PR there were only 2 zones: root zone = outer zone > inner
zone.
This PR creates the outer zone as a fork of the root zone: root > outer
> inner.
By doing this it is possible to detected microtasks scheduling in the
outer zone and run the change detection less often (no more than one
time per VM turn).
The PR also introduce a Promise monkey patch for the JS implementation.
It makes Promises aware of microtasks and again allow running the change
detection only once per turn.
Update the `TemplateCompile` step to use the full render `Compiler`.
Provide `DirectiveMetadata` for `ViewDefinition` objects and use it to
run the `DirectiveParser` step of the render compile pipeline.
Special regexp tokens were allowed unchanged previously, which incorrectly broke
the include/exclude behaviour. Now, they're escaped first.
Closes#1721Closes#1752
tree-differ:
- export both TreeDiffer and DiffResult interface
diffing-broccoli-plugin:
- factory class for wrapping DiffingBroccoliPlugins and turning them into BroccoliTrees
broccoli-dest-copy:
- refactor into DiffingBroccoliPlugin
broccoli-traceur:
- refactor into DiffingBroccoliPlugin
Previously, karma used a custom preprocessor. Instead, have karma
run built dart from the `dist` folder and use gulp and broccoli
to watch for changes.
This removes .es6 files which are pure duplicates of a
.ts file in the same folder.
Next we need to remove .js files as well, and remove karma preprocessors for dart.
This is a prerequisite for switching to TypeScript. We need to remove the Traceur preprocessor
from Karma, so we have the build specified in a single place (broccoli tree def'n).
components:
- gulp test.unit.broccoli task
- mock-fs for mocking our FS in unit tests
- jasmine d.ts file for type checking
jasmine lib is provided by minijasmine2 so we don't need to include it explicitly
This change solves several problems:
- the broccoli pipeline is used to compile the node/cjs tree upon any change to the modules/ directory
- jasmine tests run in a new process removing the need to clean up environment after each test
- since we transpile only those test files that are actually needed for node/cjs build, we transpile less and don't need to filter out tests
Our style guide includes formatting conventions. Instead of wasting time in reviewing PRs discussing things like indenting, and to avoid later deltas to fix bad formatting in earlier commits, we want to enforce these in the build.
The intent in this change is to fail the build as quickly as possible in travis, so those sending a PR immediately know they should run clang-format and update their commit. When running locally, we want users to know about formatting, but they may not want to act on it immediately, until they are done working. For this reason, it is only a warning outside of the continuous build.
This is done by having a check-format task which should run on most local builds, and an enforce-format task only run by travis.
- Allow pub (build|serve) to specify mode
- Update pubbuild.js & pubserve.js to allow the caller to provide a `mode` value.
- Update settings to allow the di benchmark to be transformed to run statically.
* `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.
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.
- 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.
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
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
- 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
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’;
}
}
```
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
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
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
`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