-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: fix a resource a type error when using async _resolved function #7426
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
Open
JerryWu1234
wants to merge
21
commits into
QwikDev:main
Choose a base branch
from
JerryWu1234:7086_fix_ts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+89
−31
Open
Changes from 10 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
a589e1b
fix: fix a resource a type error when using async _resolved function
e556923
Create tidy-snakes-flow.md
JerryWu1234 e1464a3
fix test
9451aad
fix test
c24f899
Merge branch 'main' into 7086_fix_ts
JerryWu1234 ed505f7
Delete .changeset/tidy-snakes-flow.md
JerryWu1234 f0effe5
fix
JerryWu1234 873a0db
add change
JerryWu1234 921b25a
refactor(qwik): optimize preloader and bundle graph handling
JerryWu1234 872fe37
add promise for pending
JerryWu1234 de8cc0f
refactor(resource): allow async callbacks for resource lifecycle hand…
JerryWu1234 6713c51
Merge branch 'main' into 7086_fix_ts
JerryWu1234 d9f55fc
fix test
JerryWu1234 ea13c6a
Merge branch '7086_fix_ts' of https://github.com/JerryWu1234/qwik int…
JerryWu1234 408103c
fix test
JerryWu1234 9decca4
fix test
JerryWu1234 8b719f9
fix test
JerryWu1234 a09158a
fix test
JerryWu1234 2b096b4
fix test
JerryWu1234 f4ed0ae
delete only
JerryWu1234 60bcdc8
Merge branch 'main' into 7086_fix_ts
gioboa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@builder.io/qwik-city': patch | ||
'@builder.io/qwik': patch | ||
--- | ||
|
||
follow version 2 to fix this ts error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't understand why this is needed. The resource holds a Promise, but the Resource component should just render without a Promise
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.
From what I know, it is correct for JavaScript, but it is not correct for TypeScript.
TypeScript will think that the function returns a Promise when async is added before the function.
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.
@wmertens
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.
you shouldn't add async before the function then
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.
aaah ok now I get it, it's when the dev puts an async in the resource functions, ok. Hmm not sure if that's a good idea though - the render functions are just like inline components and we don't really support async inline components either. It works though :)
@Varixo thoughts?