Skip to content

Conversation

juanpprieto
Copy link
Contributor

@juanpprieto juanpprieto commented Sep 22, 2025

Fixes #14368

Description

Preset-defined future flags were being completely ignored during configuration resolution. The bug prevented presets from enabling experimental features, which is critical functionality for third-party integrations like (Hydrogen)

Problem

The config resolution was incorrectly reading from reactRouterUserConfig.future instead of the merged userAndPresetConfigs.future at packages/react-router-dev/config/config.ts:589-599.

The merged configuration was already computed earlier (line 440-443):

let userAndPresetConfigs = mergeReactRouterConfig(
  ...presets,
  reactRouterUserConfig,
);

But the future flags resolution ignored this merged configuration entirely.

Solution

Changed all references from reactRouterUserConfig.future to userAndPresetConfigs.future to properly read from the merged configuration.

Testing

  • Added integration test in integration/vite-presets-test.ts that verifies preset future flags are properly merged
  • Test fails without the fix (all preset flags resolve to false)
  • Test passes with the fix (preset flags are correctly applied)
pnpm test:integration --grep="presets"
# 16 passed (12.9s)

Fixes a bug where future flags defined by presets were completely ignored.
The config resolution was incorrectly reading from reactRouterUserConfig.future
instead of the merged userAndPresetConfigs.future, causing all preset-defined
future flags to be lost.

This fix ensures presets can properly enable experimental features as intended
by the preset system design.

Fixes remix-run#14368
Copy link

changeset-bot bot commented Sep 22, 2025

🦋 Changeset detected

Latest commit: 8abdd99

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@react-router/dev Patch
@react-router/fs-routes Patch
@react-router/remix-routes-option-adapter Patch
create-react-router Patch
react-router Patch
react-router-dom Patch
@react-router/architect Patch
@react-router/cloudflare Patch
@react-router/express Patch
@react-router/node Patch
@react-router/serve Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rbshop
Copy link

rbshop commented Sep 23, 2025

I can't explicitly approve, but (assuming it was indeed an oversight and not a deliberate decision) this looks good to me 👍

@brophdawg11 brophdawg11 merged commit 73960be into remix-run:release-next Sep 23, 2025
12 checks passed
Copy link
Contributor

🤖 Hello there,

We just published version 7.9.2-pre.2 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Copy link
Contributor

🤖 Hello there,

We just published version 7.9.2 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants