Skip to content

support nesting typekits#7108

Merged
timotheeguerin merged 4 commits intomicrosoft:mainfrom
chrisradek:tk-nested-ns
Apr 24, 2025
Merged

support nesting typekits#7108
timotheeguerin merged 4 commits intomicrosoft:mainfrom
chrisradek:tk-nested-ns

Conversation

@chrisradek
Copy link
Copy Markdown
Member

Fixes #7094

The caveat to this change is that you shouldn't have typekits that use regular fields.

For example - $.foo.type <-- if this is a regular field that contains an object, then that object will be wrapped in a Proxy, breaking object identity.

However, we follow the pattern of using get descriptors for this use-case instead, which would not break object identity.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 23, 2025

All changed packages have been documented.

  • @typespec/compiler
Show changes

@typespec/compiler - feature ✏️

Adds support for nesting typekits

@azure-sdk
Copy link
Copy Markdown
Collaborator

azure-sdk commented Apr 23, 2025

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@bterlson
Copy link
Copy Markdown
Member

Does this proxy wrap $.program/$.realm? Want to ensure we don't infect those values.

@chrisradek
Copy link
Copy Markdown
Member Author

Does this proxy wrap .program/.realm? Want to ensure we don't infect those values.

It doesn't - those values are returned if accessed prior to the wrapping logic.

I added an assertion to the test case to make sure $.program === program

@timotheeguerin timotheeguerin added this pull request to the merge queue Apr 24, 2025
Merged via the queue into microsoft:main with commit f7f7004 Apr 24, 2025
22 checks passed
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.

[Bug]: typekit with nested namespace could not use this

4 participants