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

[BUG] Snippet initialization with IE8 fails with minified code (works with un-minified code) #1852 #1854

Merged
merged 1 commit into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions AISKU/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,15 @@ const browserRollupConfigFactory = (isProduction, libVersion = '2', format = 'um
browserRollupConfig.plugins.push(
uglify({
ie8: true,
ie: true,
toplevel: true,
compress: {
ie: true,
passes:3,
unsafe: true
},
output: {
ie: true,
preamble: banner,
webkit:true
}
Expand Down Expand Up @@ -128,12 +131,15 @@ const nodeUmdRollupConfigFactory = (isProduction) => {
nodeRollupConfig.plugins.push(
uglify({
ie8: true,
ie: true,
toplevel: true,
compress: {
ie: true,
passes:3,
unsafe: true
},
output: {
ie: true,
preamble: banner,
webkit:true
}
Expand Down
4 changes: 2 additions & 2 deletions AISKU/src/ApplicationInsightsContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class ApplicationInsightsContainer {

public static getAppInsights(snippet: Snippet, version: number) : IApplicationInsights | IAppInsightsDeprecated {
const initialization = new ApplicationInsights(snippet);
const legacyMode = version !== 2.0 ? true : false;
const legacyMode = version >= 2 ? false: true;

// Side effect is to create, initialize and listen to the CoreUtils._canUseCookies changes
// Called here to support backward compatibility
Expand All @@ -17,7 +17,7 @@ export class ApplicationInsightsContainer {
// 2. Customer updates to new snippet (that uses cdn location to new SDK. This is same as a new customer onboarding
// and all api signatures are expected to map to new SDK. Note new snippet specifies version

if (version === 2.0) {
if (!legacyMode) {
initialization.updateSnippetDefinitions(snippet);
initialization.loadAppInsights(legacyMode);
return initialization; // default behavior with new snippet
Expand Down
2 changes: 1 addition & 1 deletion AISKU/src/Init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ try {

// overwrite snippet with full appInsights
// only initiaize if required and detected snippet version is >= 2 or not defined
if ((snippet.version >= 2.0 && (_window[aiName] as any).initialize) || snippet.version === undefined ) {
if ((snippet.version >= 2 && (_window[aiName] as any).initialize) || snippet.version === undefined ) {
ApplicationInsightsContainer.getAppInsights(snippet, snippet.version);
}
}
Expand Down
6 changes: 6 additions & 0 deletions AISKULight/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,15 @@ const browserRollupConfigFactory = (isProduction, libV = '2') => {
browserRollupConfig.plugins.push(
uglify({
ie8: true,
ie: true,
toplevel: true,
compress: {
ie: true,
passes:3,
unsafe: true
},
output: {
ie: true,
preamble: banner,
webkit:true
}
Expand Down Expand Up @@ -114,12 +117,15 @@ const nodeUmdRollupConfigFactory = (isProduction) => {
nodeRollupConfig.plugins.push(
uglify({
ie8: true,
ie: true,
toplevel: true,
compress: {
ie: true,
passes:3,
unsafe: true
},
output: {
ie: true,
preamble: banner,
webkit:true
}
Expand Down
6 changes: 6 additions & 0 deletions channels/applicationinsights-channel-js/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,15 @@ const browserRollupConfigFactory = isProduction => {
browserRollupConfig.plugins.push(
uglify({
ie8: true,
ie: true,
toplevel: true,
compress: {
ie: true,
passes:3,
unsafe: true
},
output: {
ie: true,
preamble: banner,
webkit:true
}
Expand Down Expand Up @@ -113,12 +116,15 @@ const nodeUmdRollupConfigFactory = (isProduction) => {
nodeRollupConfig.plugins.push(
uglify({
ie8: true,
ie: true,
toplevel: true,
compress: {
ie: true,
passes:3,
unsafe: true
},
output: {
ie: true,
preamble: banner,
webkit:true
}
Expand Down
Loading