feat(dart/transform): Use the best available Change Detectors
Enable pregenerated (for Dart) and JIT (for Js) change detectors when possible. Previously we would always use `DynamicChangeDetector`s, but these cause megamorphic calls and are therefore much slower. Closes #502
This commit is contained in:
+1
-3
@@ -22,8 +22,6 @@ void initReflector(reflector) {
|
||||
..registerType(HelloCmp, {
|
||||
'factory': () => new HelloCmp(),
|
||||
'parameters': const [const []],
|
||||
'annotations': const [
|
||||
const Component(changeDetection: 'CHECK_ONCE')
|
||||
]
|
||||
'annotations': const [const Component(changeDetection: 'CHECK_ONCE')]
|
||||
});
|
||||
}
|
||||
|
||||
+1
-3
@@ -22,8 +22,6 @@ void initReflector(reflector) {
|
||||
..registerType(HelloCmp, {
|
||||
'factory': () => new HelloCmp(),
|
||||
'parameters': const [const []],
|
||||
'annotations': const [
|
||||
const Component(events: ['onFoo', 'onBar'])
|
||||
]
|
||||
'annotations': const [const Component(events: ['onFoo', 'onBar'])]
|
||||
});
|
||||
}
|
||||
|
||||
+2
@@ -20,6 +20,8 @@ void initReflector(reflector) {
|
||||
const View(template: 'Salad')
|
||||
]
|
||||
});
|
||||
_gen.preGeneratedProtoDetectors['MyComponent_comp_0'] =
|
||||
_MyComponent_ChangeDetector0.newProtoChangeDetector;
|
||||
}
|
||||
class _MyComponent_ChangeDetector0 extends _gen.AbstractChangeDetector {
|
||||
final dynamic _dispatcher;
|
||||
|
||||
Reference in New Issue
Block a user