[SDC-32633] Document Web SDK UMD builds#403
Open
anthonypenna wants to merge 1 commit into
Open
Conversation
| A classic `<script>` (unlike `<script type="module">`) does not support top-level `await`, so wrap the setup code in an async function as shown below. | ||
| ::: | ||
|
|
||
| ### Complete UMD Example |
Member
There was a problem hiding this comment.
Can't we just keep the interesting part in this section? a complete example seems superfluous and gives a lot of space to UMD in this page.
|
|
||
| ## Install via UMD build (plain `<script>` tags) | ||
|
|
||
| Alongside the ES module (ESM) build, every Scandit package ships a [UMD](https://github.com/umdjs/umd) build. This lets you load the SDK with plain `<script>` tags, without a bundler or an [import map](#install-via-cdn). Each package exposes its exports on a browser global: |
Member
There was a problem hiding this comment.
We should mention that using UMD leads to longer startup time because of larger files to download (it cannot be optimised like a bundle consuming our ES modules), so it should only be used when ES module is not possible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an "Install via UMD build" section to the Web SDK installation page, covering how to load the SDK from plain
<script>tags via browser globals, without a bundler — complementing the existing npm and ESM/CDN options.Tested locally with
yarn build.Note for reviewers: the UMD build ships in 8.6.0 (SDC-31903, fix version
8.6.0-beta.1). It is not in 8.5.x — verified not cherry-picked torelease/8.5— so the/umdCDN paths in the example won't resolve until 8.6.0 is released. Please don't publish this page before the 8.6.0 release.Closes SDC-32633