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

[core-util] depend on @typespec/ts-http-runtime #32700

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

timovv
Copy link
Member

@timovv timovv commented Jan 24, 2025

Packages impacted by this PR

  • @azure/core-util
  • @typespec/ts-http-runtime

Issues associated with this PR

Describe the problem that is addressed by this PR

Opening this PR to get initial feedback on the approach, not looking to get it merged immediately. Let me know your thoughts.

This is a proof of concept of how we might deduplicate the Azure and unbranded package without changing the Azure API surface in any meaningful way. This is done by exporting the necessary internals from the unbranded package under a subpath export, __internal/<package-name>. The Azure package then wraps these internals and re-exports them. All the internals exported are prefixed with a double underscore to prevent a naming conflict when they are imported by the Azure package, and also to help make sure that none of the internal names show up in the public API of the Azure package.

Exporting under the __internal/<x> subpath keeps the main API surface of @typespec/ts-http-runtime clean and focused on the library's core purpose, which is to provide the necessary APIs for code generated from TypeSpec. This necessary surface is much smaller than what the combined Azure Core packages expose today.
 
I'm starting with core-util since it's one of the simpler packages to convert. This is because:

  • there are no differences between Azure and unbranded, and
  • it has no complex dependencies between Core packages (like for example core-client-rest has a dependency on core-rest-pipeline).

Other packages are a bit trickier but I've had some initial success with this approach even with these differences.

(more detailed description to come; let me know if any questions!)

@timovv timovv force-pushed the core/dedupe-core-util branch from 8d8cc44 to 78e9bf1 Compare January 24, 2025 01:35
@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

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

Successfully merging this pull request may close these issues.

2 participants