nx
nx copied to clipboard
feat(remix): add vite mode support
Current Behavior
Remix plugin is using older 'classic' remix tooling.
Expected Behavior
Remix plugin is using up to date tooling and configurations
Related Issue(s)
https://github.com/nrwl/nx/pull/22551
Fixes # https://github.com/nrwl/nx/issues/22035
Checklist:
- [x] Implement executors support for the 'vite' mode
- [ ] Implement generators for new 'vite' mode
- [x] Generators having
--bundleroption to support classic or vite during generation - [ ] Vite plugin ignoring Remix Vite files for build if remix, but supporting vitest if test config is found
- [ ] Remix plugin supporting vite files only if they are for remix
- [ ] Migration paths for users wishing to migrate from classic to vite
- [ ] docs updates
- [ ] unit tests for plugin
- [ ] e2e tests for executors and plugins
Other fixes changes:
- remix/dev and other libs are not included for the vite-mode prod build
Preview
You can replace @nx/remix with this repo. Add this dependency entry into your package.json:
"@nx/remix": "[email protected]:unrealsolver/nx-remix-vite.git",
https://github.com/unrealsolver/nx-remix-vite/tree/main
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
| Name | Status | Preview | Updated (UTC) |
|---|---|---|---|
| nx-dev | ⬜️ Ignored (Inspect) | Visit Preview | Apr 22, 2024 10:22am |
☁️ Nx Cloud Report
CI is running/has finished running commands for commit 4bb66e217ee2447e64fe71c06fb1c7093a58c45c. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.
📂 See all runs for this CI Pipeline Execution
| 🟥 Failed Commands |
|---|
nx affected --targets=lint,test,build --base=50d89c7d5ae407d79494567e1f2aa4fb9562624f --head=4bb66e217ee2447e64fe71c06fb1c7093a58c45c --parallel=3 |
✅ Successfully ran 4 targets
nx run-many -t check-imports check-commit check-lock-files check-codeowners documentation --parallel=1 --no-dtenx-cloud record -- nx format:check --base=50d89c7d5ae407d79494567e1f2aa4fb9562624f --head=4bb66e217ee2447e64fe71c06fb1c7093a58c45cnx documentation --no-dtenx affected -t e2e-macos --parallel=1 --base=50d89c7d5ae407d79494567e1f2aa4fb9562624f --head=4bb66e217ee2447e64fe71c06fb1c7093a58c45c
Sent with 💌 from NxCloud.
Hey @unrealsolver
Thanks for the contribution, however, there's a lot more we need to consider to actual support Remix Vite.
While this does allow executors to use vite for remix, there are other things that need to be considered.
- Is the project using vite, or classic?
- This will dictate the command to be run
- Generators having
--bundleroption to support classic or vite during generation - Vite plugin ignoring Remix Vite files for build if remix, but supporting vitest if test config is found
- Remix plugin supporting vite files only if they are for remix
- Migration paths for users wishing to migrate from classic to vite
- docs updates
- unit tests for plugin
- e2e tests for executors and plugins
I really do appreciate you attempting to help out to get this over the line, but the scale of the work involved is large. Remix Vite support is on my list to support, and I'll be working on it soon.
@Coly010 , thanks for the check-list, I'll add it to the PR to track progress. This PR is still WIP, I just did the most critical work so I can use Nx with manually migrated project locally. I'll put other pieces of work during the next week or so.
@Coly010 is there any timeline on getting this done. Having to rely on some custom patches to keep my build process working.
There is also the fact now remix and react router are merging which may require more work https://remix.run/blog/merging-remix-and-react-router.
Thanks.
No timeline yet unfortunately and yes, currently aware of the react-router merger. In contact with Ryan Florence about it 👍
I'm not quite sure if you're about to use code from this pr, but if so please consider public being build inside build/client instead of copying it over as it's not necessary.
Also an option for defining an own server file to get executed would be beneficial. Right now i wrote my own executor to leverage esbuild to build the server (ts) and place it inside the dist folder.
I'm going to close this PR as it has not been updated in a few months now.
We have Vite support added to our internal roadmap and will be addressing it soon
I'm going to close this PR as it has not been updated in a few months now.
We have Vite support added to our internal roadmap and will be addressing it soon
Good to hear, is there some way to follow that progress?
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.