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
feat(ivy): expose a series of helpful application inspection tools #25919
Conversation
You can preview 88c7760 at https://pr25919-88c7760.ngbuilds.io/. |
@@ -38,6 +39,9 @@ export interface LContext { | |||
/** The instance of the DOM node that is attached to the lNode */ | |||
native: RElement; | |||
|
|||
/** The root context data of the angular application */ | |||
rootContext: RootContext|undefined; |
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.
you can't store rootContext
is a global position since there may be more than one applications bootstrapped and each has its own rootContext
This is especially common with tests. We need to look up rootContext
on as needed basis.
* This value reflects the property on the window where the dev | ||
* tools are patched. | ||
* */ | ||
export const WINDOW_KEY_NAME = 'ngDev'; |
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.
I think it should just be ng
.
devModePublish('getRootComponents', getRootComponents); | ||
devModePublish('getDirectives', getDirectives); | ||
} else { | ||
placeNonDevModeWarning(); |
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.
I don't think we need this. This will bloat hello world unnecessarily, so I would skip the warning.
} | ||
} | ||
|
||
if (ngDevMode) { |
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.
we should check to see if this if (ngDevMode)
is needed. Remove it look at hollo world and verify that the method was removed, and if so drop it here.
function loadContext(target: {}): LContext { | ||
const context = getContext(target); | ||
if (!context) { | ||
throw new Error('Unable to find the given context data for the given target'); |
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.
because we want hello world as small as possible can you make the error shorter in dev mode. throw new Error(ngDevMode ? 'Long detailed error' : 'shortError')
You can preview fa0c403 at https://pr25919-fa0c403.ngbuilds.io/. |
You can preview b0b388e at https://pr25919-b0b388e.ngbuilds.io/. |
You can preview bc15ad8 at https://pr25919-bc15ad8.ngbuilds.io/. |
You can preview b36d7f5 at https://pr25919-b36d7f5.ngbuilds.io/. |
You can preview f2085e4 at https://pr25919-f2085e4.ngbuilds.io/. |
You can preview 88bed87 at https://pr25919-88bed87.ngbuilds.io/. |
You can preview 8181a7b at https://pr25919-8181a7b.ngbuilds.io/. |
You can preview 0b57404 at https://pr25919-0b57404.ngbuilds.io/. |
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. |
When Angular runs in development mode, any package inside and
outside of Angular can dispatch various utility functions and
debug mechanisms onto the window object (which then allows for
trivial access through the browser console).