Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 68.8 KB

breaking-changes.md

File metadata and controls

28 lines (19 loc) · 68.8 KB

Breaking Changes since 1/28/2019

  • Additional Q&A about breaking changes can be found here
  • To ask a question about breaking changes use this

5.0.302.18801

4385005Fix Controls APIs to move from create overrides to createXXX model

In Essentials Control:
Replaced the overriden 'create' method for the various Essentials control variants to separate and easily identifiable create methods - createDefaultResourceLayout, createCustomResourceLayout & createNonResourceLayout.

To address compilation errors, update the code as follows:
create(ltm, options: DefaultResourceLayout) => createDefaultResourceLayout(ltm, options: DefaultResourceLayout)
create(ltm, options: CustomResourceLayout) => createCustomResourceLayout(ltm, options: CustomResourceLayout)
create(ltm, options: NonResourceLayout) => createNonResourceLayout(ltm, options: NonResourceLayout)


In FileUpload Control:
Replaced the overriden 'create' method for the various FileUpload control variants to separate and easily identifiable create methods - createFullUpload, createStreamUpload & createBlobStoreUpload.
Also introduced FullUploadOptions/FullUploadContract, StreamUploadOptions/StreamUploadContract for the respective create method variants.

To address compilation errors, update the code as follows:
create(ltm, options: Options) => createFullUpload(ltm, options: FullUploadOptions
                                                     OR 
                                                     createStreamUpload(ltm, options: StreamUploadOptions)
create(ltm, options: BlobUploadOptions) => createBlobStoreUpload(ltm, options: BlobUploadOptions)


In RangeSlider Control
Replaced the overriden 'create' method for the various RangeSlider control variants to separate and easily identifiable create methods - createSimpleRangeSlider & createCustomRangeSlider.
Also renamed CustomValueOptions/CustomValueContract to CustomRangeSliderOptions/CustomRangeSliderContract, and introduced SimpleRangeSliderOptions/SimpleRangeSliderContract.

To address compilation errors, update the code as follows:
create(ltm, options: Options) => createSimpleRangeSlider(ltm, options: SimpleRangeSliderOptions)
create(ltm, options: CustomValueOptions) => createCustomRangeSlider(ltm, options: CustomRangeSliderOptions)


In Slider Control
Replaced the overriden 'create' method for the various Slider control variants to separate and easily identifiable create methods - createSimpleSlider & createCustomSlider.
Also renamed CustomValueOptions/CustomValueContract to CustomSliderOptions/CustomSliderContract, and introduced SimpleSliderOptions/SimpleSliderContract.

To address compilation errors, update the code as follows:
create(ltm, options: Options) => createSimpleSlider(ltm, options: SimpleSliderOptions)
create(ltm, options: CustomValueOptions) => createCustomSlider(ltm, options: CustomSliderOptions)

5.0.302.17401

4209933[ibiza][Tile Gallery]remove `ThumbnailStretch` of PartGalleryInfoDefinition from the whole framework


**TypeScript Error**
PartGalleryInfoDefinition may throw error `Type '{ "title": string; "description": string; "category": string; "thumbnail": Image; "thumbnailStretch": 0; }' is not assignable to type 'PartGalleryInfoDefinition'`. or `'thumbnailStretch' does not exist in type 'PartGalleryInfoDefinition'`.

**PDL Error**
`Cannot set unknown member 'Microsoft.Portal.Pdc.Schema.PartGalleryInfo.ThumbnailStretch'`

**Solution:**
Just remove the `thumbnailStretch` property from `PartGalleryInfoDefinition`.

**Reason for Breaking Change:**
`ThumbnailStretch` property is no longer used in the Tile Gallery feature. 

4198773[ibiza][Tile Gallery] Breaking Change: remove `pivotKind` of PartGalleryInfoDefinition from the whole framework


**Expected Error:**
PartGalleryInfoDefinition may throw error `Type '{ "title": string; "description": string; "category": string; "thumbnail": Image; "thumbnailStretch": 0; "pivotKind": number; }' is not assignable to type 'PartGalleryInfoDefinition'`. or `'pivotKind' does not exist in type 'PartGalleryInfoDefinition'`.

**Solution:**
Just directly remove the `pivotKind` property from `PartGalleryInfoDefinition`.

**Reason for Breaking Change:**
`pivotKind` property is not used in the new Tile Gallery any more. It's unnecessary still keeping it in the `PartGalleryInfoDefinition`.

4186923[ibiza][Tile Gallery]remote unnecessary interface and class from old tile gallery

No description available for this breaking change.

3917489Change EditableGrid to use AMD Toolbar control

EditableGrid has been updated to use the AMD toolbar control "Fx/Controls/Toolbar".
This may cause compilation errors.
To resolve the errors change usages from MsPortalFx.ViewModels.Toolbar to the AMD toolbar control and toolbar buttons.
When updating a command button the replacements for 'canExecute' and 'execute' are 'disabled' and 'onClick' respectively.

3870343Grid2 allow specifying row height

The ability to set the row height for all grid rows was added.
The current defineRow callback was not sufficient for this setting since it applies to all rows.
A new row options setting was added to replace defineRow.

defineRow: (_rowLifetime, item) => {
    return {
        ariaLabel: item.title,
        disabled: item.isDisabled,
    };
}

row: {
    height: 32,
    ariaLabel: (_rowLifetime, item) => item.title,
    disabled: (_rowLifetime, item) => item.isDisabled,
}

3811511Remove jQuery promises


Expected Errors:

N/A

Solution:
In MsPortalFx.ViewModels.Controls.Visualization.Graph.Contract 

Old API: 
addEdge(edgeToAdd: IGraphEdgeForAddition): JQueryPromise;
deleteEntities(nodesToDelete: IGraphNodeForDeletion[], edgesToDelete: IGraphEdgeForDeletion[]): JQueryPromise;

New API:
addEdge(edgeToAdd: IGraphEdgeForAddition): Q.Promise;
deleteEntities(nodesToDelete: IGraphNodeForDeletion[], edgesToDelete: IGraphEdgeForDeletion[]): Q.Promise;

Reason For Breaking Change
- Cleaning up JQueryPromise usage and migrate to native promise/Q promise for performance and code maintenance.

3800421Fix errors in video control due to multiple instances

'canAutoplay' property is not available on the 'Options' interface of the Video control anymore. This property had no affect on the widget and the extension simply needed to set/unset the 'autoplay' property. The 'canAutoPlay' property is still available on the 'Contract' interface of the Video control to track whether the current instance of the control supports autoplay or not based on the video URL that is provided.

3657227Fix ComponentGovernance warnings for msportalfx-ut update all deps incl gulp/karma.

3331130Obsolete MsPortalFx.ViewModels.Forms.TriStateCheckBox ​


Expected Errors:

The MsPortalFx.ViewModels.Forms.TriStateCheckBox.ViewModel class has been deprecated and will be removed from the runtime once all extensions have stopped referencing it.

Solution:

Replace references to this class to references to the new AMD module
ie:
```
const myCheckBox = new MsPortalFx.ViewModels.Forms.TriStateCheckBox.ViewModel(lifetime, options)
```
becomes
```
import * as TriStateCheckbox from "Fx/Controls/TriStateCheckBox";
...
const myCheckBox = TriStateCheckbox.create(lifetime, options);
```
Reason For Breaking Change

MsPortalFx viewmodels are loaded at startup for every extension regardless of if they are used.  By moving to AMD versions of viewmodels, less code is downloaded to the client and startup performance increases.

3331128Obsolete MsPortalFx.ViewModels.Forms.TokenComboBox ​


Expected Errors:

The MsPortalFx.ViewModels.Forms.TriStateCheckBox.ViewModel class has been deprecated and will be removed from the runtime once all extensions have stopped referencing it.

Solution:

Replace references to this class to references to the new AMD module
ie:
```
const myTokenComboBox= new MsPortalFx.ViewModels.Forms.TokenComboBox.ViewModel(lifetime, options)
```
becomes
```
import * as PillCollection from "Fx/Controls/PillCollection";
...
const myTokenComboBox = PillCollection.create(lifetime, options);
```
Reason For Breaking Change

MsPortalFx viewmodels are loaded at startup for every extension regardless of if they are used.  By moving to AMD versions of viewmodels, less code is downloaded to the client and startup performance increases.

Also, the token combo box has 0 usage and is not accessible, so removing it seems like an all around win.

5.0.302.15601

3811511Remove jQuery promises


Expected Errors:

N/A

Solution:
In MsPortalFx.ViewModels.Controls.Visualization.Graph.Contract 

Old API: 
addEdge(edgeToAdd: IGraphEdgeForAddition): JQueryPromise;
deleteEntities(nodesToDelete: IGraphNodeForDeletion[], edgesToDelete: IGraphEdgeForDeletion[]): JQueryPromise;

New API:
addEdge(edgeToAdd: IGraphEdgeForAddition): Q.Promise;
deleteEntities(nodesToDelete: IGraphNodeForDeletion[], edgesToDelete: IGraphEdgeForDeletion[]): Q.Promise;

Reason For Breaking Change
- Cleaning up JQueryPromise usage and migrate to native promise/Q promise for performance and code maintenance.

5.0.302.15301

3800421Fix errors in video control due to multiple instances

'canAutoplay' property is not available on the 'Options' interface of the Video control anymore. This property had no affect on the widget and the extension simply needed to set/unset the 'autoplay' property. The 'canAutoPlay' property is still available on the 'Contract' interface of the Video control to track whether the current instance of the control supports autoplay or not based on the video URL that is provided.

3657227Fix ComponentGovernance warnings for msportalfx-ut update all deps incl gulp/karma.

5.0.302.14701

3781217Deprecate embedded content support in SDK

No description available for this breaking change.

5.0.302.14601

3800421Fix errors in video control due to multiple instances

'canAutoplay' property is not available on the 'Options' interface of the Video control anymore. This property had no affect on the widget and the extension simply needed to set/unset the 'autoplay' property. The 'canAutoPlay' property is still available on the 'Contract' interface of the Video control to track whether the current instance of the control supports autoplay or not based on the video URL that is provided.

5.0.302.12801

3657227Fix ComponentGovernance warnings for msportalfx-ut update all deps incl gulp/karma.


Expected Errors:​
- possible "Unsupported gulp version" if you have a gulpfile you have authored in your ut fx​
- missing node dependencies if you have packaged node_modules into nuget for corext.​
Solution:​
- update your Extension.UnitTest/package.json to use the following dependencies​
BEFORE:​
    "@types/chai": "4.1.2",​
    "@types/mocha": "2.2.48",​​
    "@types/nconf": "0.0.37",​​
    "@types/sinon": "4.3.0",​​
    "chai": "4.1.2",​​
    "gulp": "3.9.1",​​
    "gulp-concat": "2.6.1",​​
    "karma": "2.0.0",​​
    "karma-chai": "0.1.0",​​
    "karma-chrome-launcher": "2.2.0",​​
    "karma-coverage": "1.1.1",​​
    "karma-edge-launcher": "0.4.2",​​
    "karma-mocha": "1.3.0",​​
    "karma-mocha-reporter": "2.2.5",​​
    "karma-junit-reporter": "1.2.0",​​
    "karma-requirejs": "1.1.0",​​
    "karma-trx-reporter": "0.2.9",​​
    "mocha": "5.0.4",​​
    "nconf": "0.10.0",​​
    "requirejs": "2.3.5",​​
    "sinon": "4.4.3",​​
    "typescript": "3.2.1"​
AFTER:​
   "@types/chai": "4.1.7",​
    "@types/mocha": "5.2.5",​​
    "@types/nconf": "0.10.0",​​
    "@types/sinon": "7.0.5",​​
    "chai": "4.2.0",​​
    "gulp": "4.0.0",​​
    "gulp-concat": "2.6.1",​​
    "karma": "4.0.0",​​
    "karma-chai": "0.1.0",​​
    "karma-chrome-launcher": "2.2.0",​​
    "karma-coverage": "1.1.2",​​
    "karma-edge-launcher": "0.4.2",​​
    "karma-mocha": "1.3.0",​​
    "karma-mocha-reporter": "2.2.5",​​
    "karma-junit-reporter": "1.2.0",​​
    "karma-requirejs": "1.1.0",​​
    "karma-trx-reporter": "0.4.0",​​
    "mocha": "5.2.0",​​
    "nconf": "0.10.0",​​
    "requirejs": "2.3.6",​​
    "sinon": "7.2.3",​​
    "typescript": "3.2.1"​
if you have custom gulp tasks you have authored you will need to update them to use the latest gulp 4.0 syntax.​
Reason For Breaking Change​
- update for CG2.0 compliance​
- migrate to gulp 4 as node 10.14.2 with gulp < 4 throws internalbinding error.​
- node_modules/@types/node/index.d.ts(161,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'require' must be of type 'LocalRequire', but here has type 'NodeRequire'.​

5.0.302.12301

3623656[Breaking] Remove Microsoft.Portal.Tools.obsolete.targets

Expected Errors 
- `The imported project "Microsoft.Portal.Tools.5.0.0.XXXX\build\Microsoft.Portal.Tools.obsolete.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.  AzurePortalExtension\AzurePortalExtension49.csproj`
- `This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\..\packages\Microsoft.Portal.Tools.5.302.0.XXXX \build\Microsoft.Portal.Tools.obsolete.targets. AzurePortalExtension.csproj`
- A runtime error `Refused to execute script from '<URL>' because its MIME type ('text/html') is not executable + _generated/Manifest.js not found`

Solution
`Microsoft.Portal.Tools.obsolete.targets` no longer exists. You will need to upgrade to the V2 targets. Instructions can be found here: https://github.com/Azure/portaldocs/blob/dev/portal-sdk/templates/portalfx-performance.md#v2-targets

Reason for Breaking Change
The V1 targets has been obsoleted for many months already. The portal and the majority of partner teams are already on the V2 targets. The V2 targets has an improved compilation experience and is a requirement for most of the performance work in the portal.

3591866Set ExtensionPageVersion MSBuild property for internal extensions

No description available for this breaking change.

3590627Remove legacy bundle infrastructure

Expected Errors 
You will get C# compilation errrors indicating that ContentBundleDefinition type cannot be found.

Solution
The ContentBundleDefinition type has been deprecated. You will need to remove all usages from your code. Most of the time, they are used to setup bundles that are to be loaded via PreInitialize and PreManifest. Those patterns are called "shims" and are known to have performance issues.

Reason for Breaking Change
Patterns that are known to cause performance issues are getting deprecated.

3511046remove frameworkCapabilities config its unused as of commit cae59f25


Expected Errors:

- Build error if overriding FrameworkCapabilities property in class deriving from ExtensionDefinition.
- Client build error if using internal FxImpl.hasCapability.

Solution:

- Delete the override of the FrameworkCapabilities property in your class that extends ExtensionDefinition.
- Do not use internal FxImpl.hasCapability api.

Reason For Breaking Change:

- Internal api FxImpl.hasCapability usage was removed in commit cae59f25 early in 2018.  This change removes unused client implementation of FxImpl.hasCapability and also removes property FrameworkCapabilities from ExtensionDefinition base class as its value no longer used.

3511026remove traceAjaxErrors config and always log errors


Expected Errors:

- error CS0115: 'ExtensionDefinition.TraceAjaxErrors': no suitable method found to override.
Base.Net.Internal.AjaxCaller.initialize(...) argument mismatch. traceAjaxErrors argument is removed.

Solution:

- Delete the override of the TraceAjaxErrors property in your class that extends ExtensionDefinition.
- Internal APIs should not be used. drop the traceAjaxErrors argument on call to Base.Net.Internal.AjaxCaller.initialize()

Reason For Breaking Change:

- Ajax errors should always be logged, analyzed and resolved where possible, rather then ignored.

3331117Obsolete MsPortalFx.ViewModels.Controls.SingleSetting

The MsPortalFx.ViewModels.Controls.SingleSetting namespace is being retired.  This control was not widely used, nor did it provide any significant value.  You can create the same UX via custom html easily enough.

old code:
var settingVm= new MsPortalFx.ViewModels.Controls.SingleSetting.ViewModel(lifetime, options);

new code:
import * as CustomHtml from "Fx/Controls/CustomHtml";
...

var settingVm= CustomHtml.create(lifetime, options);

3331115Obsolete MsPortalFx.ViewModels.Controls.Settings

The MsPortalFx.ViewModels.Controls.Settings namespace is being retired.  This control was not widely used, nor did it provide any significant value.  You can create the same UX via custom html easily enough.

old code:
var settingsVm= new MsPortalFx.ViewModels.Controls.Settings.ViewModel(lifetime, options);

new code:
import * as CustomHtml from "Fx/Controls/CustomHtml";
...

var settingsVm= CustomHtml.create(lifetime, options);

3276047Require $(ExtensionPageVersion) when compiling PDL files

Expected Errors 
- `The Azure Portal SDK was unable
to determine the page version of your extension. Please set the 'ExtensionPageVersion' MSBuild property to a valid version. This value should be different on every official build.`

Solution
You will need to set up some MSBuild directives to populate the ExtensionPageVersion MSBuild property. If you are on CoreXT, you can try the following lines of code. Other build systems will need to use something similar.

  <Target Name="SetExtensionPageVersion"
          BeforeTargets="CompilePdl" >​
    <PropertyGroup>​
      <ExtensionPageVersion>$(BuildVersion).$([System.DateTime]::Now.ToString("yyMMdd-HHmm"))</ExtensionPageVersion>​
    </PropertyGroup>​
  </Target>








Reason for Breaking Change
As part of deprecating the ContentUnbundler, we can no longer depend on the associated .NET web project for the version. 

2970891[Dropdown] Item text is not typed to support HtmlContent



Expected Errors:

The item interface for the dropdown has been expanded to support `htmlContent`. This may result in a compile time breaking change if you have code which assumes the type of item as string.

Solution:
The fix is simply cast the particular code to `<string>` or check typeof item === "string"`. 

ie:
`const displayString = (typeof text === "string") ? text : text.htmlTemplate;`

Reason For Breaking Change
- Ensure that creating an html templated item is intentional and helps prevent accidental html injection by end users. 
- Standardize the type between many other parts of the portal.

2970591AMDify the toolbar control

In unifying the way we create toolbars, we moved the MoveResourceToolbarButton into the 'Fx/Controls/Toolbar' module.

Code before the change:
import * as MoveResourceToolBar from "Fx/Controls/MoveResourceToolbarButton";
...
var button = new MoveResourceToolBar .ViewModel(lifetime, options);

Code after the change:
import * as Toolbar from "Fx/Controls/Toolbar";
...
var button = Toolbar.ToolbarItems.createMoveResourceButton(lifetime, options);


In doing this cleanup, we also updated the control's implementation.  If you encounter selenium test failures, update your test framework to version ** or later.