[PR #5853] [MERGED] Fix React compiler behaviour in dev mode #32090

Closed
opened 2026-04-18 08:12:31 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/5853
Author: @jfdoming
Created: 10/5/2025
Status: Merged
Merged: 10/5/2025
Merged by: @jfdoming

Base: masterHead: jfdoming/fix-react-compiler-dev-mode


📝 Commits (3)

📊 Changes

2 files changed (+8 additions, -2 deletions)

View changed files

📝 packages/desktop-client/vite.config.mts (+2 -2)
upcoming-release-notes/5853.md (+6 -0)

📄 Description

Fix an extremely strange behaviour of the React Compiler plugin in dev mode, which unfortunately I still do not fully understand. Essentially, when the plugin is passed in as an object (rather than a string), and only in that case, the dev server (but not the production build) converts the following snippet (note that the exact whitespace in the snippet is significant):

const Test = () => {
  return (
    <div>
      Space? {1}
    </div>
  );
};

To:

Space?1

Whereas the correct output is:

Space? 1

I think this has something to do with the order that plugins are resolved in dev mattering for source code transformation. If you inspect the generated output Javascript, it looks something like children: ["Space?", 1] without this change and children: ["Space? ", 1] with this change. (In builds, it always looks like children: ["Space? ", 1].)

This likely also relates to https://github.com/facebook/react/issues/29099, although we are running a plugin version with the fix mentioned.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/5853 **Author:** [@jfdoming](https://github.com/jfdoming) **Created:** 10/5/2025 **Status:** ✅ Merged **Merged:** 10/5/2025 **Merged by:** [@jfdoming](https://github.com/jfdoming) **Base:** `master` ← **Head:** `jfdoming/fix-react-compiler-dev-mode` --- ### 📝 Commits (3) - [`51952a9`](https://github.com/actualbudget/actual/commit/51952a98834a017bf2156756ac4d0a63f5eb5beb) Fix React compiler behaviour in dev mode - [`5765cbf`](https://github.com/actualbudget/actual/commit/5765cbf8abfc5106ad31a2257dca2dedbe5dd448) Add release notes - [`5bddbb1`](https://github.com/actualbudget/actual/commit/5bddbb133b76b2ead5128f43b04f068ed6f8033f) Add comment ### 📊 Changes **2 files changed** (+8 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/vite.config.mts` (+2 -2) ➕ `upcoming-release-notes/5853.md` (+6 -0) </details> ### 📄 Description Fix an extremely strange behaviour of the React Compiler plugin in dev mode, which unfortunately I still do not fully understand. Essentially, when the plugin is passed in as an object (rather than a string), and _only_ in that case, the dev server (but not the production build) converts the following snippet (note that the exact whitespace in the snippet is significant): ```tsx const Test = () => { return ( <div> Space? {1} </div> ); }; ``` To: ``` Space?1 ``` Whereas the correct output is: ``` Space? 1 ``` I think this has something to do with the order that plugins are resolved in dev mattering for source code transformation. If you inspect the generated output Javascript, it looks something like `children: ["Space?", 1]` without this change and `children: ["Space? ", 1]` with this change. (In builds, it always looks like `children: ["Space? ", 1]`.) This likely also relates to https://github.com/facebook/react/issues/29099, although we are running a plugin version with the fix mentioned. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-18 08:12:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#32090