-
Notifications
You must be signed in to change notification settings - Fork 240
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
created initial debug plugin #1297
Conversation
fudgepop01
commented
Jun 16, 2020
- added parent bubble
- added copy feature for detailed view
- refactor logger element, allow copy/pasting
af26ef4
to
60b0bfc
Compare
$cacheControlValue = "public, max-age=1800, immutable"; | ||
$contentType = "text/javascript; charset=utf-8"; | ||
|
||
function Show-Menu |
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 believe you need this file unless you are planning to expose this in CDN
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 are planning on uploading this to the CDN, so that it's easier to include for different sites, even if they are using the snippet.
@@ -0,0 +1,61 @@ | |||
const myFunc = () => { |
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.
Rename this file to sample.js or main or something like that
60b0bfc
to
474b1b0
Compare
this.trackers = trackers; | ||
} | ||
|
||
initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) { |
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 method code is quite big, consider to split in multiple methods for better readability
extensions/applicationinsights-debugplugin-js/src/InternPlugin.ts
Outdated
Show resolved
Hide resolved
extensions/applicationinsights-debugplugin-js/src/InternPlugin.ts
Outdated
Show resolved
Hide resolved
extensions/applicationinsights-debugplugin-js/src/InternPlugin.ts
Outdated
Show resolved
Hide resolved
extensions/applicationinsights-debugplugin-js/src/components/styleNodeSrc.ts
Outdated
Show resolved
Hide resolved
474b1b0
to
fd7d43e
Compare
@@ -0,0 +1,24 @@ | |||
const polka = require("polka"); |
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 actually need this at all as you should be able to just load the index.html directly.
The only difference would be around cors related headers handling (which I recently auto disabled when the protocol is file://)
extensions/applicationinsights-debugplugin-js/sample/public/sample.html
Outdated
Show resolved
Hide resolved
extensions/applicationinsights-debugplugin-js/src/DebugPlugin.ts
Outdated
Show resolved
Hide resolved
extensions/applicationinsights-debugplugin-js/src/components/debugBins.ts
Outdated
Show resolved
Hide resolved
a4eed21
to
dce9f5b
Compare
|
||
This README is broken down into several parts: | ||
|
||
- **Supported Browsers** |
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.
Can you add links to the actual sections here so user can navigate easier?
extensions/applicationinsights-debugplugin-js/sample/package.json
Outdated
Show resolved
Hide resolved
extensions/applicationinsights-debugplugin-js/src/DebugPlugin.ts
Outdated
Show resolved
Hide resolved
propertiesExt = extensions[i]; | ||
} | ||
else if (extensions[i].identifier === 'AppInsightsChannelPlugin') { | ||
channelPluginExt = extensions[i]; |
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 will need to change this as part of the next checkin as this is not always the case.
The extensions used by the internal Microsoft Teams don't all use this channel.
Like wise with the Properties plugin.
extensions/applicationinsights-debugplugin-js/src/DebugPlugin.ts
Outdated
Show resolved
Hide resolved
extensions/applicationinsights-debugplugin-js/src/DebugPlugin.ts
Outdated
Show resolved
Hide resolved
if (CoreUtils.arrIndexOf(propertiesProtoFns, tracker) !== -1) { target = propertiesExt['__proto__'] } | ||
else if (CoreUtils.arrIndexOf(analyticsProtoFns, tracker) !== -1) { target = analyticsExt['__proto__'] } | ||
else if (CoreUtils.arrIndexOf(ajaxProtoFns, tracker) !== -1) { target = ajaxDependencyExt['__proto__'] } | ||
else if (CoreUtils.arrIndexOf(diagLogProtoFns, tracker) !== -1) { target = diagLog['__proto__'] } | ||
// special case for sender | ||
else if (tracker === '_sender') { target = channelPluginExt } | ||
else if (CoreUtils.arrIndexOf(channelProtoFns, tracker) !== -1) { target = channelPluginExt['__proto__'] } | ||
else { continue; } | ||
InstrumentFunc(target, tracker, { | ||
req: _self.preProcessItem(tracker) as any as () => InstrumentorHooksCallback, | ||
rsp: _self.postProcessItem(tracker) as any as () => InstrumentorHooksCallback | ||
}); |
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 seems overly complex, as I though I built some of these protections into the InstrumentFunc, but we can review later.
extensions/applicationinsights-debugplugin-js/src/DebugPlugin.ts
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,116 @@ | |||
export class DebugBinParent { | |||
public el: HTMLDivElement; |
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.
Do these need to be public? (if not then perhaps use DynamicProto() or just create your own closure in the constructor)
extensions/applicationinsights-debugplugin-js/src/components/helpers.ts
Outdated
Show resolved
Hide resolved
d590383
to
fbf5803
Compare
fbf5803
to
0a4ab15
Compare
// Application Insights Configuration | ||
var configObj = { | ||
instrumentationKey: "MyInstrumentationKey", | ||
appId: "OSKAR", |
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.el.appendChild(this.ObjectToElements(target, key, level)); | ||
} | ||
|
||
// git push -f origin MSDAReba/debugplugin |
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.
Should be remove
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
export interface ITelemetryConfig { |
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 probably call this IDebugPlugConfig, we can do this is a followup PR
}); | ||
appInsights.loadAppInsights(); | ||
``` | ||
|
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.
Next PR we should include details about the config, in a table like some of the other readme's