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

feat(create-vite): add qwik templates #13620

Merged
merged 17 commits into from
Jul 6, 2023

Conversation

leifermendez
Copy link
Contributor

@leifermendez leifermendez commented Jun 25, 2023

pr-vite-qwik-convert.mp4

Description

A new template has been added for Qwik Framework

What is the purpose of this pull request?

  • Bug fix
  • [x ] New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • [x ] Read the Contributing Guidelines.
  • [x ] Read the Pull Request Guidelines and follow the PR Title Convention.
  • [x ] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • [ x] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@stackblitz
Copy link

stackblitz bot commented Jun 25, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@manucorporat
Copy link
Contributor

From what i see: the .gitignore needs to be called: _gitignore

@bluwy
Copy link
Member

bluwy commented Jun 25, 2023

I don't think a QwikCity template fits here? Similarly we don't add the SvelteKit template here. At most it's a vanilla Vite + Qwik template similar to the other existing frameworks setup and design. And then we can add a CLI redirect to QwikCity.

@leifermendez
Copy link
Contributor Author

I don't think a QwikCity template fits here? Similarly we don't add the SvelteKit template here. At most it's a vanilla Vite + Qwik template similar to the other existing frameworks setup and design. And then we can add a CLI redirect to QwikCity.

I get it! I changed the starter app and also I added the option to QwikCity like SvelteKit.

@manucorporat WDYT?

Copy link
Member

@ArnaudBarre ArnaudBarre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is multiple things that are off compared to others templates (not an issue but need to be justified):

  • lib mode
  • ssr entry
  • tsconfig/.gitignore diverge from other templates

@manucorporat
Copy link
Contributor

@patak-dev @ArnaudBarre core qwik team here! worked last week to make sure qwik's CSR is in pair with the rest, 100% standard vite starter, index.html as starting point!

@manucorporat
Copy link
Contributor

manucorporat commented Jul 5, 2023

@leifermendez think we should remove the .eslintrc.cjs

@patak-dev
Copy link
Member

Thanks @manucorporat, I think we should also remove .eslintignore and .prettierignore. And to align with the rest of the starters, there should be a JS version too.

Also, you could add information on the template README.md or directly in the vite config file about the csr option you used.

We were discussing with @bluwy that with the previous setup that included low-level SSR handling, it was better to merge this into create-vite-extra. But with csr, at least to me, create-vite is a better place.

Just to set the expectations, create-vite templates are barebone and mainly intended to try out Vite (or do bug repros). We always point users to prefer the create starters from the frameworks when possible.

@manucorporat
Copy link
Contributor

Done! @patak-dev removed the files as suggested and added the .js version

@manucorporat
Copy link
Contributor

Added READMEs!

@patak-dev
Copy link
Member

Are the .eslintrc.cjs a must? We only added eslint to the React templates because they said React was broken without the eslint hook rules. I think it would be better to remove eslint support if possible.

@patak-dev
Copy link
Member

There is an extra [package-lock.json](https://github.com/vitejs/vite/pull/13620/files#diff-dded9ed3ccf0f6711806b389d69fe9ccff27addb409d7f9dd28a071a127cc65d) in the new JS template that should be removed too.

@manucorporat
Copy link
Contributor

Not really, i misunderstood u, thought u wanted the eslint added! removed

Comment on lines 16 to 17
width={32}
height={32}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Vite logo has the same size as the framework logo in other templates. See
image

Same for the JS template

@patak-dev
Copy link
Member

The templates prompts the user "Edit src/app.tsx and save to test HMR", but when trying it out there is a hard reload instead, and the state is lost. Tested the react one that has the same prompt and it is working. If this is a limitation with Qwik, maybe the prompt could be about editing another component. We have in Vue a HelloWorld component for example (because of unrelated reasons)

leifermendez and others added 3 commits July 5, 2023 17:03
Co-authored-by: patak <matias.capeletto@gmail.com>
@manucorporat
Copy link
Contributor

HMR is not implemented in Qwik CSR yet, CSR never been a focus.

Fixed the image size and remove that prompt to the user

Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now! Thanks for the changes.

@bluwy
Copy link
Member

bluwy commented Jul 5, 2023

The changes look great and follows the convention! I have a small question but not 100% blocking this:

HMR is not implemented in Qwik CSR yet, CSR never been a focus.

I wonder if this CSR setup is something you'd recommend building with Qwik today? If not, it feels a bit weird keeping a template for it. In most docs it looks like QwikCity (or an SSR setup in general) is the preferred starting point.

@manucorporat
Copy link
Contributor

manucorporat commented Jul 5, 2023

There are uses cases! Qwik is equivalent to Vue, Solid, React, (same group). It dont need server, we are coming up with new uses cases for CSR, like mobile apps (Capacitor), Qwik automatic lazy loading is still interesting even without SSR involved!
However never been the active focus.

Regarding HMR i plan to work on this soon, for CSR and improvements for SSR too

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. If there are plans for improving CSR, let's get this in 👍

@bluwy bluwy changed the title feat: ✨ added qwik-starter 🚀 feat(create-vite): add qwik templates Jul 6, 2023
@patak-dev patak-dev merged commit ef4602b into vitejs:main Jul 6, 2023
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.

5 participants