test: pin cross-tier import-text behavior (22.13 compat / 24.4 fast / 26.5 native) - #397
Conversation
… 26.5 native) Claude-Session: https://claude.ai/code/session_0144KrmfsBDfzFZnHAMaH6E3
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
ℹ️ No critical issues — one doc-comment inaccuracy inline.
Reviewed changes — two version-pinned e2e tests added to version_tiers.rs, closing the tier gaps that #395's inline unit tests and host-Node integration.rs cases left uncovered.
- Pin the fast tier below 26.5 —
import_text_works_on_fast_tier_below_26_5runs against Node 24.4.0, assertingwith { type: "text" }is served by nub's ownloadTextImportshort-circuit. - Pin the native tier —
import_text_works_via_native_on_26_5runs against Node 26.5.0, asserting byte-identical output to the other tiers (proving the native-defer mechanism swap is transparent) and that theExperimentalWarningstays suppressed.
Both reuse the established run_nub_against_node helper (PATH-pinned Node, skip-if-absent) and the shared tests/fixtures/import-text fixture. Assertions match the fixture output shape, and every impl claim traces to a real symbol: --experimental-import-text injection over [26.5.0, ∞) (feature_matrix.rs, flags.rs), the additive --disable-warning=ExperimentalWarning, and the native step-aside via NATIVE_IMPORT_TEXT in preload-common.cjs. The two tests faithfully mirror the existing import_text_works_on_compat_tier.
Claude Opus | 𝕏
The salvaged test comments referenced the env-signal design from the closed #396 branch (__NUB_NATIVE_IMPORT_TEXT); the merged #395 mechanism is the NATIVE_IMPORT_TEXT feature-detect const in preload-common.cjs. Comments only. Claude-Session: https://claude.ai/code/session_01Gp4tAn3Y66MWpAdGZm9VmL
|
Shipped in v0.4.6: https://github.com/nubjs/nub/releases/tag/v0.4.6 |

Pins the cross-tier text-import (
with { type: "text" }) behavior #395 shipped, with two version-pinned e2e tests inversion_tiers.rsthat #395 lacked (it shipped inline unit tests plus the host-Node compat-tier case):loadTextImportshort-circuit; the host-Nodeintegration.rscases migrate to the native path once the host reaches >= 26.5, leaving [22.15, 26.5) otherwise uncovered.--experimental-import-text; asserts byte-identical output to the other tiers and that the experimental warning stays suppressed.Tests-only; no runtime/impl change. All 10
version_tierstests pass against main across the three real Node versions.Refs #395