create-socket-app icon indicating copy to clipboard operation
create-socket-app copied to clipboard

Create Socket App as a Vite generator wrapper

Open chicoxyzzy opened this issue 2 years ago • 7 comments

Vite has its own app generators for this list of frontend frameworks out of the box. "Others" include even more + there are TS templates.

image

Vite is simple to config, uses esbuild by default under the hood and is compatible with rollup plugins. It's also the base for SvelteKit (which is more opinionated, less configurable and have server support which we don't need, I use Vite in Svelte template).

Rollup and Vite together have more downloads then esbuild. Part of esbuild downloads are Vite downloads. Probably, some other downloads are other tools that use esbuild.

image

Vite has much more stars on GitHub than esbuild and it more contributors

image

I have a half-working Create Socket App tool experiment as a wrapper over Vite, will have a full-working prototype soon with dev server support and hopefully with Hot Module Replacement as well!

chicoxyzzy avatar Jan 26 '23 22:01 chicoxyzzy

This should be a high-priority and be released along with a new version of Socket.

what we need is:

  • create vite to install a template
  • ssc init
  • patch in the config (i.e. [build] copy = 'dist') OR patch in the vite.config.[js|ts] to add a rollup plugin I wrote for Redwood example (I'd go with the first option for now)
  • ~~patch index.html to have proper CSP and paths~~ not necessary once we merge a change with origin bundle URI

chicoxyzzy avatar Aug 16 '23 15:08 chicoxyzzy

Hey, great work, any news on Vite integration/template? Even just something Alpha to play with?

ahwelgemoed avatar Sep 25 '23 06:09 ahwelgemoed

Hey, great work, any news on Vite integration/template?

@ahwelgemoed Thank you. @chicoxyzzy is still working on it.

lamiazar avatar Sep 25 '23 17:09 lamiazar

Vite template integration will be available shortly after the v0.5.0 release of Socket

chicoxyzzy avatar Sep 26 '23 18:09 chicoxyzzy

@chicoxyzzy

I'm using 0.5.3 but don't see the vite option (for react).

also import * as app from "socket:application"; can't resolve the package dependency.

richburdon avatar Dec 21 '23 17:12 richburdon

@richburdon we are blocked by a vite bug, but hopefully we can release new version next year.

Regarding the built-in modules issue, you probably need some Vite configuration. Please try configuration from this article

chicoxyzzy avatar Dec 22 '23 11:12 chicoxyzzy

For anyone trying to get Vite to work with SSC, this is super helpful: https://gist.github.com/mecachisenros/12e3240a5d66cffa54089066f9ffe8ff

jaymakes11 avatar Feb 24 '24 03:02 jaymakes11