emitIdentity
On this page

emitIdentity()

Function in Tooling

A stable, human-readable identity for one emit configuration.

import { emitIdentity } from 'typeshade'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

function emitIdentity(target: EmitTarget, opts?: EmitIdentityInput, m?: ModuleDecl): string

Parameters

target EmitTarget

the backend that emitted the artifact.

optsoptional EmitIdentityInput

the same options object handed to the emit call.

moptional ModuleDecl

the module that was emitted. Optional, and only meaningful when the identity describes one module’s emit. The emulateCompute marker records that the compute-to-fragment rewrite ran, and on GLSL a portable-declared compute entry runs it with no emit option, so without the module a portable module’s GLSL stamp would describe a plain emit. A stamp that covers many modules (a registry banner) omits this argument and keeps its option-only meaning.

Return value

string

a one-line identity: a readable summary, then # and a 32-bit digest of it.

Description

emitIdentity('glsl-es300') // 'glsl-es300;parens=full;fp64=float;plugins=-#…'
emitIdentity('glsl-es300', { plugins: obfuscate() })
// '…;plugins=mangle+prune-prototypes+alias-types+minify#…'

Write it beside a committed artifact (a registry banner, a manifest line, a file name) and compare it after a build. Equal stamps mean the same emit configuration produced both. Different stamps name which axis moved, because the readable half is not hashed away.

The identity covers the target, parens, fp64Flavor, emulateCompute, whether override values were pinned (and to what), and the plugin chain in order.

It does not cover a plugin’s own options: minify({ …a }) and minify({ …b }) are both minify here. A plugin that needs finer granularity sets EmitPlugin.identity, which is used in place of its name.

In the guide

See also

Source

src/core/emit-identity.ts, line 83, at commit 26de7be8

Edit this page Report a problem