Skip to content

Add vite support and expand UI options#41

Merged
Torkan merged 19 commits intoash-project:mainfrom
Alt-iOS:add_vite_support
Mar 28, 2026
Merged

Add vite support and expand UI options#41
Torkan merged 19 commits intoash-project:mainfrom
Alt-iOS:add_vite_support

Conversation

@Alt-iOS
Copy link
Copy Markdown
Contributor

@Alt-iOS Alt-iOS commented Jan 21, 2026

Phoenix Vite Support Implementation

Overview

I have an initial implementation with phoenix_vite support, including Bun support as an installer for the ash_typescript.npm_install task to offer it as an option as it comes in the phoenix_vite version.

Current Implementation Notes

The installers currently follow two different approaches:

  • esbuild version: Follows the traditional Phoenix mindset where esbuild/tailwind are CLI-wrapped, some dependencies are vendored in, and Phoenix handles static assets through phx.digest
  • phoenix_vite version: Takes the approach of letting Vite handle all static assets and adds its own plugs. I have currently just added ash_typescript specific 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 vite config to let static assets be managed by phoenix?

Planned Features

This PR aims to add support for:

  1. Vite/esbuild choice - Allow users to choose between Vite and esbuild (and npm or bun)
  2. More UI templates - Expand available UI framework templates (react/vue/sveltekit/solid)
  3. SSR support - Add server-side rendering capabilities with Inertia

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.install sadly I didn't find another way to dynamically depend on phoenix_vite, it seemed wrong to have it compile when users chose esbuild as their bundler

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

@Alt-iOS Alt-iOS marked this pull request as ready for review January 26, 2026 17:09
@nadavhames
Copy link
Copy Markdown

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
@Alt-iOS
Copy link
Copy Markdown
Contributor Author

Alt-iOS commented Feb 20, 2026

@nadavhames No reason not to! Already added it as a "react18" option on the framework flag and the default react is 19

@Alt-iOS
Copy link
Copy Markdown
Contributor Author

Alt-iOS commented Feb 23, 2026

@Torkan I think this one is good for review now. Adds support for:

  • bun/npm usage
  • allows vite/esbuild
  • react18/react/vue/solid/svelte as an SPA
  • Inertia with SSR for esbuild with react/react18/vue/svelte

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.

@Torkan
Copy link
Copy Markdown
Collaborator

Torkan commented Mar 28, 2026

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

  • Support setting up bun
  • Use esbuild or vite
  • Which framework to setup (react/svelte/vue/solid)
  • No libs, no matter how popular they are in their framework's ecosystem, people can just install those themselves 😄

Great work on this! 🤩

@Torkan Torkan merged commit 5873edf into ash-project:main Mar 28, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants