UNPKG

4.14 kBMarkdownView Raw
1# ZUI Bundle
2
3ZUI, out of the box, provides ES modules with bare path modifiers (e.g. `import '@zywave/zui-foo-bar'`). This is great as that's the way browsers are _going_, but they aren't there quite yet. Tooling exists to help solve this problem like webpack or rollup. If you really just need to get ZUI (all of ZUI) into your project and don't want to configure a build process, this is the package for you.
4
5`zui-bundle` creates three main artifacts:
6
7- `dist/bundle.js`\*: Most of the JS components (e.g. custom elements) of ZUI; with the exception of some components
8- `dist/css/zui-bundle.app.css`: All of the separate CSS sheets merged into one (e.g. fonts, styles, etc.)
9- `dist/css/zui-bundle.fouc.css`: All of the FOUC (flash of unstyled content) CSS sheets merged into one
10
11In most cases, you will want all three.
12
13\* Note: ZUI Table is not included in `dist/bundle.js` because it is an opt-in only component.
14
15For more information on installing this bundle, see our [getting started guide](https://booster.zywave.dev/introduction/getting-started/how-to-get-started/).
16
17## ZUI Table
18
19ZUI Table is an opt-in only component. If you want to use it, you'll need to import it separately. For more information, please check out the [ZUI Table documentation](https://booster.zywave.dev/design-system/components/tables/).
20
21```html
22<script type="module" src="https://cdn.zywave.com/@zywave/zui-bundle@{latest|next}/dist/components/table.js"></script>
23```
24
25Location of the artifact in the `zui-bundle` package: `dist/components/table.js`
26
27# Installation via CDN
28
29We recommend using the Zywave CDN to serve up the ZUI bundle. This will ensure that you are always using the latest stable version of ZUI with the `@latest` distribution tag.
30
31```html
32<!doctype html>
33<html>
34 <head>
35 <title>Installing zui-bundle</title>
36
37 <!-- These two stylesheets should always be listed before all other application styles -->
38 <!-- Make sure `zui-bundle.fouc.css` is always listed first to counter FOUC -->
39 <link rel="stylesheet" href="https://cdn.zywave.com/@zywave/zui-bundle@{latest|next}/dist/css/zui-bundle.fouc.css" />
40 <link rel="stylesheet" href="https://cdn.zywave.com/@zywave/zui-bundle@{latest|next}/dist/css/zui-bundle.app.css" />
41
42 <script type="module" src="https://cdn.zywave.com/@zywave/zui-bundle@{latest|next}/dist/bundle.js"></script>
43 </head>
44 <body>
45 <!-- your content here -->
46 <body>
47</html>
48```
49
50## Distribution tags
51
52There are two distribution tags we supply: `@latest` and `@next`. `@latest` will always point to the latest stable version of ZUI. `@next` will always point to the latest version of ZUI, regardless of stability. Learn more about the benefits of using our CDN with distribution tags [here](https://booster.zywave.dev/introduction/getting-started/installing-packages/#%40latest-and-%40next-tags).
53
54## Installation via NPM or Yarn
55
56If you want an à la carte experience, you can install individual component packages via Yarn or NPM.
57
58The following works with no extra work:
59
60```
61> yarn add @zywave/zui-components-all
62> yarn add @zywave/zywave-components-all
63```
64
65```
66> npm install @zywave/zui-components-all
67> npm install @zywave/zywave-components-all
68```
69
70# Run ZUI Bundle locally
71
72Relative to this directory:
73
741. `yarn run build:after`
751. `yarn run lab`
76
77## Debugging
78
79**Note:** This bundle doesn't observe the "source" of ZUI, but rather the built outputs of each and every package. If you make a change in a TypeScript file in a component, you will need to rebuild that package prior to building the bundle.
80
81The generated output from Rollup is quite hard to read. This is done purposefully, not to be difficult to read, but to reduce bytes in our final output. However, sometimes you really just want to see the full bundle in its legible glory.
82
83There are a few plugins in the `rollup.config.js` file in this package that you can "turn off" by commenting them out:
84
851. `terser`
861. `cleanup`
87
88By commenting those plugins, and then rebuilding the bundle, you'll more easily be able to debug this package.
89
90See [the documentation site](http://booster.zywave.dev/) for more information.