# WasmElement

Class · extends [`AsyncElement`](https://api.playcanvas.com/web-components/classes/AsyncElement.md) · category: Resources

Source: https://github.com/playcanvas/web-components/blob/252f001881302c266c8d727044408c32be2bb5e7/src/wasm.ts#L33

The WasmElement interface provides properties and methods for manipulating
[`<pc-wasm>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-wasm/)
elements. The WasmElement interface also inherits the properties and methods of the
[AsyncElement](https://api.playcanvas.com/web-components/classes/AsyncElement.md) interface.

The attributes are read once, when the module starts loading - on the element's first
connection, or earlier if a containing `<pc-app>` boots first and collects it - so changing
them later has no effect. The element becomes ready once the module has loaded. WebAssembly
modules configure engine-global state that never unloads, so readiness is not re-armed by
removing the element, and a re-inserted element does not load again.

A `<pc-wasm>` without a `name` warns and never becomes ready; a containing `<pc-app>` still
boots.

**elementSummary** The `<pc-wasm>` element loads a WebAssembly module the engine needs before the
application starts — `Ammo` for physics, `Basis` or `DracoDecoderModule` for compressed assets.
Must be a direct child of `<pc-app>`.

**attribute** name - The name of the WebAssembly module to configure, e.g. `Basis` or
`Ammo`.

**attribute** glue - The URL of the module's glue script.

**attribute** wasm - The URL of the module's WebAssembly binary.

**attribute** fallback - The URL of the module's asm.js fallback script, used when
WebAssembly is unavailable.

## Inherited from [AsyncElement](https://api.playcanvas.com/web-components/classes/AsyncElement.md)

- `get closestApp(): AppElement | null`
- `get closestEntity(): EntityBaseElement | null`
- `protected _onReady(): void`
- `protected _resetReady(): void`
- `ready(): Promise<WasmElement>`
