Skip to content

Commit

Permalink
perf: remove legacy es5 bundling resources #31
Browse files Browse the repository at this point in the history
Change to be committed:
deleted: babel.config.js
deleted: index.html
modified: package-lock.json
modified: package.json
deleted: rollup.config.js
new file: rollup.config.mjs
deleted: src/es5.js
  • Loading branch information
irma-kurnia-phtn committed May 30, 2023
1 parent 971275b commit a27ecb8
Show file tree
Hide file tree
Showing 8 changed files with 4,128 additions and 930 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ For the most up to date information on [UI development browser support](https://

## Install

[![Build Status](https://img.shields.io/github/workflow/status/AlaskaAirlines/auro-alert/Test%20and%20publish?branch=master&style=for-the-badge)](https://github.com/AlaskaAirlines/auro-alert/actions?query=workflow%3A%22test+and+publish%22)
[![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-alert/testPublish.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-alert/actions/workflows/testPublish.yml)
[![See it on NPM!](https://img.shields.io/npm/v/@aurodesignsystem/auro-alert?style=for-the-badge&color=orange)](https://www.npmjs.com/package/@aurodesignsystem/auro-alert)
[![License](https://img.shields.io/npm/l/@aurodesignsystem/auro-alert?color=blue&style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)

Expand Down Expand Up @@ -60,23 +60,25 @@ Default `auro-alert`
</auro-alert>
```

## Install bundled assets from CDN
## CDN Use

In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Two bundles are available -- `auro-alert__bundled.js` for modern browsers and `auro-alert__bundled.es5.js` for legacy browsers (including IE11).
In cases where the project is not able to process JS assets, there are pre-processed assets available for use.

Since the legacy bundle includes many polyfills that are not needed by modern browsers, we recommend you load these bundles using [differential serving](https://philipwalton.com/articles/deploying-es2015-code-in-production-today/) so that the browser only loads the bundle it needs. To accomplish this, the script tag for the modern bundle should have `type="module"` and the script tag for the legacy bundle should have the `nomodule` attribute. See the example below.
### Install
Include the following example HTML code in the `<head>` element of your page.

### Bundle example code
```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@alaskaairux/design-tokens@latest/dist/tokens/CSSCustomProperties.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@alaskaairux/webcorestylesheets@latest/dist/bundled/essentials.css" />

<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-alert@latest/dist/auro-alert__bundled.js" type="module"></script>
```

**NOTE:** Be sure to replace `@latest` in the URL with the version of the asset you want. @latest is NOT aware of any MAJOR releases, use at your own risk.

```html
<link rel="stylesheet" href="https://unpkg.com/@alaskaairux/design-tokens@latest/dist/tokens/CSSCustomProperties.css" />
<link rel="stylesheet" href="https://unpkg.com/@alaskaairux/webcorestylesheets@latest/dist/bundled/essentials.css" />
### CDN options

<script src="https://unpkg.com/@aurodesignsystem/auro-alert@latest/dist/auro-alert__bundled.js" type="module"></script>
<script src="https://unpkg.com/@aurodesignsystem/auro-alert@latest/dist/auro-alert__bundled.es5.js" nomodule></script>
```
Both [Unpkg](https://www.unpkg.com/) and [JSDelivr](https://www.jsdelivr.com/) are free open source options that you can use. These are 3rd party resources and Auro is not responsible for their uptime. **Use at your own risk.** These bundle resources are included with the npm package, you are free to use any CDN resource that fits your needs.

## Development

Expand Down
53 changes: 0 additions & 53 deletions babel.config.js

This file was deleted.

15 changes: 0 additions & 15 deletions index.html

This file was deleted.

Loading

0 comments on commit a27ecb8

Please sign in to comment.