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(enableDebugTools): create AngularTools at ng.tools #12003

Merged
merged 1 commit into from Nov 3, 2016

Conversation

Projects
None yet
6 participants
@danielcrisp
Contributor

danielcrisp commented Sep 30, 2016

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x")

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

ng.probe and ng.coreTokens are clobbered when you use enableDebugTools because the AngularTools class overwrites context.ng like this:

```javascript
context.ng = new AngularTools(ref);
```

Source: https://github.com/angular/angular/blob/master/modules/%40angular/platform-browser/src/browser/tools/tools.ts#L30

This means extensions like Augury no longer work because they use ng.probe.

More info: #12002

What is the new behavior?

AngularTools is now created at context.ng.tools so existing methods and properties on ng. are not affected.

This also allows disableDebugTools to remove the tools when required.

Unit tests and docs have been modified to incorporate this new location.

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[x] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

Fixes #12002

fix(enableDebugTools): create AngularTools by merging into context.ng
When using `enableDebugTools` the tools are merged into `context.ng` to prevent `ng.probe` and `ng.coreTokens` from being clobbered.

Fixes #12002

@googlebot googlebot added the cla: yes label Oct 3, 2016

@danielcrisp

This comment has been minimized.

Show comment
Hide comment
@danielcrisp

danielcrisp Oct 4, 2016

Contributor

Updated using a merge approach instead to maintain the ng.profiler API

Contributor

danielcrisp commented Oct 4, 2016

Updated using a merge approach instead to maintain the ng.profiler API

@vikerman vikerman merged commit b2cf379 into angular:master Nov 3, 2016

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
cla/google All necessary CLAs are signed
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@danielcrisp danielcrisp deleted the danielcrisp:fix-ng-probe-enableDebugTools branch Nov 3, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment