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

Fix use types #1129

Merged
merged 3 commits into from
May 3, 2024
Merged

Fix use types #1129

merged 3 commits into from
May 3, 2024

Conversation

NullVoxPopuli
Copy link
Owner

Fix #1128

Issues:

  • CURRENT symbol was exposed, and caused interface matching to fail -- it has been cast to a non-symbol via the same lies @runspired is using in ember-data 😅

Unresolved:

  • need to better declare the differences in the use apis

Copy link

stackblitz bot commented May 3, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

vercel bot commented May 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ember-resources-0a9q ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2024 8:17pm

Copy link
Contributor

github-actions bot commented May 3, 2024

Estimated impact to a consuming app, depending on which bundle is imported

js min min + gzip min + brotli
/index.js 14.06 kB 2.23 kB 971 B 807 B

@NullVoxPopuli
Copy link
Owner Author

@MichalBryxi, would you like to review?

@@ -10,7 +10,7 @@ export interface InternalFunctionResourceConfig<Value = unknown> {
[INTERNAL]: true;
}

export const CURRENT = Symbol('ember-resources::CURRENT');
export const CURRENT = Symbol('ember-resources::CURRENT') as unknown as 'CURRENT';
Copy link
Owner Author

Choose a reason for hiding this comment

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

this is the fix: typescript has been annoying with symbols and inferred types lately. :(

@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review May 3, 2024 19:20
@NullVoxPopuli NullVoxPopuli added the bug Something isn't working label May 3, 2024
@MichalBryxi
Copy link
Sponsor Contributor

Question: The test checks that Ember code works. But does that also prove that TS won't report problems? My example code compiled just fine. I was only getting squiggly line under respective TS code.

Is that guaranteed because the TS checks on the testing source code would fail?

@NullVoxPopuli
Copy link
Owner Author

NullVoxPopuli commented May 3, 2024

But does that also prove that TS won't report problems?

yeah, from all of
image

image

image

@NullVoxPopuli NullVoxPopuli merged commit 1efc411 into main May 3, 2024
26 checks passed
@NullVoxPopuli NullVoxPopuli deleted the issue-1128 branch May 3, 2024 20:29
@github-actions github-actions bot mentioned this pull request May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incompatible types on yielded block
2 participants