SolidJS Web is a template and toolkit for building performant and reactive web applications using SolidJS.
This repository aims to provide:
- A Ready-to-Use Template: Start building fast and interactive web apps without worrying about initial setup.
- Best Practices: A structured project layout, linting & formatting configurations, and example code to ensure maintainable code quality.
- Tooling & Integrations: Preconfigured bundling, testing, and deployment workflows to streamline development.
With SolidJS Web, you can quickly bootstrap a new SolidJS project that encourages scalable, stable, and developer-friendly patterns from day one.
- SolidJS for Reactivity: Leverage SolidJS’s fine-grained reactivity for blazing-fast UI updates.
- TypeScript Support: Write robust, maintainable code with TypeScript’s static typing.
- Developer Experience:
- Vite for lightning-fast builds and HMR (Hot Module Replacement).
- ESLint and Prettier for consistent, clean code.
- Jest or Vitest (configurable) for running unit and integration tests.
- Routing & State Management: Integrations with popular SolidJS libraries (e.g.,
solid-app-router) to jumpstart common app features. - Scalable Project Structure: Intuitive folder layout for components, pages, assets, and utilities.
- Continuous Integration: Preconfigured GitHub Actions to run builds and tests on every pull request.
Ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/solidjs-web/SolidJS-Web.git cd SolidJS-Web -
Modify src/main.js as needed.
-
Run the following
npm install npm run build:prod npm run build:dev
-
Fork this repo
-
Modify src/main.js as needed.
-
Run the GitHub Action "Manual Build with Vite"
-
Download the Artifacts
There are only two ways for the use of SolidJS HTMLElement Template.
- Tagged Template Literals (Recommended)
-
import html from 'solid-js/html';
-
html`<div>${() => counter()}</div>`
-
- HyperScript
-
import h from 'solid-js/h';
-
h('div', () => counter())
-
<script src="solid-js-prod.js"></script>
<script>
const { createSignal, html, render } = SolidJS;
const App = () => {
const [counter, setCounter] = createSignal(0);
setInterval(() => setCounter(c => c + 1), 1000);
return html`<div>${() => counter()}</div>`;
}
render(App, document.body);
</script> <script src="solid-js-prod.js"></script>
<script>
const { createSignal, h, render } = SolidJS;
const App = () => {
const [counter, setCounter] = createSignal(0);
setInterval(() => setCounter(c => c + 1), 1000);
return h('div', () => counter());
}
render(App, document.body);
</script>