You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Makes the distributed files "unbundled", effectively moving optimisation to a consumer app concern, e.g. obfuscation, compression, bundling MUST be consumer concerns, the library SHOULD NOT make the consumer bundling process more difficult, it MUST facilitate it! It resolves cyclic imports or circular dependencies, enhances linting to prevent imports from barrel files, making the barrel files more of a public API than an internal API to help prevent circular dependencies.
6
+
7
+
From now on, bundling preserves the file tree, externalises packages based on the package.json dependency declaration automatically, instead of managing them manually as the current version does. It allows deep imports, e.g. @clickhouse/click-ui/components/Button.
8
+
9
+
Exports files are placed by target resolution, e.g. dist/esm|cjs. It has removed UMD until further notice (why is the original version providing UMD, what's the use-case?). As a component library, in principle, it should be ESM and CJS (due to NodeJS SSR) compatible in the worse case scenarios.
10
+
11
+
It reduces build times from > 1 minute to < 22 seconds.
12
+
13
+
More importantly, this initial revision provides tree-shaking support, helping reduce file size. Which can now be assessed with an optional builder feature to analyse and visualise the package dependency graph, file sizes, etc.
@@ -28,6 +28,11 @@ You can find the official docs for the Click UI design system and component libr
28
28
*[Storybook](#storybook)
29
29
-[Stories development server](#stories-development-server)
30
30
-[Public static site](#public-static-site)
31
+
*[Distribution](#distribution)
32
+
-[Build](#build)
33
+
-[Use Click UI](#use-click-ui)
34
+
-[Deep imports support](#deep-imports-support)
35
+
-[Examples](#examples)
31
36
*[Assets Management](#assets-management)
32
37
-[Add a new SVG logo or icon](#add-new-svg-logo-or-icon)
33
38
*[Releases and Versions](#releases-and-versions)
@@ -96,6 +101,7 @@ You can start the Storybook development server by:
96
101
yarn dev
97
102
```
98
103
104
+
99
105
We do NOT maintain a separate development environment; our Storybook stories serve as the source of truth for component implementation.
100
106
101
107
> [!IMPORTANT]
@@ -142,7 +148,6 @@ Once ready, you can run tests by:
142
148
```sh
143
149
yarn test:chromatic
144
150
```
145
-
146
151
> [!NOTE]
147
152
> Chromatic does NOT generate a report in the terminal due to its cloud nature, which only outputs:
148
153
> - Build status, e.g. uploading or testing
@@ -179,50 +184,12 @@ Once built, you can serve the static files by:
179
184
yarn storybook:serve
180
185
```
181
186
182
-
### Public static site
187
+
### Public Static Site
183
188
184
189
The latest static version's built and deployed automatically when contributing to `main` of [Click UI](https://github.com/ClickHouse/click-ui).
185
190
186
191
Once deployed it's available publicly at [clickhouse.design/click-ui](https://clickhouse.design/click-ui).
187
192
188
-
## How-to use
189
-
190
-
Click UI has been tested in NextJS, Gatsby, and Vite. If you run into problems using it in your app, please create an issue and our team will try to answer.
191
-
192
-
1. Navigate to your app's route and run
193
-
`npm i @clickhouse/click-ui`
194
-
or
195
-
`yarn add @clickhouse/click-ui`
196
-
2. Make sure to wrap your application in the Click UI `ClickUIProvider`, without doing this, you may run into issues with styled-components. Once that's done, you'll be able to import the individual components that you want to use on each page. Here's an example of an `App.tsx` in NextJS.
Learn to manage the versioning of changelog entries.
@@ -269,6 +236,107 @@ To consume all changesets, and update to the most appropriate semver version and
269
236
yarn changeset:version
270
237
```
271
238
239
+
## Distribution
240
+
241
+
The package is distributed as ESM.
242
+
243
+
### Build
244
+
245
+
To build the distribution version of the package run:
246
+
247
+
```sh
248
+
yarn build
249
+
```
250
+
251
+
> [!NOTE]
252
+
> Optimizations are responsability of consumer or host apps, e.g. they can't remove unused code if already minified it! We ship unminified code so their build tools can: analyse and remove what they don't need or dead code, debug more easily, compress everything together in one go instead of handling conflicting compression algorithms, etc.
253
+
254
+
### Use Click UI
255
+
256
+
Navigate to your app's work directory and add the package.
257
+
258
+
Here, we use `yarn` but you can use your favorite package manager, e.g. pnpm.
259
+
260
+
```sh
261
+
yarn add @clickhouse/click-ui
262
+
```
263
+
> [!NOTE]
264
+
> Click UI should be supported by react frameworks.
265
+
> If you run into any issues consuming it in your react app, report it [here](https://github.com/ClickHouse/click-ui/issues/new). Provide all important details, including information on how to replicate the issue!
266
+
267
+
Once installed, wrap the application with Click UI provider:
After, you are able to import your favorite [Click UI components](https://clickhouse.design/click-ui).
282
+
283
+
```js
284
+
import { ClickUIProvider, Title } from'@clickhouse/click-ui'
285
+
286
+
exportdefault () => {
287
+
return (
288
+
<ClickUIProvider theme='light'>
289
+
<Title type='h1'>Click UI Example</Title>
290
+
</ClickUIProvider>
291
+
);
292
+
}
293
+
```
294
+
295
+
To learn more about individual components, visit [Click UI components](https://clickhouse.design/click-ui).
296
+
297
+
### Deep imports support
298
+
299
+
Deep imports are supported, you can import directly from path.
300
+
301
+
> [!WARNING]
302
+
> At time of writing, there are components that consume from theme provider, which means that these will fail when unwrapped. This will change in future versions.
0 commit comments