Open hans-rollingridges-dev opened 5 months ago
First of all, thanks for this comprehensive list including code examples and references - very much appreciated! A lot of these stem from just building on what's already there instead of refactoring where appropriate to be more in-line with common practices, patterns or simply what's best.
I won't really be able to address any of these soon unfortunately. That said, I believe it would make sense to convert these into single issues and label them accordingly, so others could chime in and provide PRs for these matters. If you want you can raise these issues, else I could do it too.
It's actually easy to turn these tasks into separate issues! After refining the tasks, I will hover in the top right corner and click "convert to issue". Also, if there is enough interest, I would schedule these improvements in a 'Road Map' Github project.
This issue concerns code review feedback for the Vendure storefront Remix starter. The feedback is intended to improve the Remix starter by providing a to-do list.
If you would like to be assigned to one of these tasks, please leave a comment.
When assigned, each task is further refined and broken down into subtasks related to a specific small unit of work.
Depending on the interest in taking on tasks, the list can be expanded with more improvements!
[ ] Improve - global app data - provisioning and type safety Description
Global app data provision via outlet and component properties has become less efficient. In this case, applying a root context provider is a good solution. Because the root context can be provided to any child component via a hook. As a bonus, a custom
useRootContext
hook ensures consistent global app data type safety across every component.Code example /app/contexts/root-context.ts
```ts import { type Dispatch, type SetStateAction, createContext, useContext } from "react"; type RootContextType = { cartOpenState: [boolean, DispatchCode example /app/root.tsx
```ts import { RootContext } from "~/contexts/RootContext"; export default function App() { const cartOpenState = useState(false); const orderService = useOrderService(); return (useRootContext
hook.Code example /app/components/Header.tsx
```ts import { useRootContext } from '~/contexts/RootContext' export default function Header() { const { cartOpenState: [cartOpen, setCartOpen], orderService, } = useRootContext(); return ( <>[ ] Add checkout end-to-end tests Description
Before refactoring the checkout form, it is good to first add an end-to-end test. After looking at the code and some manual testing, you must be able to add failing test cases.
Guide
The official Remix templates are a great start as they include testing and Github workflows. Create in a temporary folder a new Remix app with the blues-stack template.
Follow the
README.md
instructions and run the end-to-end tests. Next, copy the relevant code in your the Vendure Remix starter project and add the failing test cases.[ ] Improve checkout form - on blur - submission
[ ] Improve checkout form client/server side validation
[ ] Improve checkout form client/server side error handling.
[ ] Support default configurable guest checkout strategies
[ ] Improve Remix route revalidation
[ ] Improve multilingual support