-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[WIP] Upgraded to Preact 10.3.4 #5639
Conversation
@@ -1,4 +1,3 @@ | |||
import 'preact/devtools'; |
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've removed preact/devtools
as it no longer exists. preact/debug
is what should be used, but it should only be for development purposes. I will address this in another PR.
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.
Thanks for catching this!
@@ -1,9 +1,9 @@ | |||
import { h, render } from 'preact'; | |||
import { Search } from '../src/components/Search'; | |||
import 'focus-visible' | |||
import 'focus-visible'; |
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.
A little prettier action happening in a few files.
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
const root = document.getElementById('nav-search-form-root'); | ||
|
||
render(<Search />, root, root.firstElementChild); | ||
render(<Search />, root); |
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.
This is part of the upgrade. VDOM diffing works the way it does in most other libraries, e.g. React.
The other issue is related to jest issues as test scores have gone from A -> F 😬 |
Tiny update. It looks like there are issues with |
2a6deaf
to
516f504
Compare
I spoke briefly with Jason Miller from Preact, and he is going to look into getting preact-render-spy etc. fixed up. So for the time being, I will put this PR on hold. |
This reverts commit 516f504.
822921e
to
a28fe97
Compare
@nickytonline Seems like https://github.com/mzgoddard/preact-render-spy might be abandoned: there's a Preact X fork up at https://github.com/shelacek/preact-render-spy. What do we use |
@joshpuetz, I tried the fork of preact-render-spy and it does not work. We use preact-render-spy for snapshot testing. It does appear to be abandoned although Jason Miller talked about fixing it up. See this Tweet thread between Jason and I. Also, I'm looking to move away from snapshot testing in favour of preact-testing-library. Even enzyme is not considered to be the way to test React components now (so Preact as well). As I mentioned on Slack, react-testing-library is the recommended tool by the React team, so I would be inclined to move towards preact-testing-library. The way I see it panning out is migrating to another testing tool and once all tests are migrated, we can upgrade. |
Closing this @Ridhwana as we'll need to make a new PR which will include the new testing tools. |
What type of PR is this? (check all applicable)
Description
Preact has been upgraded to the latest version, Preact X. This gives us hooks, componentDidCatch, fragments etc. See the official release for the whole rundown. Here is the official migration guide for Preact 8.x to X if you're curious why some changes have been made.
I've done a smoke test of the site on my local. Onboarding worked fine, search is good and the site seems to behaving normally.
Storybook appears to be broken still. This is related to work that needs to be done in #3490 and #2034. I will address that in a separate PR.
Related Tickets & Documents
#4243
Mobile & Desktop Screenshots/Recordings (if there are UI changes)
Added to documentation?
[optional] What gif best describes this PR or how it makes you feel?