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

Remove deprecated 3.x APIs in core-common #7572

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
274667f
Remove isManagedWithIModel
MichaelSwigerAtBentley Jan 16, 2025
2b29b19
Remove override methods
MichaelSwigerAtBentley Jan 16, 2025
80e67e0
Remove getLocalizedStringWithNamespace
MichaelSwigerAtBentley Jan 16, 2025
c0dc76a
Remove TerrainProviderName
MichaelSwigerAtBentley Jan 16, 2025
6e2f826
Remove deprecated props
MichaelSwigerAtBentley Jan 16, 2025
1a9a2c8
Remove BackendTypes
MichaelSwigerAtBentley Jan 16, 2025
7036308
Update NextVersion
MichaelSwigerAtBentley Jan 17, 2025
582f844
Update NextVersion
MichaelSwigerAtBentley Jan 17, 2025
76974ed
BackgroundMapSettings Removal
MichaelSwigerAtBentley Jan 17, 2025
3123e2d
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into m…
MichaelSwigerAtBentley Jan 17, 2025
15c7a2a
Remove RenderMaterial.Params
MichaelSwigerAtBentley Jan 17, 2025
8af7cde
Remove RenderTexture.Params
MichaelSwigerAtBentley Jan 17, 2025
a5de240
Remove getViewThumbnail
MichaelSwigerAtBentley Jan 17, 2025
c812de2
Revert "BackgroundMapSettings Removal"
MichaelSwigerAtBentley Jan 17, 2025
c7846d9
Update Barrel File
MichaelSwigerAtBentley Jan 17, 2025
c18fbba
Update override tests
MichaelSwigerAtBentley Jan 17, 2025
6df6e5c
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into m…
MichaelSwigerAtBentley Jan 21, 2025
8c3ff42
Revert "Remove getViewThumbnail"
MichaelSwigerAtBentley Jan 21, 2025
89d1d50
Remove Deprecated Props from ViewStateHydrator
MichaelSwigerAtBentley Jan 21, 2025
3d1e450
Swap Backend for node:stream
MichaelSwigerAtBentley Jan 21, 2025
b689236
Revert "Remove BackendTypes"
MichaelSwigerAtBentley Jan 22, 2025
9dfb919
Swap out RenderTexture.Params
MichaelSwigerAtBentley Jan 22, 2025
f85395b
Revert "Swap Backend for node:stream"
MichaelSwigerAtBentley Jan 22, 2025
258dca9
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into m…
MichaelSwigerAtBentley Jan 27, 2025
f30c5a3
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into m…
MichaelSwigerAtBentley Jan 30, 2025
a383930
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into m…
MichaelSwigerAtBentley Jan 30, 2025
8a4ea71
Revert "Swap out RenderTexture.Params"
MichaelSwigerAtBentley Jan 30, 2025
3554ce4
Revert "Remove RenderTexture.Params"
MichaelSwigerAtBentley Jan 30, 2025
e28fff6
Revert "Remove RenderMaterial.Params"
MichaelSwigerAtBentley Jan 30, 2025
1abf021
Swap RenderMaterial Params to internal
MichaelSwigerAtBentley Jan 30, 2025
e7afce9
Swap RenderTexture Params to internal
MichaelSwigerAtBentley Jan 30, 2025
521bb73
Rush extract-api
MichaelSwigerAtBentley Jan 30, 2025
ed08069
Readd BackendTypes to barrel file
MichaelSwigerAtBentley Jan 30, 2025
5e04b24
Move internal tag
MichaelSwigerAtBentley Jan 31, 2025
2b762ee
Update NextVersion
MichaelSwigerAtBentley Jan 31, 2025
3434050
Swap backend types to internal
MichaelSwigerAtBentley Jan 31, 2025
43b5b7f
Rush extract-api
MichaelSwigerAtBentley Jan 31, 2025
1bcf102
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into m…
MichaelSwigerAtBentley Jan 31, 2025
e68d362
Update Extension index
MichaelSwigerAtBentley Jan 31, 2025
300e9af
Rush change
MichaelSwigerAtBentley Jan 31, 2025
04a4639
Rush extract-api
MichaelSwigerAtBentley Jan 31, 2025
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
26 changes: 4 additions & 22 deletions common/api/core-common.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,10 @@ export class BackendError extends IModelError {
constructor(errorNumber: number, name: string, message: string, getMetaData?: LoggingMetaData);
}

// @public @deprecated (undocumented)
// @internal @deprecated (undocumented)
export type BackendReadable = Readable;

// @public @deprecated (undocumented)
// @internal @deprecated (undocumented)
export type BackendWritable = Writable;

// @public
Expand Down Expand Up @@ -1290,9 +1290,6 @@ export class CodeSpec {
iModel: IModel;
// (undocumented)
get isExternal(): boolean;
// @deprecated
get isManagedWithIModel(): boolean;
set isManagedWithIModel(value: boolean);
get isValid(): boolean;
name: string;
// @internal
Expand Down Expand Up @@ -3344,12 +3341,6 @@ export class FeatureOverrides implements FeatureAppearanceSource {
readonly neverDrawnAnimationNodes: Set<number>;
override(args: OverrideFeatureAppearanceArgs): void;
overrideAnimationNode(id: number, app: FeatureAppearance): void;
// @deprecated
overrideElement(id: Id64String, app: FeatureAppearance, replaceExisting?: boolean): void;
// @deprecated
overrideModel(id: Id64String, app: FeatureAppearance, replaceExisting?: boolean): void;
// @deprecated
overrideSubCategory(id: Id64String, app: FeatureAppearance, replaceExisting?: boolean): void;
protected _patterns: boolean;
setAlwaysDrawn(id: Id64String): void;
setAlwaysDrawnSet(ids: Iterable<Id64String>, exclusive: boolean, ignoreSubCategory?: boolean): void;
Expand Down Expand Up @@ -4652,8 +4643,6 @@ export interface HydrateViewStateRequestProps {
acsId?: string;
// (undocumented)
baseModelId?: Id64String;
// @deprecated (undocumented)
notLoadedCategoryIds?: CompressedId64Set;
// (undocumented)
notLoadedModelSelectorStateModels?: CompressedId64Set;
// (undocumented)
Expand All @@ -4670,8 +4659,6 @@ export interface HydrateViewStateResponseProps {
acsElementProps?: ElementProps;
// (undocumented)
baseModelProps?: ModelProps;
// @deprecated (undocumented)
categoryIdsResult?: SubCategoryResultRow[];
// (undocumented)
modelSelectorStateModels?: ModelProps[];
// (undocumented)
Expand Down Expand Up @@ -5678,8 +5665,6 @@ export interface Localization {
getLanguageList(): readonly string[];
getLocalizedKeys(inputString: string): string;
getLocalizedString(key: string | string[], options?: TranslationOptions): string;
// @deprecated
getLocalizedStringWithNamespace(namespace: string, key: string | string[], options?: TranslationOptions): string;
// @internal (undocumented)
getNamespacePromise(name: string): Promise<void> | undefined;
initialize(namespaces: string[]): Promise<void>;
Expand Down Expand Up @@ -7664,7 +7649,7 @@ export abstract class RenderMaterial {

// @public (undocumented)
export namespace RenderMaterial {
// @deprecated (undocumented)
// @internal
export class Params {
constructor(key?: string);
get alpha(): number | undefined;
Expand Down Expand Up @@ -8093,7 +8078,7 @@ export abstract class RenderTexture implements Disposable {

// @public (undocumented)
export namespace RenderTexture {
// @deprecated
// @internal
export class Params {
constructor(key?: string, type?: RenderTexture.Type, isOwned?: boolean);
// (undocumented)
Expand Down Expand Up @@ -9635,9 +9620,6 @@ export interface TerrainProps {
providerName?: string;
}

// @public @deprecated
export type TerrainProviderName = string;

// @public
export class TerrainSettings {
// @deprecated
Expand Down
8 changes: 4 additions & 4 deletions common/api/summary/core-common.exports.csv
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ internal;class;B3dmHeader
internal;type;BackendBuffer
deprecated;type;BackendBuffer
public;class;BackendError
public;type;BackendReadable
internal;type;BackendReadable
deprecated;type;BackendReadable
public;type;BackendWritable
internal;type;BackendWritable
deprecated;type;BackendWritable
public;enum;BackgroundFill
public;interface;BackgroundMapProps
Expand Down Expand Up @@ -676,6 +676,7 @@ public;type;RemoveFunction
public;interface;RenderFeatureTable
public;class;RenderMaterial
public;namespace;RenderMaterial
internal;class;Params
public;interface;RenderMaterialAssetMapsProps
public;interface;RenderMaterialAssetProps
public;interface;RenderMaterialProps
Expand All @@ -684,6 +685,7 @@ public;namespace;RenderSchedule
internal;class;Interval
public;class;RenderTexture
public;namespace;RenderTexture
internal;class;Params
public;interface;RenderTimelineLoadProps
public;interface;RenderTimelineProps
public;interface;RepositoryLinkProps
Expand Down Expand Up @@ -829,8 +831,6 @@ beta;interface;SynchronizationConfigLinkProps
public;enum;SyncMode
public;enum;TerrainHeightOriginMode
public;interface;TerrainProps
public;type;TerrainProviderName
deprecated;type;TerrainProviderName
public;class;TerrainSettings
internal;class;TestRpcManager
beta;class;TextAnnotation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-backend",
"comment": "Remove 3.x Deprecated APIs",
"type": "none"
}
],
"packageName": "@itwin/core-backend"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-common",
"comment": "Remove 3.x Deprecated APIs",
"type": "none"
}
],
"packageName": "@itwin/core-common"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-extension",
"comment": "Remove 3.x Deprecated APIs",
"type": "none"
}
],
"packageName": "@itwin/core-extension"
}
15 changes: 1 addition & 14 deletions core/backend/src/ViewStateHydrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import { BentleyError, CompressedId64Set, Id64String, Logger } from "@itwin/core-bentley";
import { HydrateViewStateRequestProps, HydrateViewStateResponseProps, ModelProps, SubCategoryResultRow, ViewAttachmentProps, ViewStateLoadProps } from "@itwin/core-common";
import { HydrateViewStateRequestProps, HydrateViewStateResponseProps, ModelProps, ViewAttachmentProps, ViewStateLoadProps } from "@itwin/core-common";
import { BackendLoggerCategory } from "./BackendLoggerCategory";
import { IModelDb } from "./IModelDb";

Expand All @@ -21,11 +21,6 @@ export class ViewStateHydrator {
promises.push(this.handleAcsId(response, options.acsId));
if (options.sheetViewAttachmentIds)
promises.push(this.handleSheetViewAttachmentIds(response, options.sheetViewAttachmentIds, options.viewStateLoadProps));
// eslint-disable-next-line @typescript-eslint/no-deprecated
if (options.notLoadedCategoryIds) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
promises.push(this.handleCategoryIds(response, options.notLoadedCategoryIds));
}
if (options.spatialViewId)
promises.push(this.handleSpatialViewId(response, options.spatialViewId, options.viewStateLoadProps));
if (options.notLoadedModelSelectorStateModels)
Expand All @@ -36,14 +31,6 @@ export class ViewStateHydrator {
return response;
}

private async handleCategoryIds(response: HydrateViewStateResponseProps, categoryIds: CompressedId64Set) {
const decompressedIds = CompressedId64Set.decompressArray(categoryIds);
const results: SubCategoryResultRow[] = await this._imodel.querySubCategories(decompressedIds);

// eslint-disable-next-line @typescript-eslint/no-deprecated
response.categoryIdsResult = results;
}

private async handleBaseModelId(response: HydrateViewStateResponseProps, baseModelId: Id64String) {
let modelProps;
try {
Expand Down
4 changes: 2 additions & 2 deletions core/common/src/BackendTypes.ts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should move this file into core/common/src/internal

Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ Do not add any new types to this file.
All types here will be removed in 4.0
*/

/** @public @deprecated in 3.x. This type was mistakenly made public in the common scope. */
/** @internal @deprecated in 3.x. This type was mistakenly made public in the common scope. */
export type BackendReadable = Readable;
MichaelSwigerAtBentley marked this conversation as resolved.
Show resolved Hide resolved

/** @public @deprecated in 3.x. This type was mistakenly made public in the common scope. */
aruniverse marked this conversation as resolved.
Show resolved Hide resolved
/** @internal @deprecated in 3.x. This type was mistakenly made public in the common scope. */
export type BackendWritable = Writable;

/** @internal @deprecated in 3.x. This type was mistakenly made public in the common scope. */
Expand Down
13 changes: 0 additions & 13 deletions core/common/src/Code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,17 +333,4 @@ export class CodeSpec {
else
this.properties.scopeSpec.fGuidRequired = undefined;
}

/** Will be true if the codes associated with this CodeSpec are managed along with the iModel and false if the codes are managed by an external service.
* @deprecated in 3.6 Use scopeReq instead.
*/
public get isManagedWithIModel(): boolean {
return this.properties.spec?.isManagedWithDgnDb ?? true;
}
public set isManagedWithIModel(value: boolean) {
if (!this.properties.spec)
this.properties.spec = {};

this.properties.spec.isManagedWithDgnDb = value;
}
}
36 changes: 0 additions & 36 deletions core/common/src/FeatureSymbology.ts
Original file line number Diff line number Diff line change
Expand Up @@ -817,42 +817,6 @@ export class FeatureOverrides implements FeatureAppearanceSource {
map.set(idLo, idHi, app);
}

/** Specify overrides for all elements within the specified model.
* @param id The Id of the model.
* @param app The symbology overrides.
* @param replaceExisting Specifies whether to replace a pre-existing override for the same model.
* @note These overrides take priority over all other overrides.
* @note If [[defaultOverrides]] are defined, they will not apply to any element within this model, even if the supplied appearance overrides nothing.
* @deprecated in 3.x. Use [[FeatureOverrides.override]].
*/
public overrideModel(id: Id64String, app: FeatureAppearance, replaceExisting: boolean = true): void {
this.override({ modelId: id, appearance: app, onConflict: replaceExisting ? "replace" : "skip" });
}

/** Specify overrides for all geometry belonging to the specified [SubCategory]($backend).
* @param id The Id of the subcategory.
* @param app The symbology overrides.
* @param replaceExisting Specifies whether to replace a pre-existing override for the same subcategory.
* @note These overrides have lower priority than element and model overrides.
* @note If [[defaultOverrides]] are defined, they will not apply to any geometry within this subcategory, even if the supplied appearance overrides nothing.
* @deprecated in 3.x. Use [[FeatureOverrides.override]].
*/
public overrideSubCategory(id: Id64String, app: FeatureAppearance, replaceExisting: boolean = true): void {
this.override({ subCategoryId: id, appearance: app, onConflict: replaceExisting ? "replace" : "skip" });
}

/** Specify overrides for all geometry originating from the specified element.
* @param id The Id of the element.
* @param app The symbology overrides.
* @param replaceExisting Specifies whether to replace a pre-existing override for the same element.
* @note These overrides take precedence over subcategory overrides, but not over model overrides.
* @note If [[defaultOverrides]] are defined, they will not apply to this element, even if the supplied appearance overrides nothing.
* @deprecated in 3.x. Use [[FeatureOverrides.override]].
*/
public overrideElement(id: Id64String, app: FeatureAppearance, replaceExisting: boolean = true): void {
this.override({ elementId: id, appearance: app, onConflict: replaceExisting ? "replace" : "skip" });
}

/** Specify overrides for all geometry originating from the specified animation node.
* @param id The Id of the animation node.
* @param app The symbology overrides.
Expand Down
9 changes: 0 additions & 9 deletions core/common/src/Localization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,6 @@ export interface Localization {
* @throws Error if no keys resolve to a string.
*/
getLocalizedString(key: string | string[], options?: TranslationOptions): string;
/** Similar to `getLocalizedString` but the namespace is a separate param and the key does not include the namespace.
* @param namespace - the namespace that identifies the particular localization file that contains the property.
* @param key - the key that matches a property in the JSON localization file.
* @returns The string corresponding to the first key that resolves.
* @throws Error if no keys resolve to a string.
* @deprecated in 3.x. Use `getLocalizedString` instead; providing either a key with a namespace `<namespace>:<key>` or
* including `{ ns: <namespace> }` in the options.
*/
getLocalizedStringWithNamespace(namespace: string, key: string | string[], options?: TranslationOptions): string;
/** get the English string for a key. */
getEnglishString(namespace: string, key: string | string[], options?: TranslationOptions): string;
/** Replace all instances of `%{key}` within a string with the translations of those keys.
Expand Down
9 changes: 4 additions & 5 deletions core/common/src/RenderMaterial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export namespace RenderMaterial {
return Math.max(0.0, Math.min(1.0, value));
}

/** @deprecated in 3.x. Use [CreateRenderMaterialArgs]($frontend). */
/** Params for use in old CreateMaterial functions. Use [CreateRenderMaterialArgs]($frontend) instead.
* @internal
*/
export class Params {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These params are also still in use, I'm going to try swapping them out for CreateRenderMaterialArgs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RenderTexture.Params is being using in multiple places in core\frontend

I was able to change one of the files, ParseImdlDoucment.ts, but I'm not sure if its implemented correctly as there is some logic around parsing colors.

@aruniverse @ben-polinsky Who would be best to talk to for more info on how to proceed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pmconne will be your best starting point

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like some of the core-frontend usage is being cleaned up in #7591.

Bear in mind that removing deprecated APIs just means making them unavailable to consumers of the public API. While generally we'll want to delete the APIs entirely, if it's too complicated to clean up our internal usage of a particular one, we can instead move it to /src/internal, and export it from cross-package.ts if it's used in other packages within itwinjs-core.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grep for RenderMaterial. in the repo. you'll see RenderMaterial.Params is still used in few places

the namespace here looks useless now that the only thing exposed is marked internal, wonder if we deprecate the namespace or just mark it as internal too, or honestly remove it entirely and move the Params class into core/common/src/internal

/** If the material originates from a Material element in the [[IModel]], the Id of that element. */
public key?: string;
Expand Down Expand Up @@ -75,7 +77,6 @@ export namespace RenderMaterial {
public constructor(key?: string) { this.key = key; }

/** Obtain an immutable instance of a RenderMaterial with all default properties. */
// eslint-disable-next-line @typescript-eslint/no-deprecated
public static readonly defaults = new Params();

/** A value from 0.0 (fully-transparent) to 1.0 (fully-opaque) controlling the transparency of surfaces to which this material is applied;
Expand All @@ -87,9 +88,7 @@ export namespace RenderMaterial {
}

/** Create a RenderMaterial params object using specified key and ColorDef values, as well as an optional texture mapping. */
// eslint-disable-next-line @typescript-eslint/no-deprecated
public static fromColors(key?: string, diffuseColor?: ColorDef, specularColor?: ColorDef, emissiveColor?: ColorDef, reflectColor?: ColorDef, textureMap?: TextureMapping): Params {
// eslint-disable-next-line @typescript-eslint/no-deprecated
const materialParams = new Params();
materialParams.key = key;
materialParams.diffuseColor = diffuseColor;
Expand All @@ -102,5 +101,5 @@ export namespace RenderMaterial {
}
}

// eslint-disable-next-line @typescript-eslint/no-deprecated

Object.freeze(RenderMaterial.Params.defaults);
4 changes: 2 additions & 2 deletions core/common/src/RenderTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export namespace RenderTexture {
}

/** Parameters used to construct a [[RenderTexture]].
* @deprecated in 3.x. use RenderSystem.createTexture and CreateTextureArgs.
* @public
* Use RenderSystem.createTexture and CreateTextureArgs.
* @internal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comments here as in RenderMaterial.ts

*/
export class Params {
/** A string uniquely identifying this texture within the context of an [[IModel]]. Typically this is the element Id of the corresponding [Texture]($backend) element.
Expand Down
8 changes: 0 additions & 8 deletions core/common/src/TerrainSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@

import { BackgroundMapProps } from "./BackgroundMapSettings";

/** Identifies a [TerrainProvider]($frontend).
* @see [[TerrainSettings.providerName]] and [[TerrainProps.providerName]].
* @public
* @extensions
* @deprecated in 3.x. Use string instead.
*/
export type TerrainProviderName = string;

/** Ids of [Cesium ION assets](https://cesium.com/platform/cesium-ion/content/) providing global terrain data.
* These values are appropriate to use with [[TerrainSettings.dataSource]] when [[TerrainSettings.providerName]] is set to "CesiumWorldTerrain".
* You may alternatively use the Id of any ION asset to which you have access.
Expand Down
4 changes: 0 additions & 4 deletions core/common/src/ViewProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ export interface SubCategoryResultRow {
export interface HydrateViewStateRequestProps {
acsId?: string;
notLoadedModelSelectorStateModels?: CompressedId64Set;
/** @deprecated in 3.x. If loading categoryIds is necessary, see [IModelConnection.SubCategoriesCache.load]($frontend)*/
notLoadedCategoryIds?: CompressedId64Set;
sheetViewAttachmentIds?: CompressedId64Set;
viewStateLoadProps?: ViewStateLoadProps;
baseModelId?: Id64String;
Expand All @@ -90,8 +88,6 @@ export interface HydrateViewStateResponseProps {
sheetViewViews?: (ViewStateProps | undefined)[];
baseModelProps?: ModelProps;
spatialViewProps?: ViewStateProps;
/** @deprecated in 3.x. If loading categoryIds is necessary, see [IModelConnection.SubCategoriesCache.load]($frontend)*/
categoryIdsResult?: SubCategoryResultRow[];
}

/** Returned from [IModelDb.Views.getViewStateData]($backend).
Expand Down
Loading