Skip to content

Commit

Permalink
remove: delete dist bundles as UMD bundles are now in standalone repos
Browse files Browse the repository at this point in the history
  • Loading branch information
Planeshifter committed Dec 23, 2023
1 parent 7fb88d4 commit 7b9022a
Show file tree
Hide file tree
Showing 176 changed files with 8 additions and 15,799 deletions.
47 changes: 7 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,44 +353,6 @@ $ stdlib repl

### Environment Builds

<a name="install_env_builds_jquery"></a>

#### jQuery-like Bundle

For those wanting a jQuery-like bundle, one can use pre-built distributable UMD bundles for use in browser environments or as shared ("vendored") libraries in server environments, see the [`dist`][stdlib-bundles] directory and associated [guide][stdlib-bundles].

As an example, to include a UMD bundle exposing lower-level special [math functions][@stdlib/math/base/special] in a webpage, we can first locally install the UMD bundle package using [npm][npm]

<!-- run-disable -->

```bash
$ npm install @stdlib/dist-math-base-special-flat
```

and then include the following `<script>` tag in our HTML document

<!-- run-disable -->

```html
<script type="text/javascript" src="/path/to/@stdlib/dist-math-base-special-flat/build/bundle.min.js"></script>
```

making sure to modify the script path based on the local installation directory.

If no recognized module system is present, one can access bundle contents in another `<script>` tag via the global scope.

<!-- run-disable -->

```html
<script type="text/javascript">
// If no recognized module system present, exposed to global scope:
var erf = stdlib_math_base_special_flat.erf;
console.log( erf( 0.5 ) );
</script>
```

For more details and available bundles, see the [`dist`][stdlib-bundles] directory and associated [guide][stdlib-bundles]. The [guide][stdlib-bundles] includes instructions for consuming via CDNs, such as [unpkg][unpkg].

<a name="install_env_builds_esm"></a>

#### ES Modules
Expand Down Expand Up @@ -427,6 +389,13 @@ var arr = ndarray( [ [ 1, 2 ], [ 3, 4 ] ] );
// returns <ndarray>
````


<a name="install_env_builds_jquery"></a>

#### jQuery-like Bundle

For those wanting a jQuery-like bundle, one can use pre-built distributable UMD bundles for use in browser environments or as shared ("vendored") libraries in server environments available in each package's repository via a dedicated `umd` branch. See sections [UMD](#install_env_builds_umd) and [Node.js](#install_env_builds_nodejs) for more details.
<a name="install_env_builds_umd"></a>
#### UMD
Expand Down Expand Up @@ -812,8 +781,6 @@ Test and build infrastructure is generously provided by the following services:
[stdlib-source]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib
[stdlib-bundles]: https://github.com/stdlib-js/stdlib/tree/develop/dist

[stdlib-code-coverage]: https://codecov.io/github/stdlib-js/stdlib/branch/develop
[open-collective-stdlib]: https://opencollective.com/stdlib
Expand Down
72 changes: 1 addition & 71 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ limitations under the License.

<section class="intro">

This directory contains packages exporting distributable files for use in browser environments or as shared ("vendored") libraries in server environments. Each distributable file is a standalone [UMD][umd] bundle which, if no recognized module system is present, will expose bundle contents to the global scope.
This directory is reserved for packages exporting distributable files for use in browser environments or as shared ("vendored") libraries in server environments.

</section>

Expand All @@ -36,44 +36,6 @@ This directory contains packages exporting distributable files for use in browse

<section class="usage">

## Usage

First, install one of the packages in this directory containing distributable files. For example, to install the main [stdlib][stdlib] bundle

```bash
$ npm install --save @stdlib/dist-flat
```

To use a package's default bundle in a webpage,

```html
<script type="text/javascript" src="/path/to/node_modules/@stdlib/dist-<pkg>"></script>
```

where `dist-<pkg>` corresponds to the desired published distributable file package.

To use a specific bundle (e.g., un-minified), include the bundle file path

```html
<script type="text/javascript" src="/path/to/node_modules/@stdlib/dist-<pkg>/build/<bundle>.js"></script>
```

where `<bundle>` corresponds to the desired bundle. For example, to include the un-minified bundle found in the package used in the example above

```html
<script type="text/javascript" src="/path/to/@stdlib/dist-flat/build/bundle.js"></script>
```

If no recognized module system is present, access bundle contents via the global scope. For example, assuming the flat namespace bundle sourced above,

```html
<script type="text/javascript">
// `stdlib` is a global variable...
var erf = stdlib.base.erf;
console.log( erf( 0.5 ) );
</script>
```

</section>

<!-- /.usage -->
Expand All @@ -82,22 +44,6 @@ If no recognized module system is present, access bundle contents via the global

<section class="notes">

## Notes

- Bundles are one of two namespace types: `flat` or `tree`. A `tree` namespace is a nested object namespace which mirrors the project's layout (e.g., `stdlib.math.base.special.erf`). A `flat` namespace uses the global alias [namespace][@stdlib/namespace], where each package has a unique alias (e.g., `stdlib.base.erf`). Which namespace is preferred depends on personal taste and application context.

- Each minified bundle has a corresponding [gzip][gzip]-compressed bundle. The [gzip][gzip] compression level for each compressed bundle is `9`, which is the highest (and most optimal) compression level. Deciding between uncompressed and compressed bundles depends on the application and whether compression is handled elsewhere in the application stack (e.g., [nginx][nginx], [CDN][cdn], _et cetera_).

- While you are **strongly** encouraged to **vendor** bundles and host with a [CDN][cdn]/provider which can provide availability **guarantees**, especially for production applications, bundles are available via [unpkg][unpkg] for quick demos, proof-of-concepts, and instructional material. For example,

```html
<script type="text/javascript" src="https://unpkg.com/@stdlib/dist-flat"></script>
```

Please be mindful that [unpkg][unpkg] is a free, best-effort service relying on donated infrastructure which does **not** provide **any** availability guarantees. Under **no** circumstances should you **abuse** or **misuse** the service. You have been **warned**.

- If you intend on embedding a standalone bundle **within** another bundle, you may need to rename `require` calls within the standalone bundle **before** bundling in order to maintain scoped module resolution. For example, if you plan on using [browserify][browserify] to generate a bundle containing embedded bundles, [browserify][browserify] plugins exist to "de-require" those bundles prior to bundling.

</section>

<!-- /.notes -->
Expand All @@ -106,22 +52,6 @@ If no recognized module system is present, access bundle contents via the global

<section class="links">

[umd]: https://github.com/umdjs/umd

[gzip]: https://en.wikipedia.org/wiki/Gzip

[nginx]: http://nginx.org/en/docs/

[cdn]: https://en.wikipedia.org/wiki/Content_delivery_network

[unpkg]: https://unpkg.com/#/

[browserify]: https://github.com/browserify/browserify

[stdlib]: https://github.com/stdlib-js/stdlib

[@stdlib/namespace]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/namespace

</section>

<!-- /.links -->
176 changes: 0 additions & 176 deletions dist/datasets-cmudict/LICENSE

This file was deleted.

Loading

0 comments on commit 7b9022a

Please sign in to comment.