Skip to content

test: pin cross-tier import-text behavior (22.13 compat / 24.4 fast / 26.5 native) - #397

Merged
colinhacks merged 3 commits into
mainfrom
import-text-e2e-tests
Jul 9, 2026
Merged

test: pin cross-tier import-text behavior (22.13 compat / 24.4 fast / 26.5 native)#397
colinhacks merged 3 commits into
mainfrom
import-text-e2e-tests

Conversation

@colinhacks

Copy link
Copy Markdown
Contributor

Pins the cross-tier text-import (with { type: "text" }) behavior #395 shipped, with two version-pinned e2e tests in version_tiers.rs that #395 lacked (it shipped inline unit tests plus the host-Node compat-tier case):

  • Node 24.4.0 (fast tier below 26.5) — served by nub's own loadTextImport short-circuit; the host-Node integration.rs cases migrate to the native path once the host reaches >= 26.5, leaving [22.15, 26.5) otherwise uncovered.
  • Node 26.5.0 (native) — deferred to Node's --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_tiers tests pass against main across the three real Node versions.

Refs #395

Copilot AI review requested due to automatic review settings July 9, 2026 18:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nub Ready Ready Preview, Comment Jul 9, 2026 8:34pm

Request Review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ 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.5import_text_works_on_fast_tier_below_26_5 runs against Node 24.4.0, asserting with { type: "text" } is served by nub's own loadTextImport short-circuit.
  • Pin the native tierimport_text_works_via_native_on_26_5 runs against Node 26.5.0, asserting byte-identical output to the other tiers (proving the native-defer mechanism swap is transparent) and that the ExperimentalWarning stays 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.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Claude Opus𝕏

Comment thread crates/nub-cli/tests/version_tiers.rs Outdated
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
@colinhacks
colinhacks merged commit 4737b12 into main Jul 9, 2026
48 checks passed
@colinhacks

Copy link
Copy Markdown
Contributor Author

Shipped in v0.4.6: https://github.com/nubjs/nub/releases/tag/v0.4.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants