BREAKING CHANGE:
Instead of configuring pipes via a Pipes object, now you can configure them by providing the pipes property to the View decorator.
@Pipe({
name: 'double'
})
class DoublePipe {
transform(value, args) { return value * 2; }
}
@View({
template: '{{ 10 | double}}'
pipes: [DoublePipe]
})
class CustomComponent {}
Closes#3572
This requires delicate handling of type definitions which collide, because
we use TypeScript-provided lib.d.ts for --target=es5 and lib.es6.d.ts for
--target=es6.
We need to include our polyfill typings only in the --target=es5 case,
and the usages have to be consistent with lib.es6.d.ts.
Also starting with this change we now typecheck additional modules,
so this fixes a bunch of wrong typings which were never checked before.
Fixes#3178
This change also makes us compliant with 1.6.0-dev compiler,
so we can do some experiments with apps that use 1.6 features
and compile against Angular.
We should probably add a travis build for 1.6 so we stay compatible
with both versions.
Static binary component tree of depth 10, i.e. 1024 components.
Current numbers for `pureScriptTime` are:
JavaScript:
Baseline: 27.10+-9%
Ng2: 26.84+-8%
Ng1: 55.30+-14%
Dart:
Baseline: 30.13+-4%
Ng2: 45.94+-3%
Ng1: 128.88+-10%
I.e. in JS we are same speed as baseline right now!
Some background: We had a recent change in the compiler that merges components into their parents already during compilation (#2529). This made Ng2 2x faster in this benchmark (before the Ng2 JS time was 49.59+-14%ms).
Closes#3196
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.
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.
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 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.