Skip to content

Commit

Permalink
Revert "perf(es5): Remove legacy es5 bundling resources #63"
Browse files Browse the repository at this point in the history
This reverts commit a48216c.
  • Loading branch information
blackfalcon authored Apr 21, 2023
1 parent a31f50b commit 57e1c33
Show file tree
Hide file tree
Showing 7 changed files with 1,413 additions and 1,099 deletions.
24 changes: 8 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ For the most up to date information on [UI development browser support](https://

## Install

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

```shell
$ npm i @aurodesignsystem/auro-icon
$ npm i @alaskaairux/auro-icon
```

Installing as a direct, dev or peer dependency is up to the user installing the package. If you are unsure as to what type of dependency you should use, consider reading this [stack overflow](https://stackoverflow.com/questions/18875674/whats-the-difference-between-dependencies-devdependencies-and-peerdependencies) answer.
Expand Down Expand Up @@ -42,31 +42,23 @@ import "@alaskaairux/auro-icon";
<auro-icon category="alert" name="error" accent></auro-icon>
```

## CDN Use
## Install bundled assets from CDN

In cases where the project is not able to process JS assets, there are pre-processed assets available for use.

### Install

Include the following example HTML code in the `<head>` element of your page.
**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://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" />
<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" />

<script src="https://unpkg.com/@alaskaairux/auro-icon@latest/dist/auro-icon__bundled.es5.js" nomodule></script>
<script src="https://unpkg.com/@alaskaairux/auro-icon@latest/dist/auro-icon__bundled.js" type="module"></script>

<script src="https://unpkg.com/@alaskaairux/auro-icon@latest/dist/auro-alaska__bundled.es5.js" nomodule></script>
<script src="https://cdn.jsdelivr.net/npm/@alaskaairux/auro-icon@latest/dist/auro-alaska__bundled.js" type="module"></script>
<script src="https://unpkg.com/@alaskaairux/auro-icon@latest/dist/auro-alaska__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.

### CDN options

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.

### IE11 Support

**Displaimer:** While these components are supported in IE, there may be issues with loading the [web components polyfill](https://www.webcomponents.org/polyfills). Please consult their documentation when supporting IE11.
Expand Down
53 changes: 53 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const { browserslist: defaultBrowserslist } = require('./package.json');

const modernBrowserslist = defaultBrowserslist.filter(
(browser) => browser !== 'ie 11'
);

const sharedPlugins = [
'@babel/plugin-syntax-dynamic-import',
[
'@babel/plugin-transform-runtime',
{
useESModules: true
}
]
];

module.exports = {
exclude: [
'node_modules/@babel/**',
'node_modules/core-js/**',
'node_modules/@webcomponents/webcomponentsjs/**'
],
env: {
modern: {
// lit-element supports the last two versions of modern browsers, so we don't need to polyfill
exclude: ['node_modules/lit-element/**', 'node_modules/lit-html/**'],
presets: [
[
'@babel/preset-env',
{
targets: modernBrowserslist.join(', '),
useBuiltIns: 'usage',
corejs: 3
}
]
],
plugins: sharedPlugins
},
legacy: {
presets: [
[
'@babel/preset-env',
{
targets: defaultBrowserslist.join(', '),
useBuiltIns: 'usage',
corejs: 3
}
]
],
plugins: sharedPlugins
}
}
};
Loading

0 comments on commit 57e1c33

Please sign in to comment.