-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
docs: added cheatsheet for best practices #2266
docs: added cheatsheet for best practices #2266
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Hey thanks a ton for doing this! Also just wanted to point out the "Or Habits...." and "Or Dehydrate...." sentences just under the main header were more internal notes I think? Can probably just leave those off. |
@KenAKAFrosty updated |
--- | ||
|
||
# No-Hydration Tips | ||
## Don't register events eagerly with `useClientEffect$()` |
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.
How about changing this to Don't register DOM events eagerly with
useClientEffect$()`? I was confused until I realized it was about DOM
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.
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.
|
||
|
||
## EXCEPTION | ||
When doing SSG for pure static files, this is a necessary evil. The server won't have current location information when the server generates the files at build time. |
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 this. useLocation()
gets the location of the page that is being SSR'ed, no? And then when it runs on the client it gets the actual file location? Doesn't it still work with SSG?
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.
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.
yeah, i dont understand this exception either, useLocation()
will also work in SSG, SSG is the same as SSR (just cached forever)
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 am not sure we should call this Anti-patterns, bit negative? how about |
@KenAKAFrosty @mhevery do we have a resolution for the comments here from @manucorporat nad @wmertens ? |
Please change it to |
* 0.14.1 * 🐤
clock.css is not correctly loaded which causes the clock to not show. Error: Cannot find module './clock.css?inline' or its corresponding type declarations.
When using onError in the IDE as provided in the example it gives the following error: Property 'onError' does not exist on type 'IntrinsicAttributes & ResourceProps<string[]>' The solution says it should be onRejected
Co-authored-by: Jeremy Wickersheimer <jwickers@gmail.com>
Co-authored-by: langbamit <langbamit@gmail.com>
fixes QwikDev#1955 fixes QwikDev#2329 fixes QwikDev#1062 fixes QwikDev#1413 fixes QwikDev#1446
Qwik array map in qwik vs. react did not have key even though in rendering portion of docs it says key is required
Co-Authored-By: Tran Thien Khiem <20198928+tuoitrevohoc@users.noreply.github.com>
To avoid running into unexpected `wasm-pack` failures when doing full build, adds note to Contributing docs about installation of `wasm-pack`, linking to site showing installation command for each platform.
@mhevery @manucorporat @KenAKAFrosty updated to Best Practices |
@manucorporat @KenAKAFrosty can we merge this PR or do we need to update more? cc: @mhevery |
What is it?
Description
Add Cheatsheet: Best Practices created by Misko
Use cases and why
Checklist: