Frequently Asked Questions
What is QGP?
Quark Gluon Plasma
It's an extraordinarily hot and dense state of matter that existed for a brief moment after the Big Bang. It's also the name of this framework. Like Quark Gluon Plasma, this framework is designed to be extremely efficient and fast so you can build your dream project without worrying about performance or syncing configurations between multiple tools.
QGP is designed for building Multi-Page Applications (MPA's) with Single-Page Applications (SPA's) inside of them. It's built on top of Astro and Vite. The idea is to leverage Astro's island architecture to build a fast and efficient website, but still be able to use Vite's HMR for developing complex SPA's. In this way, both the user and the developer can have a great experience.
What does QGP offer me?
The power of Astro
Everything that you see right now is powered by Astro. It started as a static site generator with a unique mixture of HTML and JSX templating, but it's become so much more! Here's a small list of it's extensive features:
- Native TypeScript and Markdown support -- No need for plugins or extra configuration.
- Bring Your Own Framework -- Use React, Vue, Svelte, etc. (Astro components are great too!)
- Dynamic Route Rendering -- Choose between SSG and SSR by route.
- Island Architecture -- Choose when and how to hydrate your app with JavaScript (with 0kb by default!)
- Serverless Adapters for Vercel, Netlify, and Deno Deploy -- or build the app and host it yourself!
- and more! Check out the website for a full list of features.
"Fat Islands"
With Astro, you can use as little client-side javascript as you want. This counter is
powered by a simple script tag embedded right into the faq.astro
template.
But you can also use as much client-side javascript as you want. Entire docs section is implmented as SPA (with SSR/SSG) using solid-router. While Astro was envisioned as a Multi-Page Application framework, QGP helps you blur these lines by placing one or more SPA's inside of your MPA.
Why not just use Astro?
The DX of Vite
So, what's the point of QGP if Astro is already so great? Well, there's one limitation that we haven't explained yet. While Astro is built on top of Vite, it runs additional build steps that are not compatible with Vite's HMR.
This limitation is necessary for Astro to do some of its cool optimizations, but it is not ideal for developing complex applications. While lazy loading entire React applications into your site is nice, testing them can be difficult when your state is lost every time you save a file.
Enter QGP
QGP simply sets up an additional Vite server that runs alongside Astro. This allows you to use Vite's HMR to develop your React app, while still using Astro's incredibly powerful tools. This server is preconfigured to share environment variables and typescript configuration with the main Astro server, so the only thing you need to worry about is building your app.
Can I try it?
Create QGP App
You can use the CLI to download a pre-configured template with an example app. Just follow these easy steps:
- Open a terminal in your folder of choice
-
Type
npm create qgp -t qgp-demo qgp-demo
to download the template. (You can replace the secondqgp-demo
with any folder name you want.) -
Type
cd qgp-demo
(or your project name) to enter the new folder. -
Type
npm i -g @antfu/ni
to install a helpful tool. -
Type
ni
to set up the project. -
Type
nr dev
to start the dev server. - Open http://localhost:3000 to see the entire site on the Astro dev server.
- Open http://localhost:5173 to see the React app on the Vite dev server.
You can just enter npm create qgp@latest
if you want to explore the other templates,
or create your own!
Where can I learn more?
The Docs
If you're unfamiliar with Astro and Vite, I suggest that you start with the official documentation. If you're interested in learning more about QGP, check out our documentation or reach out on the links below.