-
Notifications
You must be signed in to change notification settings - Fork 625
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
reinitialization w/ vite #69
base: main
Are you sure you want to change the base?
Conversation
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.
The linter wasn't working for me out of the box. There are some lingering jest stuff that's gumming it up. I included the version of .eslintrc.js that I was able to get working, and the plugin that needs to be installed in the package.json. After that, a lint pass would be a good idea.
There are a few tickets for this project that we could include in this change as well (links in a comment)
The images should be updated for our new standards.
We should update the docker container and test it in learn to make sure that it works properly (see comment on test.sh).
…of currently liked messages
…at end of wave 02
Mikellewade/vite
modified test.sh
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 addressing the other related tickets. I made a few phrasing suggestions. I'm also wondering whether we should leave some of those starting imports, even though they do cause linter errors at the start. Details in the comments.
At this point, we can use the entire chat message data from the JSON file `messages.json` to test our code as you implement each component. We may choose to update the `ChatEntry` to use the `id` field in this wave. | ||
At this point, we can use the entire chat message data from the JSON file `messages.json` to test our code as you implement each component. We may choose to update the `ChatEntry` to use the `id` field in this wave. At the end of this wave, all messages will be on the left side of the screen. For alternating left and right messages, please follow the instructions found in [optional enhancements](optional-enhancements.md). | ||
|
||
![Wave 02 One Sided Messages](../images/react-chatlog-demo-one-sided-messages.png) |
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.
🙌
import ChatEntry from './ChatEntry'; | ||
import { render, screen } from '@testing-library/react'; | ||
import '@testing-library/jest-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.
Is vitest compatible with this jest-dom testing library? Why did it change from the previous import '@testing-library/jest-dom/extend-expect';
?
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 had ran into the error Error: Missing "./extend-expect" specifier in "@testing-library/jest-dom" package
and came across this as a solution.
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 see. And that import is providing the toBeInTheDocument()
method. And that neceissitated adding the vitest setup file to extend expect manually. Got it. Thanks. 👍
@@ -1,6 +1,4 @@ | |||
import React from 'react'; |
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.
The import React
lines were causing linter warnings and are no longer necessary, so removing those is fine. 👍
For other imports in the project, even though they report linter warnings on the bare project, should we leave them in since they'll be needed later? Or maybe we should add reminders to the waves where they would be required for students to add them?
For the latter, I would say that we don't need to provide the explicit import line itself, but maybe something more along the lines of
Remember that the values we need for defining proptypes come from an external library and must be imported. We'll also need to be sure to import any other components used in each file.
Here especially, I'd be a little concerned that students wouldn't know to import the json file as we're doing, since we nevere really talk about that.
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 crossed my as well, my initial thought was to leave them out since they would encounter errors in the console if they try to utilize them without importing. I figured it would be a good place for them to get that practice. I think your reminder is a good one! You want to add to every wave, correct?
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.
If you prefer adding reminders to having the imports, that works for me too. In the required implementation, it looks like only waves 1 and 2 require adding imports. Wave 2 would need to also mention importing the json file (maybe say that the name used in the import will end up being the variable name we'll use to access the loaded data?) The optional enhancements might also require some imports depending on their implementation choices, so maybe a fairly broad statement about being sure to keep track of their imports as they work?
Co-authored-by: Ansel Rognlie <[email protected]>
Co-authored-by: Ansel Rognlie <[email protected]>
Co-authored-by: Ansel Rognlie <[email protected]>
Co-authored-by: Ansel Rognlie <[email protected]>
Asana Ticket: https://app.asana.com/0/1205655776549324/1205770483276175/f
PR to port React Chatlog from yarn/CRA to npm/VIte:
Testing
create-react-app
is no longer being maintained and therefore removedreact-scripts
from project and replaced withvitest
.vitest
is maintained by thevite
team and offers benefits such as speed and pipelining configurations. Though we won't necessarily see the benefits of this with the scope of React chatlog, instructors (Mikelle, Ansel, and Ashley) decided thatvitest
would be the best route to take when weighed against configuring Jest testing for the project (Jest does not intrinsically know anything about JSX files). To run the testing command in terminal runnpm run test
and for VScode please install: https://marketplace.visualstudio.com/items?itemName=ZixuanChen.vitest-explorerhttps://vitest.dev/guide/