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

@azure/core-xml fails to build with devDependency @types/trusted-types@2.0.3 #24872

Closed
mikeharder opened this issue Feb 15, 2023 · 1 comment
Closed
Assignees
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library.

Comments

@mikeharder
Copy link
Member

mikeharder commented Feb 15, 2023

@azure/core-xml builds fine with @types/trusted-types@2.0.2. However, with @types/trusted-types@2.0.3, it fails with the following error:

src/xml.browser.ts(22,18): error TS7006: Parameter 's' implicitly has an 'any' type.

let ttPolicy: Pick<TrustedTypePolicy, "createHTML"> | undefined;
if (typeof self.trustedTypes !== "undefined") {
ttPolicy = self.trustedTypes.createPolicy("@azure/core-xml#xml.browser", {
createHTML: (s) => s,
});
}

I believe the root cause is DefinitelyTyped/DefinitelyTyped#64360.

Do you think this is a breaking change in @types/trusted-types that should be reverted?

If not, I think we will need to:

  1. Update our devDependency from@types/trusted-types@^2.0.0 to @types/trusted-types@^2.0.3. Note that both @azure/core-xml and @azure/core-http have a dep on @types/trusted-types.
  2. Update our code to fix the compile error.
  3. Revert the workaround in #TBD.
@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Feb 15, 2023
mikeharder added a commit to mikeharder/azure-sdk-for-js that referenced this issue Feb 15, 2023
mikeharder added a commit that referenced this issue Feb 15, 2023
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Feb 15, 2023
@xirzec xirzec added Client This issue points to a problem in the data-plane of the library. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Feb 15, 2023
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Feb 15, 2023
mikeharder added a commit to mikeharder/azure-sdk-for-js that referenced this issue Feb 17, 2023
mikeharder added a commit to mikeharder/azure-sdk-for-js that referenced this issue Feb 17, 2023
@jeremymeng
Copy link
Member

We can add : any or keep the version pinned. It probably doesn't matter as we don't have any usage of createHTML in our code.

jeremymeng added a commit to jeremymeng/azure-sdk-for-js that referenced this issue May 9, 2023
jeremymeng added a commit that referenced this issue May 9, 2023
…allback (#25813)

### Packages impacted by this PR
`@azure/core-xml`, `@azure/core-http`

### Issues associated with this PR
Fixes issue #24872.

### Describe the problem that is addressed by this PR

Upgrading to @trusted-types v2.0.3 caused compilation error. While it is
breaking, it surfaces an issue that we can address by adding proper
parameter type.

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
Pinning to v2.0.2 which isn't desirable as we want to stay on latest
dependency versions.
minhanh-phan pushed a commit to minhanh-phan/azure-sdk-for-js that referenced this issue Jun 12, 2023
…allback (Azure#25813)

### Packages impacted by this PR
`@azure/core-xml`, `@azure/core-http`

### Issues associated with this PR
Fixes issue Azure#24872.

### Describe the problem that is addressed by this PR

Upgrading to @trusted-types v2.0.3 caused compilation error. While it is
breaking, it surfaces an issue that we can address by adding proper
parameter type.

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
Pinning to v2.0.2 which isn't desirable as we want to stay on latest
dependency versions.
@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library.
Projects
None yet
Development

No branches or pull requests

3 participants