Skip to content

Commit d827d24

Browse files
committed
Update readme to use supplejs-templates
1 parent fed4b36 commit d827d24

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# SuppleJS
22

3-
43
[![NPM version](https://img.shields.io/npm/v/supplejs?logo=npm)](https://www.npmjs.com/package/supplejs)
54
[![GitHub License](https://img.shields.io/github/license/delph123/supplejs)](https://github.com/delph123/supplejs/blob/main/LICENSE)
65
[![Build Status](https://img.shields.io/github/actions/workflow/status/delph123/supplejs/test_and_coverage.yml?branch=main&logo=github)](https://github.com/delph123/supplejs/actions/workflows/test_and_coverage.yml)
@@ -16,7 +15,10 @@ so that the reactivity is not lost and SuppleJS can make sure to re-render only
1615
## Example
1716

1817
```jsx
19-
import { h, render, createSignal } from "supplejs";
18+
/*
19+
* @jsxImportSource supplejs
20+
*/
21+
import { render, createSignal } from "supplejs";
2022

2123
function Counter() {
2224
// Create a signal with read/write segregation
@@ -53,26 +55,26 @@ This minimalist example implement the iconic "counter button" component with Sup
5355

5456
- Unlike in SolidJS, one must return a function instead of JSX directly from a component
5557
- The signal shall not be called to avoid re-rendering the full button and only mutate the count value in the DOM when it is changed
56-
- `h` (and `Fragment`) functions must be in scope to be able to use JSX (respectively `<>...</>`)
58+
- When working with JSX markup, `jsxImportSource` must be set in TypeScript config to `supplejs` to import primitives necessary for supplejs and typing of JSX
5759

5860
This all is due to not having a compiler, and to the design of SuppleJS. However, besides that, the same API is used as SolidJS. For example for `createSignal`, `render` and other reactive primitives like `createMemo`, `createResource`, `createEffect`, `onCleanup`, `createRoot`, `getOwner`, and so on. SuppleJS also provides same control flow components as Solid: `<Show>`, `<Switch>`/`<Match>`, `<For>`, `<Index>`, `<Portal>`, etc.
5961

6062
As SuppleJS provides the same API and design as Solid, you can have a look at the [Github repository](https://github.com/solidjs/solid) and the [API documentation](https://www.solidjs.com/docs/latest/api) to get a glimpse of what's inside SuppleJS and what are its key features. Bear in mind though that SuppleJS is only about the front-end rendering part and has no Server Side Rendering engine.
6163

6264
## How to use?
6365

64-
The usual steps as for many other JavaScript project is to clone the project in your computer and install dependencies from npm. The project uses [pnpm](https://pnpm.io/fr/) package manager and [vite](https://vitejs.dev/) developer tooling.
66+
You can get started with a simple app by running the commands below in your terminal. The project uses [pnpm](https://pnpm.io/fr/) package manager and [vite](https://vitejs.dev/) developer tooling.
6567

6668
```sh
67-
> git clone https://github.com/delph123/supplejs
68-
> cd supplejs
69-
> pnpm install
69+
> pnpm dlx degit delph123/supplejs-templates/ts-vitest example-app
70+
> cd example-app
71+
> pnpm install # or npm install or yarn install
7072
```
7173

7274
Once all dependencies are downloaded and installed, you can run a local server with fast refresh with:
7375

7476
```sh
75-
> pnpm dev
77+
> pnpm run dev # or yarn or npm
7678
```
7779

7880
Other scripts includes:
@@ -83,3 +85,15 @@ Other scripts includes:
8385
> pnpm build && pnpm preview # build supple & run a preview server
8486
> pnpm lint # launch eslint
8587
```
88+
89+
**Note:** Even though SuppleJS is working mostly fine and have a good ecosystem, it is still just a educational project. As such, it should not be used for production-grade development!
90+
91+
## Contributing
92+
93+
As SuppleJS is just a toy project, I probably won't be accepting pull requests or contributions.
94+
95+
However, do feel free to fork the project to use it for you own education or to do whatever you feel like to do with it.
96+
97+
If you find issues or have feedbacks to do, don't hesitate to create an issue.
98+
99+
I'm using supplejs & supplejs-testing-library package names in [npm](https://www.npmjs.com/). If feel you need this library name and have good reasons not to use another, file an issue to reach out to me!

0 commit comments

Comments
 (0)