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

Deprecate UseJsPropertyNames and ECSqlStatement (which defaults to UseJsPropertyNames) #7315

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

ColinKerr
Copy link
Member

No description provided.

@aruniverse
Copy link
Member

@Mergifyio backport release/4.10.x

Copy link
Contributor

mergify bot commented Nov 5, 2024

backport release/4.10.x

🟠 Waiting for conditions to match

  • merged [📌 backport requirement]

Copy link
Member

@aruniverse aruniverse left a comment

Choose a reason for hiding this comment

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

lets include a comment about this in NextVersion.md.
That can be done in the bp pr to release/4.10.x branch

@aruniverse
Copy link
Member

https://github.com/Mergifyio backport release/4.11.x

Copy link
Contributor

mergify bot commented Jan 29, 2025

backport release/4.11.x

🟠 Waiting for conditions to match

  • merged [📌 backport requirement]

@aruniverse
Copy link
Member

lets include a comment about this in NextVersion.md. That can be done in the bp pr to release/4.10.x branch

doc changes can go into release/4.11.x branch

@khanaffan khanaffan marked this pull request as ready for review February 4, 2025 19:15
@ColinKerr
Copy link
Member Author

I cannot approve because I created the PR, but it's looking good to me.

The only thing I can see missing is a note in next version md covering changes

Copy link
Member

@aruniverse aruniverse left a comment

Choose a reason for hiding this comment

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

does it make sense for the example code snippets that get pulled into the docs site use the new api instead of suppressing the deprecation warnings?

core/common/src/ConcurrentQuery.ts Outdated Show resolved Hide resolved
core/common/src/ConcurrentQuery.ts Outdated Show resolved Hide resolved
core/common/src/ConcurrentQuery.ts Outdated Show resolved Hide resolved
core/backend/src/IModelDb.ts Outdated Show resolved Hide resolved
core/backend/src/IModelDb.ts Outdated Show resolved Hide resolved
core/backend/src/ECSqlStatement.ts Outdated Show resolved Hide resolved
core/backend/src/ECSqlStatement.ts Outdated Show resolved Hide resolved
core/backend/src/ECDb.ts Outdated Show resolved Hide resolved
core/backend/src/ECDb.ts Outdated Show resolved Hide resolved
core/backend/src/ECDb.ts Outdated Show resolved Hide resolved
ColinKerr and others added 3 commits February 5, 2025 08:31
Update deprecated in version to 4.11

Co-authored-by: Arun George <[email protected]>
@aruniverse
Copy link
Member

I cannot approve because I created the PR, but it's looking good to me.

The only thing I can see missing is a note in next version md covering changes

@rschili would you be able to review since @ColinKerr and @khanaffan both worked on the pr?
Although @khanaffan should be able to provide an approval since he didnt create the pr

stmt.bindString(1, changeSetId);
if (DbResult.BE_SQLITE_ROW === stmt.step())
return stmt.getValue(0).getId();
// eslint-disable-next-line @typescript-eslint/no-deprecated
Copy link
Member

Choose a reason for hiding this comment

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

Why ignore deprecation warnings instead of updating to use preferred replacement APIs? (Here and lots of other places).

Copy link
Member

Choose a reason for hiding this comment

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

I have the same concerns, but the blast radius here is quite a lot, so I'm ok if we are temporarily suppressing the deprecation warnings internally. But I would hope and require we use the new api in our documentation with this pr, and have examples (in example-code snippets)

Copy link
Contributor

Choose a reason for hiding this comment

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

As I understand, we do not offer a sync replacement for the deprecated API, so to switch to ConcurrentQuery in a clean way we may have to make the caller methods async as well. Which would increase the blast radius even more.

Copy link
Member

@pmconne pmconne Feb 6, 2025

Choose a reason for hiding this comment

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

Is there some reason to believe the people consuming the deprecated APIs will not experience similar friction in attempting to address the new deprecation warnings in their own code? It sounds like our replacement APIs are insufficient, which suggests deprecation may be premature.

@khanaffan khanaffan requested a review from a team as a code owner February 5, 2025 17:32
@khanaffan
Copy link
Contributor

I cannot approve because I created the PR, but it's looking good to me.
The only thing I can see missing is a note in next version md covering changes

@rschili would you be able to review since @ColinKerr and @khanaffan both worked on the pr? Although @khanaffan should be able to provide an approval since he didnt create the pr

I have updated the nextversion.md

@aruniverse
Copy link
Member

I cannot approve because I created the PR, but it's looking good to me.
The only thing I can see missing is a note in next version md covering changes

@rschili would you be able to review since @ColinKerr and @khanaffan both worked on the pr? Although @khanaffan should be able to provide an approval since he didnt create the pr

I have updated the nextversion.md

this should go in the bp to 4.11 not on master

@khanaffan
Copy link
Contributor

khanaffan commented Feb 5, 2025

I cannot approve because I created the PR, but it's looking good to me.
The only thing I can see missing is a note in next version md covering changes

@rschili would you be able to review since @ColinKerr and @khanaffan both worked on the pr? Although @khanaffan should be able to provide an approval since he didnt create the pr

I have updated the nextversion.md

this should go in the bp to 4.11 not on master

All changes should be committed to the master branch first, as it serves as our source of truth. Deprecating a feature in version 4.x implies it is also deprecated in version 5.x. Currently, we do not have a timeline for updating the code in iTwin.js 5.x to transition from ECSQL statements to ECSQLReader."

@aruniverse
Copy link
Member

I cannot approve because I created the PR, but it's looking good to me.
The only thing I can see missing is a note in next version md covering changes

@rschili would you be able to review since @ColinKerr and @khanaffan both worked on the pr? Although @khanaffan should be able to provide an approval since he didnt create the pr

I have updated the nextversion.md

this should go in the bp to 4.11 not on master

All changes should be committed to the master branch first, as it serves as our source of truth. Deprecating a feature in version 4.x implies it is also deprecated in version 5.x.

Agreed, however the NextVersion.md file is a special file we use to generate the master changelog for a a major or minor release. The way now, the deprecation changes will be in the 5.0.0.md file where it should instead be in the 4.11.0.md files. See previous version change logs here https://github.com/iTwin/itwinjs-core/tree/master/docs/changehistory

@rschili
Copy link
Contributor

rschili commented Feb 5, 2025

I cannot approve because I created the PR, but it's looking good to me.
The only thing I can see missing is a note in next version md covering changes

@rschili would you be able to review

Will do first thing tomorrow.

@grigasp
Copy link
Member

grigasp commented Feb 6, 2025

I updated Presentation code to use recommended APIs instead of deprecated ones. @saskliutas please review.

Copy link
Contributor

@rschili rschili left a comment

Choose a reason for hiding this comment

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

Please review my concerns about caller methods who continue to use Statement. Is there a clean sync replacement for statement or do we have to make all callers async once we switch to ConcurrentQuery? If so, we should deprecate the remaining callers as well and provide async replacements...

@@ -1229,6 +1243,7 @@ export abstract class IModelDb extends IModel {
*/
public querySchemaVersion(schemaName: string): string | undefined {
const sql = `SELECT VersionMajor,VersionWrite,VersionMinor FROM ECDbMeta.ECSchemaDef WHERE Name=:schemaName LIMIT 1`;
// eslint-disable-next-line @typescript-eslint/no-deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we need to deprecate this method as well. We cannot rewrite it to async without breaking its signature. Once we remove statement this will have to become async

@@ -1613,6 +1628,7 @@ export namespace IModelDb {
*/
public queryLastModifiedTime(modelId: Id64String): string {
const sql = `SELECT LastMod FROM ${Model.classFullName} WHERE ECInstanceId=:modelId`;
// eslint-disable-next-line @typescript-eslint/no-deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

This method probably needs to be turned async/deprecated as well

Copy link
Contributor

Choose a reason for hiding this comment

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

There are more occurrences along the rest of the file

stmt.bindString(1, changeSetId);
if (DbResult.BE_SQLITE_ROW === stmt.step())
return stmt.getValue(0).getId();
// eslint-disable-next-line @typescript-eslint/no-deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

As I understand, we do not offer a sync replacement for the deprecated API, so to switch to ConcurrentQuery in a clean way we may have to make the caller methods async as well. Which would increase the blast radius even more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants