fiftyone-javascript-builder 4.5.2

JavaScript snippet builder element with bundled Mustache asset for the 51Degrees pipeline.
Documentation
[package]
name = "fiftyone-javascript-builder"
version = "4.5.2"
description = "JavaScript snippet builder element with bundled Mustache asset for the 51Degrees pipeline."
edition.workspace = true
rust-version.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true

[features]
# Minify the rendered JavaScript with the oxc toolchain (parse, minify, print).
# On by default. A minification failure falls back to the unminified template,
# so output is always served even when minification fails. Turn it off with
# `default-features = false` to drop the oxc dependency and serve unminified JS,
# which also keeps a lower minimum supported Rust version for that build.
default = ["minify"]
minify = ["dep:oxc"]
# Re-export the engines data-update service for native and on-premise consumers.
# Off by default so a default build carries no reqwest/notify and reaches
# wasm32-wasip1.
data-update = ["fiftyone-pipeline-engines/data-update"]

[dependencies]
fiftyone-pipeline-core = { version = "4.5.2", path = "../pipeline-core" }
# default-features = false drops the engines data-update service (reqwest/notify),
# which this crate never uses, so it compiles for wasm32-wasip1. Enable the
# `data-update` feature to re-export it.
fiftyone-pipeline-engines = { version = "4.5.2", path = "../pipeline-engines", default-features = false }
# The session id and sequence evidence keys excluded from the request parameters
# live in the 51Degrees-specific engines crate. Depending on it keeps those keys
# in one place rather than re-spelling them here.
fiftyone-pipeline-engines-fiftyone = { version = "4.5.2", path = "../pipeline-engines-fiftyone" }
fiftyone-json-builder = { version = "4.5.2", path = "../json-builder" }
# The bundled JavaScriptResource.mustache template is rendered by this crate's
# own small, pure-safe-Rust Mustache renderer (the `mustache` module). A
# third-party engine was previously used, but its unsafe internals corrupted the
# process heap during rendering, surfacing on Windows as an intermittent access
# violation (exit 0xC0000005) whose backtrace faults inside the heap allocator
# (RtlAllocateHeap/RtlFreeHeap). It reproduced under the rustdoc merged-doctest
# harness and was not reproduced by standalone single- or multi-threaded
# rendering. Removing it entirely eliminated the crash. The in-crate renderer
# supports exactly the constructs the template uses and produces byte-identical
# output.
# serde_json serializes the request parameters object into the template.
serde_json.workspace = true
# URL-encoding of the request parameter keys and values. percent-encoding is
# already used elsewhere in the workspace so it is reused here for a single
# resolved version.
percent-encoding = "2.3.2"

# oxc is a large, native-oriented toolchain. Restrict it to non-wasm targets so
# this crate, and the web crates that build on it, compile for wasm32-wasip1. The
# minify code is gated on the same condition and falls back to the unminified
# script on wasm.
[target.'cfg(not(target_family = "wasm"))'.dependencies]
oxc = { version = "0.136", features = ["minifier", "codegen"], optional = true }

[dev-dependencies]
# The byte-identity test reads the reference template at test time, so no extra
# crate is needed for that. serde_json is reused for asserting the parameters JSON.

[package.metadata.docs.rs]
# Build the documentation on docs.rs with every feature enabled, so the
# cloud, on-premise and optional paths are all documented.
all-features = true