[PR #2233] [MERGED] Restore ability to use console.log in vite #4194

Closed
opened 2026-02-28 20:52:52 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/2233
Author: @twk3
Created: 1/15/2024
Status: Merged
Merged: 1/16/2024
Merged by: @twk3

Base: masterHead: twk3/vite-restore-console


📝 Commits (2)

  • e1897ab Restore ability to use console.log in vite
  • b03c670 Add changelog

📊 Changes

4 files changed (+18 additions, -7 deletions)

View changed files

📝 packages/desktop-client/package.json (+1 -1)
📝 packages/desktop-client/vite.config.mts (+6 -1)
upcoming-release-notes/2233.md (+6 -0)
📝 yarn.lock (+5 -5)

📄 Description

  • Swap our swc plugin to remove-react-properties
  • Configure remove-react-properties to preserve our testids

We need to pass a swc-plugin in order for swc to be used during build (using it at build matches what we did for webpack prior to vite), otherwise it only gets used for the dev server. The remove console plugin was doing what it promised! (I had misread it's config when I added it, and thought I had effectively disabled it by passing an empty config).

The plugins we have to choose from are here: https://github.com/swc-project/plugins/tree/main/packages

I don't think any of them are necessary for actual at this time, so I choose the remove react properties plugin. I had to configure it a bit with some property, otherwise it will strip out all our data-testids by default. So now it strips out any use of data-debug. Which we haven't used to-date.


🔄 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/2233 **Author:** [@twk3](https://github.com/twk3) **Created:** 1/15/2024 **Status:** ✅ Merged **Merged:** 1/16/2024 **Merged by:** [@twk3](https://github.com/twk3) **Base:** `master` ← **Head:** `twk3/vite-restore-console` --- ### 📝 Commits (2) - [`e1897ab`](https://github.com/actualbudget/actual/commit/e1897ab2ad255d8473353c5380388f8b0e8eb6ee) Restore ability to use console.log in vite - [`b03c670`](https://github.com/actualbudget/actual/commit/b03c670f233c2fd30639a7bf1a54706ad35cda37) Add changelog ### 📊 Changes **4 files changed** (+18 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/package.json` (+1 -1) 📝 `packages/desktop-client/vite.config.mts` (+6 -1) ➕ `upcoming-release-notes/2233.md` (+6 -0) 📝 `yarn.lock` (+5 -5) </details> ### 📄 Description - Swap our swc plugin to remove-react-properties - Configure remove-react-properties to preserve our testids We need to pass a swc-plugin in order for swc to be used during build (using it at build matches what we did for webpack prior to vite), otherwise it only gets used for the dev server. The remove console plugin was doing what it promised! (I had misread it's config when I added it, and thought I had effectively disabled it by passing an empty config). The plugins we have to choose from are here: https://github.com/swc-project/plugins/tree/main/packages I don't think any of them are necessary for actual at this time, so I choose the remove react properties plugin. I had to configure it a bit with some property, otherwise it will strip out all our data-testids by default. So now it strips out any use of `data-debug`. Which we haven't used to-date. --- <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-02-28 20:52:52 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#4194