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

add symbols to main pkgs with singletons #7871

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

Conversation

aruniverse
Copy link
Member

@aruniverse aruniverse commented Mar 21, 2025

add symbols to the following pkgs to prevent multiple copies:

  • core-backend
  • presentation-frontend
  • presentation-backend

@aruniverse aruniverse marked this pull request as ready for review March 21, 2025 02:06
@aruniverse aruniverse requested review from a team as code owners March 21, 2025 02:06
Copy link
Member

@grigasp grigasp left a comment

Choose a reason for hiding this comment

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

Regarding the symbol check:

  • I think the addition is worth mentioning in the NextVersion.md.

  • Why is it added only to the three packages, but not, for example, @itwin/core-frontend?
    Edit: I see core-frontend has the check, but it's in ExtensionRuntime.ts for some reason. Why not in core-frontend.ts?

@@ -86,6 +85,10 @@ export * from "./ChangesetECAdaptor";

export * from "./internal/cross-package";

const globalSymbol = Symbol.for("itwin.core.backend.globals");
if ((globalThis as any)[globalSymbol])
throw new Error("Multiple @itwin/core-backend imports detected!");
Copy link
Member

Choose a reason for hiding this comment

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

Can you make these errors clearer so the developer understands what happened and how they can fix it?

Copy link
Member

@pmconne pmconne left a comment

Choose a reason for hiding this comment

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

Any chance you can split this into 2 PRs? The deprecated API removals seem completely unrelated to the symbols.

@aruniverse aruniverse changed the title add symbols to main pkgs with singletons & rm deprecated in 3.x apis add symbols to main pkgs with singletons Mar 21, 2025
@aruniverse
Copy link
Member Author

Any chance you can split this into 2 PRs? The deprecated API removals seem completely unrelated to the symbols.

#7875

Copy link
Contributor

mergify bot commented Mar 21, 2025

This pull request is now in conflicts. Could you fix it @aruniverse? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

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.

3 participants