-
Notifications
You must be signed in to change notification settings - Fork 219
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 seecore-frontend
has the check, but it's inExtensionRuntime.ts
for some reason. Why not incore-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!"); |
There was a problem hiding this comment.
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?
There was a problem hiding this 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.
|
This pull request is now in conflicts. Could you fix it @aruniverse? 🙏 |
add symbols to the following pkgs to prevent multiple copies: