Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Socket App as a Vite generator wrapper #7

Open
chicoxyzzy opened this issue Jan 26, 2023 · 7 comments · May be fixed by #55
Open

Create Socket App as a Vite generator wrapper #7

chicoxyzzy opened this issue Jan 26, 2023 · 7 comments · May be fixed by #55
Assignees
Labels
enhancement New feature or request

Comments

@chicoxyzzy
Copy link
Member

chicoxyzzy commented Jan 26, 2023

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 chicoxyzzy added the enhancement New feature or request label Jan 26, 2023
@chicoxyzzy chicoxyzzy changed the title Create Socket App as a Vite generator wrapper [experimental] Create Socket App as a Vite generator wrapper Jan 26, 2023
@chicoxyzzy chicoxyzzy mentioned this issue Jan 31, 2023
5 tasks
@chicoxyzzy
Copy link
Member Author

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 chicoxyzzy changed the title [experimental] Create Socket App as a Vite generator wrapper Create Socket App as a Vite generator wrapper Aug 16, 2023
@ahwelgemoed
Copy link

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

@lamiazar
Copy link
Member

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

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

@chicoxyzzy
Copy link
Member Author

chicoxyzzy commented Sep 26, 2023

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

@chicoxyzzy chicoxyzzy linked a pull request Oct 20, 2023 that will close this issue
@richburdon
Copy link

richburdon commented Dec 21, 2023

@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.

@chicoxyzzy
Copy link
Member Author

@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

@jaymakes11
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants