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
tslib v1.13.0 has breaking change #1269 #1277
Conversation
MSNev
commented
May 28, 2020
- Removed Dependency on tslib
@@ -17,16 +17,6 @@ | |||
<div id="qunit"></div> | |||
<div id="qunit-fixture"></div> | |||
<script> | |||
function getParameterByName(name, url) { |
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.
Moved to module loader script
@@ -20,7 +61,10 @@ function ModuleLoader(config) { | |||
require([moduleDef.path], function (theModule) { | |||
try { | |||
if (moduleDef.run) { | |||
moduleDef.run(theModule); | |||
doModuleCb(moduleDef, theModule, function(theModule) { |
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 was a bug fix that was stopping direct usage for the tests.
@@ -34,12 +34,12 @@ module.exports = function (grunt) { | |||
tsconfig: './shared/AppInsightsCore/tsconfig.json' | |||
}, | |||
coretest: { | |||
tsconfig: './shared/AppInsightsCore/src/JavaScriptSDK.Tests/tsconfig.json', |
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 moved the core tests out from the src folder, so they are now in the same place as all of the other components
@@ -1,10 +1,11 @@ | |||
// Copyright (c) Microsoft Corporation. All rights reserved. | |||
// Licensed under the MIT License. | |||
"use strict"; | |||
import { getWindow, getDocument, strUndefined, strObject, strFunction, strPrototype, getCrypto } from './EnvUtils'; | |||
import { objCreateFn, strShimObject, strShimUndefined, strShimFunction, strShimPrototype } from "@microsoft/applicationinsights-shims"; |
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.
Reusing these properties to aid with minification for the full Sku's.
Just importing the files does not cause the __extends and __assigns shims to be uised.
"importHelpers": true, | ||
"noEmitHelpers": true, | ||
"importHelpers": false, | ||
"noEmitHelpers": false, |
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 is the normal approach for breaking the tslib dependency, using this here as we don't have multiple __extend usages, so it's not as much of an issue for this development only tool
@@ -0,0 +1,111 @@ | |||
// Copyright (c) Microsoft Corporation. All rights reserved. |
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 IS the main shim file that gets included
d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new (__ as any)()); | ||
} | ||
|
||
let globalObj:any = getGlobal() || {}; |
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.
From here on is the primary "tricks" to wire up to the global __extends; __assign and local versions (lines 109, 110).
The primary change that this introduces (as opposed to not using tslib), is that moving forward if the consumer (of the npm packages) has defined their own __extends() and/or __assign() then this code WILL use them, previously the tslib versions where the only possible usages because tslib was a injected (via require) and used as tslib_1.__extend() rather than the global versions.
8358b3d
to
60ae871
Compare
60ae871
to
6290a14
Compare
- Removed Dependency on tslib
6290a14
to
c7cd35f
Compare