Skip to content

Commit 5388fca

Browse files
committed
Apply changesets and update CHANGELOG
1 parent fa3d232 commit 5388fca

File tree

1 file changed

+20
-85
lines changed

1 file changed

+20
-85
lines changed

lib/README.md

Lines changed: 20 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
# Esbuild Plugin Webgl <img src="https://github.com/react18-tools/esbuild-plugin-webgl/blob/main/popper.png?raw=true" style="height: 40px"/>
22

3-
[![test](https://github.com/react18-tools/esbuild-plugin-webgl/actions/workflows/test.yml/badge.svg)](https://github.com/react18-tools/esbuild-plugin-webgl/actions/workflows/test.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/aa896ec14c570f3bb274/maintainability)](https://codeclimate.com/github/react18-tools/esbuild-plugin-webgl/maintainability) [![codecov](https://codecov.io/gh/react18-tools/esbuild-plugin-webgl/graph/badge.svg)](https://codecov.io/gh/react18-tools/esbuild-plugin-webgl) [![Version](https://img.shields.io/npm/v/esbuild-plugin-webgl.svg?colorB=green)](https://www.npmjs.com/package/esbuild-plugin-webgl) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/d18m/esbuild-plugin-webgl.svg)](https://www.npmjs.com/package/esbuild-plugin-webgl) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/esbuild-plugin-webgl) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/from-referrer/)
3+
[![test](https://github.com/react18-tools/esbuild-plugin-webgl/actions/workflows/test.yml/badge.svg)](https://github.com/react18-tools/esbuild-plugin-webgl/actions/workflows/test.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/c2532ae011e53b1bf011/maintainability)](https://codeclimate.com/github/react18-tools/esbuild-plugin-webgl/maintainability) [![codecov](https://codecov.io/gh/react18-tools/esbuild-plugin-webgl/graph/badge.svg)](https://codecov.io/gh/react18-tools/esbuild-plugin-webgl) [![Version](https://img.shields.io/npm/v/esbuild-plugin-webgl.svg?colorB=green)](https://www.npmjs.com/package/esbuild-plugin-webgl) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/d18m/esbuild-plugin-webgl.svg)](https://www.npmjs.com/package/esbuild-plugin-webgl) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/esbuild-plugin-webgl) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/from-referrer/)
44

5-
Esbuild Plugin Webgl is a comprehensive library designed to unlock the full potential of React 18 server components. It provides customizable loading animation components and a fullscreen loader container, seamlessly integrating with React and Next.js.
6-
7-
✅ Fully Treeshakable (import from `esbuild-plugin-webgl/client/loader-container`)
8-
9-
✅ Fully TypeScript Supported
10-
11-
✅ Leverages the power of React 18 Server components
12-
13-
✅ Compatible with all React 18 build systems/tools/frameworks
14-
15-
✅ Documented with [Typedoc](https://react18-tools.github.io/esbuild-plugin-webgl) ([Docs](https://react18-tools.github.io/esbuild-plugin-webgl))
16-
17-
✅ Examples for Next.js, Vite, and Remix
5+
ESBuild plugin to load webGL shaders from `.glsl` files.
186

197
> <img src="https://github.com/react18-tools/esbuild-plugin-webgl/blob/main/popper.png?raw=true" style="height: 20px"/> Please consider starring [this repository](https://github.com/react18-tools/esbuild-plugin-webgl) and sharing it with your friends.
208
@@ -38,87 +26,34 @@ $ npm install esbuild-plugin-webgl
3826
$ yarn add esbuild-plugin-webgl
3927
```
4028

41-
## Want Lite Version? [![npm bundle size](https://img.shields.io/bundlephobia/minzip/esbuild-plugin-webgl-lite)](https://www.npmjs.com/package/esbuild-plugin-webgl-lite) [![Version](https://img.shields.io/npm/v/esbuild-plugin-webgl-lite.svg?colorB=green)](https://www.npmjs.com/package/esbuild-plugin-webgl-lite) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/d18m/esbuild-plugin-webgl-lite.svg)](https://www.npmjs.com/package/esbuild-plugin-webgl-lite)
42-
43-
```bash
44-
$ pnpm add esbuild-plugin-webgl-lite
45-
```
46-
47-
**or**
48-
49-
```bash
50-
$ npm install esbuild-plugin-webgl-lite
51-
```
52-
53-
**or**
54-
55-
```bash
56-
$ yarn add esbuild-plugin-webgl-lite
57-
```
58-
59-
> You need `r18gs` as a peer-dependency
60-
61-
### Import Styles
62-
63-
You can import styles globally or within specific components.
64-
65-
```css
66-
/* globals.css */
67-
@import "esbuild-plugin-webgl/dist";
68-
```
69-
70-
```tsx
71-
// layout.tsx
72-
import "esbuild-plugin-webgl/dist/index.css";
73-
```
74-
75-
For selective imports:
76-
77-
```css
78-
/* globals.css */
79-
@import "esbuild-plugin-webgl/dist/client"; /** required if you are using LoaderContainer */
80-
@import "esbuild-plugin-webgl/dist/server/bars/bars1";
81-
```
82-
83-
### Usage
29+
> If you are using `monorepo` or `workspaces`, you can install this plugin to the root using `-w` or to a specific workspace using `--filter your-package` or `--scope your-package` for `pnpm` or `yarn` workspaces, respectively.
8430
85-
Using loaders is straightforward.
31+
## Use with `tsup`
8632

87-
```tsx
88-
import { Bars1 } from "esbuild-plugin-webgl/dist/server/bars/bars1";
33+
```ts
34+
// tsup.config.ts or tsup.config.js
35+
import { defineConfig } from "tsup";
36+
import { webglPlugin } from "esbuild-plugin-webgl";
8937

90-
export default function MyComponent() {
91-
return someCondition ? <Bars1 /> : <>Something else...</>;
92-
}
38+
export default defineConfig(options => ({
39+
...
40+
esbuildPlugins:[webglPlugin()]
41+
}));
9342
```
9443

95-
For detailed API and options, refer to [the API documentation](https://react18-tools.github.io/esbuild-plugin-webgl).
44+
## Use with `esbuild`
9645

97-
**Using LoaderContainer**
46+
```ts
47+
import { webglPlugin } from "esbuild-plugin-webgl";
9848

99-
`LoaderContainer` is a fullscreen component. You can add this component directly in your layout and then use `useLoader` hook to toggle its visibility.
100-
101-
```tsx
102-
// layout.tsx
103-
<LoaderContainer />
104-
...
105-
```
106-
107-
```tsx
108-
// some other page or component
109-
import { useLoader } from "esbuild-plugin-webgl/dist/hooks";
110-
111-
export default MyComponent() {
112-
const { setLoading } = useLoader();
113-
useCallback(()=>{
114-
setLoading(true);
115-
...do some work
116-
setLoading(false);
117-
}, [])
49+
esbuild.build({
11850
...
119-
}
51+
plugins: [webglPlugin()],
52+
});
12053
```
12154

55+
![Alt](https://repobeats.axiom.co/api/embed/a1fadcf8aa3054acff5d430c970af9e61254da5c.svg "Repobeats analytics image")
56+
12257
## License
12358

12459
This library is licensed under the MPL-2.0 open-source license.

0 commit comments

Comments
 (0)