Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

matsko
Copy link
Contributor

@matsko matsko commented Sep 12, 2018

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).

@mary-poppins
Copy link

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;
Copy link
Contributor

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';
Copy link
Contributor

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();
Copy link
Contributor

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) {
Copy link
Contributor

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');
Copy link
Contributor

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')

@mary-poppins
Copy link

You can preview fa0c403 at https://pr25919-fa0c403.ngbuilds.io/.

@matsko matsko changed the title feat(ivy): introduce ngDevMode utility dispatching feat(ivy): expose a series of debugging tools via console access Sep 21, 2018
@mary-poppins
Copy link

You can preview b0b388e at https://pr25919-b0b388e.ngbuilds.io/.

@matsko matsko added the target: major This PR is targeted for the next major release label Sep 21, 2018
@mary-poppins
Copy link

You can preview bc15ad8 at https://pr25919-bc15ad8.ngbuilds.io/.

@mary-poppins
Copy link

You can preview b36d7f5 at https://pr25919-b36d7f5.ngbuilds.io/.

@mary-poppins
Copy link

You can preview f2085e4 at https://pr25919-f2085e4.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 88bed87 at https://pr25919-88bed87.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 8181a7b at https://pr25919-8181a7b.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 0b57404 at https://pr25919-0b57404.ngbuilds.io/.

@matsko matsko added the action: merge The PR is ready for merge by the caretaker label Sep 24, 2018
@matsko matsko changed the title feat(ivy): expose a series of debugging tools via console access feat(ivy): expose a series of helpful application inspection tools Sep 24, 2018
@kara kara closed this in 0c34471 Sep 25, 2018
@matsko matsko deleted the debugging branch September 25, 2018 20:09
FrederikSchlemmer pushed a commit to FrederikSchlemmer/angular that referenced this pull request Jan 3, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants