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

Vite React Typescript example #402

Open
michaelto20 opened this issue Aug 7, 2024 · 6 comments
Open

Vite React Typescript example #402

michaelto20 opened this issue Aug 7, 2024 · 6 comments

Comments

@michaelto20
Copy link

With many new projects using Vite and Typescript with React, I struggled to find many examples or documentation on how to do that. I figured out the configuration and rewrote the weather sample app using Vite, Typescript, and React and would like to add that to the samples folder. Does this seem valuable and should I submit a PR for it?

@davidfowl
Copy link
Member

cc @IEvangelist

@IEvangelist
Copy link
Member

There are so many variations of SPA flavors out there, and just as many opinions. I'd be curious, what was the configuration bits required and what value does another JS SPA example add? If the only delta is the config, I'm not so sure I'm sold. Perhaps, it could be added as another app within the existing example? /cc @DamianEdwards too

@michaelto20
Copy link
Author

@IEvangelist, you are correct that the main changes are in the configs. Most of the config changes were in vite.config.ts and default.config.template. I think that adding this as another sample project is a good idea because pulling in environment variables into vite.config.ts is different from the typical Vite usage (i.e., VITE_). It took me a few hours to figure this out, and I believe it would be valuable to save others from the same headache.

Additionally, while there are many flavors of SPAs, Vite seems to be picking up a lot of steam over the last two years and I wondered if this work would help with adopting Aspire by those wanting to use Vite.

@NatanelBarazani
Copy link

With many new projects using Vite and Typescript with React, I struggled to find many examples or documentation on how to do that. I figured out the configuration and rewrote the weather sample app using Vite, Typescript, and React and would like to add that to the samples folder. Does this seem valuable and should I submit a PR for it?

Any chance you can make your repo public anyway?

@IEvangelist
Copy link
Member

@michaelto20 - sure, I'd review the React + Vite addition to the existing SPA sample. I might end up adding Svelte as well, I suppose the more we can demonstrate for well-adopted frameworks the better.

@michaelto20
Copy link
Author

@NatanelBarazani I can't make the repo I was working on public as it is for my job but I've created a draft PR for review so @IEvangelist or @davidfowl if you'd like to review it and lend feedback I'd be happy to make any changes needed.
Draft PR: #415

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

No branches or pull requests

4 participants