New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ivy): TestBed.get(Compiler) throws "Error: Runtime compiler is not loaded" #27223
Conversation
You can preview e1b3860 at https://pr27223-e1b3860.ngbuilds.io/. |
export class DebugNode { | ||
listeners: EventListener[] = []; | ||
parent: DebugElement|null = null; | ||
export interface DebugNode { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change, technically speaking, right? I mean, previously people could import and instantiate DebugNode
and it was part of the public API.
I don't suspect that many people actually do it but we should still document this as a breaking change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my point of view we have accidentally exposed more API than we intended to.
- We exposed the constructor
- We exposed the mutation methods
By changing this from class
to interface
I think we are only removing the API which was accidentally exposed and which serves no purpose to the end user.
PS: I will better document this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhevery Could you add to the list of breaking changes that instanceof DebugNode
checks can no longer be done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JoostK will add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhevery it should be fine to change this behavior, but we need to document it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhevery I've left few comments in the code, the most important being about breaking changes. I was trying to take the same approach in the past but I got scared off the breaking changes with triggering event handlers etc. Basically we would loose the abstraction over native platform and this sounds like "big deal". Let's discuss.
If we decide to go ahead with this approach it is not clear for me what should happen with https://github.com/angular/angular/blob/master/packages/core/src/render3/debug.ts and all infrastructure that plugs it (https://github.com/angular/angular/blob/master/packages/core/testing/src/r3_test_bed.ts#L426-L429)
Lastly, the CI is red with some tests failing.
You can preview afe9b25 at https://pr27223-afe9b25.ngbuilds.io/. |
Ahh that is an excellent Catch! Yes that code is dead and I have now deleted it. :-) |
afe9b25
to
bb8f9cb
Compare
You can preview bb8f9cb at https://pr27223-bb8f9cb.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhevery if you are positive that we can implement the rest of the DebugElement
methods this LGTM
Would be probably good if someone else can do another pass on it as we are touching many parts
c479d06
to
dfbf641
Compare
You can preview c479d06 at https://pr27223-c479d06.ngbuilds.io/. |
You can preview dfbf641 at https://pr27223-dfbf641.ngbuilds.io/. |
dfbf641
to
2564f80
Compare
You can preview 2564f80 at https://pr27223-2564f80.ngbuilds.io/. |
You can preview 07c95ec at https://pr27223-07c95ec.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest looks good
You can preview 8ecc627 at https://pr27223-8ecc627.ngbuilds.io/. |
8ecc627
to
9028161
Compare
You can preview 9028161 at https://pr27223-9028161.ngbuilds.io/. |
@mhevery looks like CI is red (the golden symbols file need updating etc.) |
You can preview 8ee99af at https://pr27223-8ee99af.ngbuilds.io/. |
8ee99af
to
7e65c8a
Compare
You can preview 7e65c8a at https://pr27223-7e65c8a.ngbuilds.io/. |
This fixes an issue where a value would hide the type. ``` export interface Foo { someMethod(): void; } export const Foo: Function = ...; ``` In the above example the `Foo` constant will hide the `interface Foo` symbol. This change properly saves the interface in addition to the type.
…t loaded" BREAKING CHANGE: The public API for `DebugNode` was accidentally too broad. This change removes 1. Public constructor. Since `DebugNode` is a way for Angular to communicate information on to the developer there is no reason why the developer should ever need to Instantiate the `DebugNode` 2. We are also removing `removeChild`, `addChild`, `insertBefore`, and `insertChildAfter`. All of these methods are used by Angular to constructor the correct `DebugNode` tree. There is no reason why the developer should ever be constructing a `DebugNode` tree And these methods should have never been made public. 3. All properties have been change to `readonly` since `DebugNode` is used by Angular to communicate to developer and there is no reason why these APIs should be writable. While technically breaking change we don’t expect anyone to be effected by this change.
7e65c8a
to
8504136
Compare
You can preview 8504136 at https://pr27223-8504136.ngbuilds.io/. |
You can preview f6f9612 at https://pr27223-f6f9612.ngbuilds.io/. |
…t loaded" (#27223) BREAKING CHANGE: The public API for `DebugNode` was accidentally too broad. This change removes 1. Public constructor. Since `DebugNode` is a way for Angular to communicate information on to the developer there is no reason why the developer should ever need to Instantiate the `DebugNode` 2. We are also removing `removeChild`, `addChild`, `insertBefore`, and `insertChildAfter`. All of these methods are used by Angular to constructor the correct `DebugNode` tree. There is no reason why the developer should ever be constructing a `DebugNode` tree And these methods should have never been made public. 3. All properties have been change to `readonly` since `DebugNode` is used by Angular to communicate to developer and there is no reason why these APIs should be writable. While technically breaking change we don’t expect anyone to be effected by this change. PR Close #27223
The fix in angular#27223 unblocks these tests
…ular#27223) This fixes an issue where a value would hide the type. ``` export interface Foo { someMethod(): void; } export const Foo: Function = ...; ``` In the above example the `Foo` constant will hide the `interface Foo` symbol. This change properly saves the interface in addition to the type. PR Close angular#27223
…t loaded" (angular#27223) BREAKING CHANGE: The public API for `DebugNode` was accidentally too broad. This change removes 1. Public constructor. Since `DebugNode` is a way for Angular to communicate information on to the developer there is no reason why the developer should ever need to Instantiate the `DebugNode` 2. We are also removing `removeChild`, `addChild`, `insertBefore`, and `insertChildAfter`. All of these methods are used by Angular to constructor the correct `DebugNode` tree. There is no reason why the developer should ever be constructing a `DebugNode` tree And these methods should have never been made public. 3. All properties have been change to `readonly` since `DebugNode` is used by Angular to communicate to developer and there is no reason why these APIs should be writable. While technically breaking change we don’t expect anyone to be effected by this change. PR Close angular#27223
The fix in angular#27223 unblocks these tests PR Close angular#27305
…ular#27223) This fixes an issue where a value would hide the type. ``` export interface Foo { someMethod(): void; } export const Foo: Function = ...; ``` In the above example the `Foo` constant will hide the `interface Foo` symbol. This change properly saves the interface in addition to the type. PR Close angular#27223
…t loaded" (angular#27223) BREAKING CHANGE: The public API for `DebugNode` was accidentally too broad. This change removes 1. Public constructor. Since `DebugNode` is a way for Angular to communicate information on to the developer there is no reason why the developer should ever need to Instantiate the `DebugNode` 2. We are also removing `removeChild`, `addChild`, `insertBefore`, and `insertChildAfter`. All of these methods are used by Angular to constructor the correct `DebugNode` tree. There is no reason why the developer should ever be constructing a `DebugNode` tree And these methods should have never been made public. 3. All properties have been change to `readonly` since `DebugNode` is used by Angular to communicate to developer and there is no reason why these APIs should be writable. While technically breaking change we don’t expect anyone to be effected by this change. PR Close angular#27223
The fix in angular#27223 unblocks these tests PR Close angular#27305
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This PR adds support for the
TestBed.get(Compiler)
and unblocks FW-561.fix(ivy): TestBed.get(Compiler) throws "Error: Runtime compiler is not loaded"
BREAKING CHANGE:
The public API for
DebugNode
was accidentally too broad. This change removesDebugNode
is a way for Angular to communicate informationon to the developer there is no reason why the developer should ever need to
Instantiate the
DebugNode
removeChild
,addChild
,insertBefore
, andinsertChildAfter
.All of these methods are used by Angular to constructor the correct
DebugNode
tree.There is no reason why the developer should ever be constructing a
DebugNode
treeAnd these methods should have never been made public.
readonly
sinceDebugNode
is used by Angularto communicate to developer and there is no reason why these APIs should be writable.
While technically breaking change we don’t expect anyone to be effected by this change.