Add vite support and expand UI options#41
Conversation
|
No reason to not also support react 18 in my opinion for those who would want to eventually port an existing frontend |
Add comprehensive Inertia.js integration supporting all framework/bundler combinations (React 19, React 18, Vue, Svelte x esbuild, Vite). The --inertia flag creates a separate pipeline-based setup alongside existing LiveView pages, with its own entry point, layout, controller, and demo page showcasing AshTypescript's RPC client. Key additions: - Inertia dep, config, web module imports, and router plug - inertia_root.html.heex layout per bundler/framework combo - createInertiaApp entry points (React/Vue/Svelte) - Demo domain with ETS-backed Todo resource (create/list/delete) - Demo page components for all three frameworks - Svelte 5 compatible mount() API (not legacy constructor)
Simplify duplication of templates
|
@nadavhames No reason not to! Already added it as a "react18" option on the framework flag and the default react is 19 |
|
@Torkan I think this one is good for review now. Adds support for:
As a note: tried to add vite support for SSR with inertia but it didnt really work well, so I preferred to leave it with esbuild which is the supported bundler from the inertia_phoenix library. |
|
Ok, I am FINALLY reading to start getting this in, thanks for the patience 😄 🙈 I'll merge as-is, and then make some minor adjustments afterwards, splitting up the installer a bit etc. Also the installers will only install the bare necessities, meaning
Great work on this! 🤩 |
Phoenix Vite Support Implementation
Overview
I have an initial implementation with
phoenix_vitesupport, including Bun support as an installer for theash_typescript.npm_installtask to offer it as an option as it comes in thephoenix_viteversion.Current Implementation Notes
The installers currently follow two different approaches:
phx.digestash_typescriptspecific code.Questions for the Team
Before continuing with additional UI frameworks and SSR support, should any changes be made to the current approach? Should we unify in having both versions be fully managed by a package.json or change
viteconfig to let static assets be managed byphoenix?Planned Features
This PR aims to add support for:
Next Steps
Right now, I am looking for feedback on the current implementation direction before proceeding with adding more UI templates, afterwards SSR and lastly tests and docs. Lastly, I also wanted some feedback on the use of
Igniter.Util.Install.installsadly I didn't find another way to dynamically depend onphoenix_vite, it seemed wrong to have it compile when users choseesbuildas their bundlerContributor checklist
Leave anything that you believe does not apply unchecked.