Closed IgorMinar closed 4 years ago
Looking forward for an early release.
Super excited for this ๐ ๐
@ContentChildred
A bit of a typo here ๐ still, can't wait for Ivy to be released! โค๏ธ
I want higher order components ๐
hope Component Composition will land in the 6
I'm sorry to ask here (If you consider this spam, feel free to remove it), but does Ivy renderer aim at improving the runtime perf? The only info I found so far is the new features regarding i18n and the fact that it should be backward compatible. Can anyone point me toward info related to Ivy? Thank you.
@Ploppy3 follow Rob on Twitter https://twitter.com/robwormald/status/961445453391790080 it also shrinks the build size e.g.
@avatsaev The new Feature
feature almost provide the same openness (against class factory), by transforming the type (and compiled metadata) itself during runtime.
Even the OnChanges
hook is now an emulated feature, rather than real life-cycle hooks recognized by Angular.
@avatsaev that is already possible if I understand you correctly https://gist.github.com/chaosmonster/f2576bbd1bc9a50282a2b3b492195b29
@chaosmonster The mixin pattern is not yet generally supported in AOT mode, like life-cycle hooks recognition in #19145 and more issues described in #18644.
@chaosmaster thank you for the link, but in my opnion this looks very sloppy and hacky. The ideal would be one @component
extending another @component
What im unsure about is, what decorator inheritance behavior would be. Override? Extend? Compose?
@avatsaev Higher-Order Components is not a feature, but a code pattern:
Concretely, a higher-order component is a function that takes a component and returns a new component.
The only thing really stop you from doing that is the AOT compiler which does only support top-level classes. The metadata inheritance (overriding) is an independent feature (#13764).
waiting for compiler cli support
Is this target for v6.0.0? Also, will this reduce compile time? (runtime/aot) Great work, keep it up :)
@GuskiS Will only be available behind a flag (non-default) in v6.
The compile build time would be greatly reduced in bazel tooling(https://github.com/angular/angular/issues/19058#issuecomment-346145316 for EAP), regardless of using ivy or not.
@IgorMinar Just out of curiosity. Do you have any documentation about the design of the new Ivy Renderer that is publicy available?
@tmair I asked Rob on Twitter: https://twitter.com/robwormald/status/961727090113396737
Looking forward to this!
Will ivy
allow components to dynamically load html templates as prophecized in https://github.com/angular/angular/issues/15275?
@Karasuni ... mentioning ivy
in https://github.com/angular/angular/issues/15275 was in another context. We have to wait a bit for final features which ivy
brings but it is sure that they are really interesting ... even in the context of using of dynamic ad-hoc components.
@tmair I have a blog post translating answers from @trotyl. It might be helpful to get a rough idea about Ivy.
@HerringtonDarkholme I found your blog post here: https://herringtondarkholme.github.io/2018/02/19/angular-ivy/. It was very informative - thanks!
https://herringtondarkholme.github.io/2018/02/19/angular-ivy/
I'm sorry, but as a non native english speaker, I couldn't understand half of it, it's written in broken english.
What I did understand from the other half, is that Ivy is (very) far from being ready, and will not be retro compatible.
... but still better than Chinese. ๐
is this better ? http://www.clipcode.net/training/clipcode-source-tour.pdf (Appendix)
@avatsaev It will be compatible, but not all integration points are ready now. The original answer is for "how could an Ivy app achieve 3.2KiB", not for "all app in Ivy would look like that in the future".
it's written in broken english.
Far more better than mine already, it's hurting me... ๐ถ (It's fine, I know my English is quite bad)
Can't wait for this !!! Please include the dynamically load template feature similar like Angular JS $compiler
@trotyl yes i agree it was very informative, thanks for the article
@nsksaisaravana for that you'll need to embed the compiler inside your bundle, and you can already do that, it's called jit compilation, but good luck with bundle sizes and performance
I am curious about the i18n stuff. So is dynamic (runtime, non-JIT Comp) i18n expected to come in v6 but only in Ivy, is that what I'm seeing here?
And for clarity, the red X's mean that they aren't implemented yet, but are expected, or won't be implemented in time?
Can you write what changes you make to main post @mgechev ? I would like to track some sort of progress of Ivy. Also, weren't there green ticks instead of grey? :thinking:
Pretty detailed progress-tracking right here, no? What more are you looking for in addition to a table tracking every feature and its current state of implementation?
It is very detailed, yes. But when changes are made - I have no idea what has changed.
@GuskiS
Friday, March 2
Started tracking for changes.
Tuesday, March 6
Content Projection:
Feature | Runtime | Spec | Compiler |
---|---|---|---|
container projectAs | โ๐กชโ | โ๐กชโ | โ |
Wednesday, March 7
Injection Features
Feature | Runtime | Spec | Compiler |
---|---|---|---|
directiveInject(Type) | โ | โ | โ |
sanitization with no injector | โ๐กชโ | โ๐กชโ | โ |
Saturday, March 10
__Refs
Method | View Container Ref | Template Ref | Embeded View Ref | View Ref | Element Ref | Change Detection Ref |
---|---|---|---|---|---|---|
markForCheck() | n/a | n/a | โ | n/a | n/a | โ๐กชโ |
detach() | โ | n/a | โ | n/a | n/a | โ๐กชโ |
detachChanges() | n/a | n/a | โ | n/a | n/a | โ๐กชโ |
reattach() | n/a | n/a | โ | n/a | n/a | โ๐กชโ |
Tuesday, March 13
Injection Features
Feature | Runtime | Spec | Compiler |
---|---|---|---|
attribute('name') | โ๐กชโ | โ๐กชโ | โ |
injectChangeDetectionRef() | โ๐กชโ | โ๐กชโ | โ |
__Refs
Method | View Container Ref | Template Ref | Embeded View Ref | View Ref | Element Ref | Change Detection Ref |
---|---|---|---|---|---|---|
checkNoChanges() | n/a | n/a | โ | n/a | n/a | โ๐กชโ |
Change Detection
Feature | Runtime |
---|---|
markDirty() | โ๐กชโ |
detectChanges() | โ๐กชโ |
tick() | โ๐กชโ |
attach() | โ๐กชโ |
detach() | โ๐กชโ |
ON_PUSH | โ๐กชโ |
ALWAYS | โ๐กชโ |
DIRTY | โ๐กชโ |
ATTACHED | โ๐กชโ |
Template Syntax
Feature | Runtime | Spec | Compiler |
---|---|---|---|
<div [attr.value]="exp"> |
โ | โ๐กชโ | โ |
<div [class.foo]="exp"> |
โ | โ๐กชโ | โ |
<div [style.foo]="exp"> |
โ | โ๐กชโ | โ |
{{ ['literal', exp ] }} |
โ | โ๐กชโ | โ |
{{ { a: 'literal', b: exp } }} |
โ | โ๐กชโ | โ |
{{ exp \| pipe: arg }} |
โ๐กชโ | โ | โ |
Tuesday, March 13
Missing Pieces Sanitization โ๐กชโ
Thursday, March 15
Template Syntax
Feature | Runtime | Spec | Compiler |
---|---|---|---|
{{ ['literal', exp ] }} |
โ | โ | โ๐กชโ |
{{ { a: 'literal', b: exp } }} |
โ | โ | โ๐กชโ |
{{ exp \| pipe: arg }} |
โ | โ | โ๐กชโ |
@Query
Feature | Runtime | Spec | Compiler |
---|---|---|---|
@Query(descendants) |
โ | โ | โ๐กชn/a |
@Query(one) |
โ | โ | โ๐กชn/a |
@Query(read) |
โ | โ | โ๐กชn/a |
@Query(selector) |
โ | โ | โ๐กชn/a |
@Query(Type) |
โ | โ | โ๐กชn/a |
@ContentChild |
โ | โ | โ๐กชโ |
@ViewChild |
โ | โ | โ๐กชโ |
It looks like we will be able to check for future changes over here https://github.com/angular/angular/commits/master/packages/core/src/render3/STATUS.md
When you think it can't get any better you get this ๐ฎ Thanks for the effort ๐
Was it included in Angular 6 RC.0? I tried to enable Ivy renderer in tsconfig.json:
"angularCompilerOptions": {
"enableIvy": true
},
But when I built the project ng build --prod I didn't notice any changes in the size of the generated bundles.
@sergey-morenets There's no inheritance support for angularCompilerOptions
, you'll need to have that on direct tsconfig.json
being used. For example, it should be src/tsconfig.app.json
in a normal Angular CLI project.
@trotyl Thank you for the hints. When I included this flag in tsconfig.app.json and ran ng build --prod I got an error:
ERROR in : Error: Feature host dependencies is not supported yet
at unsupported (C:\proj\node_modules\@angular\compiler\bundles\compiler.umd.js:30592:11)
@sergey-morenets Any possible error are expected for now... ๐
Ivy isn't ready yet, expect some errors (along with some Spanish Inquisition)
Wondering, what's the meaning ofโ๐กชโ
@manfredsteyer ... hmm, I think that it has the sense ... wasn't ready and now it is ready.
Tested Ivy rendering feature with Angular 6 RC1 - error still appeared.
I've migrated our 1.5 years old project from Angular 2 to Angular 5. After trying enabling AOT I got ~500 errors in the project that template cannot access private variables. I personally cannot justify such behavior because it's essential for me that component and template are the single unit and thus should share variables/state. This thread (#11978) says this will be fixed with Ivy compiler but it's not clearly stated when/if it will be supported. My question is: if anyone from Angular (Ivy) team can confirm or refute that private variables in templates will ever be supported with new compiler? It's very important for our project, we should decide weather we need to fix everything now or wait Angular 6-7 to be released (we are OK to wait 4-6 month).
@elepner Fix it now. Not sure what you mean by "single unit" but the "share variables/state" aspect is exactly why the properties the template interfaces with should be public
โthat isn't a bug and I wouldn't see why that would change in Ivy.
@emilio-martinez A single unit means that it self contained UI+behavior component exposing little API and hiding internal state. E.g. we have a typeahead component, it has many fields binded in template like hasFocus: boolean
, onCompletionEnter(): void
etc. Why would I want to make them public? I want to expose only 3 field/methods like inputText
, onResult()
, clear()
. In WPF this is achieved via partial
class. I hope Angular will come to the same conclusion. @trotyl mentioned that in the thread #11978
What exactly is available in ivy? Accessing private component property in template is available, without losing type-checking. I've just checked angular ivy, but just a quick view Both TypeScript private property and ECMAScript private fields are lexical scoped, so it can be observed easily with a quick look at the (position of) generated code.
but I want to get official confirmation.
... just to notice ... the possibility to use private properties in Angular 2.x was made possible by a bug and it has been eliminated later. It was never designed as a feature.
Unfortunately, as @mlc-mlapis said, it works as expected.
But imho template-component-binding should work with private instead of public fields. Otherwise you can not distinguish between fields/methods for template-binding and API for component-to-component communication.
Maybe we should discuss it in a new ticket as it is not directly related to Ivy.
To me it makes sense that private properties aren't available in the template. We take advantage of this feature in our apps, using public/private properties to differentiate between fields used in the template and internal component state that should not be used in the template.
There're pros and cons for allowing private
properties or not, one possible problem is the this
usage:
<p>Hello {{ this.name }}</p>
<ul>
<li *ngFor="let item of this.items">{{ item }}</li>
</ul>
It's not quite convincing to say this
is another class.
Also as mentioned above there're already open issues and this is off-topic.
Overview
Ivy is a new backwards-compatible Angular renderer focused on further speed improvements, size reduction, and increased flexibility.
Ivy is currently not feature complete, but can be tested via
enableIvy: true
angularCompilerOptions
flag.We currently expect Ivy to remain behind the flag until it's feature complete and battle tested at Google. In the meantime you can check out this Hello World demo.
To see status of Ivy implementation go here.
Related Issues: