Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore ability to use console.log in vite #2233

Merged
merged 2 commits into from
Jan 16, 2024
Merged

Conversation

twk3
Copy link
Contributor

@twk3 twk3 commented Jan 15, 2024

  • 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.

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

netlify bot commented Jan 15, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit b03c670
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/65a57f89848cb50008030aa5
😎 Deploy Preview https://deploy-preview-2233.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

github-actions bot commented Jan 15, 2024

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
10 5.08 MB → 5.08 MB (+722 B) +0.01%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/platform/exceptions/index.browser.ts 📈 +35 B (+36.84%) 95 B → 130 B
src/components/manager/subscribe/common.tsx 📈 +58 B (+3.38%) 1.67 kB → 1.73 kB
src/components/settings/Export.tsx 📈 +57 B (+2.58%) 2.16 kB → 2.21 kB
home/runner/work/actual/actual/packages/loot-core/src/client/shared-listeners.ts 📈 +144 B (+1.93%) 7.3 kB → 7.44 kB
src/components/App.tsx 📈 +71 B (+1.59%) 4.37 kB → 4.44 kB
src/components/Notifications.tsx 📈 +96 B (+1.51%) 6.2 kB → 6.29 kB
src/components/reports/spreadsheets/sankey-spreadsheet.ts 📈 +63 B (+1.22%) 5.04 kB → 5.1 kB
src/components/tooltips.tsx 📈 +95 B (+1.17%) 7.93 kB → 8.02 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/transactions.ts 📈 +47 B (+0.73%) 6.25 kB → 6.3 kB
src/components/Modals.tsx 📈 +47 B (+0.57%) 8.08 kB → 8.13 kB
package.json 📈 +9 B (+0.33%) 2.68 kB → 2.69 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 2.63 MB → 2.63 MB (+659 B) +0.02%
static/js/ReportRouter.js 1.95 MB → 1.95 MB (+63 B) +0.00%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/ButtonLink.js 379 B 0%
static/js/FiltersMenu.js 28.92 kB 0%
static/js/BalanceTooltip.js 6.07 kB 0%
static/js/narrow.js 82.17 kB 0%
static/js/wide.js 238.99 kB 0%

Copy link
Contributor

github-actions bot commented Jan 15, 2024

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
1 1.23 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1.23 MB 0%

@twk3 twk3 merged commit 7d1a895 into master Jan 16, 2024
19 checks passed
@twk3 twk3 deleted the twk3/vite-restore-console branch January 16, 2024 17:40
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Jan 16, 2024
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
Restore ability to use console.log in vite

- Swap our swc plugin to remove-react-properties
- Configure remove-react-properties to preserve our testids
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants