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

@emotion/css as drop-in replacement for abandoned glamor library #3471

Merged
merged 25 commits into from
Oct 18, 2024

Conversation

joel-jeremy
Copy link
Contributor

@joel-jeremy joel-jeremy commented Sep 20, 2024

Related to #701

Actual uses glamor as it's CSS library: https://github.com/threepointone/glamor. The project has been abandoned for 7-8 years now.

This PR attampts to use EmotionJS's @emotion/css package as a drop-in replacement for glamor. Most of the APIs are the same i.e. css, cx, etc so hoping that not much breakage happens. This will need to be thoroughly tested in to ensure that.

This also serves as an opportunity to discuss about our options when modernizing the CSS library since there are lots of new developments in this space e.g. zero-runtime CSS libraries, etc.

reactwg/react-18#110

@actual-github-bot actual-github-bot bot changed the title [POC] @emotion/css as drop-in replacement for abandoned glamor library [WIP] [POC] @emotion/css as drop-in replacement for abandoned glamor library Sep 20, 2024
Copy link
Contributor

coderabbitai bot commented Sep 20, 2024

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

47 files out of 129 files are above the max files limit of 75. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Sep 20, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit f9295b7
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/6711a94b5f6ce10008e18ee4
😎 Deploy Preview https://deploy-preview-3471.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 Sep 20, 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
9 5.34 MB → 5.31 MB (-35.83 kB) -0.66%
Changeset (largest 100 files by percent change)
File Δ Size
node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js 🆕 +13.3 kB 0 B → 13.3 kB
node_modules/@emotion/serialize/dist/emotion-serialize.esm.js 🆕 +6.05 kB 0 B → 6.05 kB
node_modules/stylis/src/Parser.js 🆕 +5.33 kB 0 B → 5.33 kB
node_modules/stylis/src/Tokenizer.js 🆕 +3.99 kB 0 B → 3.99 kB
node_modules/@emotion/sheet/dist/emotion-sheet.esm.js 🆕 +3.6 kB 0 B → 3.6 kB
node_modules/@emotion/css/create-instance/dist/emotion-css-create-instance.esm.js 🆕 +3.19 kB 0 B → 3.19 kB
node_modules/stylis/src/Utility.js 🆕 +1.92 kB 0 B → 1.92 kB
node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js 🆕 +1.64 kB 0 B → 1.64 kB
node_modules/@emotion/hash/dist/emotion-hash.esm.js 🆕 +1.58 kB 0 B → 1.58 kB
node_modules/stylis/src/Serializer.js 🆕 +989 B 0 B → 989 B
node_modules/@emotion/unitless/dist/emotion-unitless.esm.js 🆕 +898 B 0 B → 898 B
node_modules/stylis/src/Middleware.js 🆕 +540 B 0 B → 540 B
node_modules/stylis/src/Enum.js 🆕 +207 B 0 B → 207 B
node_modules/@emotion/memoize/dist/emotion-memoize.esm.js 🆕 +169 B 0 B → 169 B
node_modules/@emotion/css/dist/emotion-css.esm.js 🆕 +155 B 0 B → 155 B
src/components/common/Paragraph.tsx 📈 +29 B (+11.07%) 262 B → 291 B
src/components/common/InlineField.tsx 📈 +27 B (+4.70%) 575 B → 602 B
src/components/forms.tsx 📈 +125 B (+4.57%) 2.67 kB → 2.79 kB
src/components/mobile/transactions/ListBoxSection.jsx 📈 +53 B (+3.65%) 1.42 kB → 1.47 kB
node_modules/react-dnd-html5-backend/dist/BrowserDetector.js 📈 +4 B (+3.23%) 124 B → 128 B
src/components/common/Toggle.tsx 📈 +49 B (+2.76%) 1.73 kB → 1.78 kB
src/components/settings/Format.tsx 📈 +44 B (+0.96%) 4.48 kB → 4.52 kB
src/components/settings/Themes.tsx 📈 +22 B (+0.94%) 2.29 kB → 2.31 kB
src/components/settings/UI.tsx 📈 +15 B (+0.82%) 1.79 kB → 1.8 kB
src/components/modals/ImportTransactionsModal/Transaction.tsx 📈 +68 B (+0.81%) 8.19 kB → 8.26 kB
src/components/reports/graphs/NetWorthGraph.tsx 📈 +41 B (+0.71%) 5.6 kB → 5.64 kB
src/components/common/Button.tsx 📈 +33 B (+0.69%) 4.65 kB → 4.68 kB
src/components/modals/TrackingBudgetMonthMenuModal.tsx 📈 +45 B (+0.69%) 6.41 kB → 6.45 kB
src/components/modals/EnvelopeBudgetMonthMenuModal.tsx 📈 +45 B (+0.66%) 6.71 kB → 6.75 kB
src/components/settings/index.tsx 📈 +36 B (+0.58%) 6.05 kB → 6.09 kB
node_modules/react-dnd-html5-backend/dist/utils/js_utils.js 📈 +2 B (+0.33%) 613 B → 615 B
src/components/select/DateSelect.tsx 📈 +26 B (+0.30%) 8.57 kB → 8.59 kB
package.json 📈 +8 B (+0.26%) 3.04 kB → 3.05 kB
src/components/reports/reports/MarkdownCard.tsx 📈 +6 B (+0.22%) 2.61 kB → 2.61 kB
src/components/sidebar/Sidebar.tsx 📈 +11 B (+0.18%) 6.03 kB → 6.04 kB
src/components/common/Select.tsx 📈 +4 B (+0.16%) 2.45 kB → 2.45 kB
src/components/Notes.tsx 📈 +2 B (+0.08%) 2.49 kB → 2.49 kB
src/components/sidebar/Account.tsx 📈 +2 B (+0.04%) 4.73 kB → 4.73 kB
src/components/modals/EditRuleModal.jsx 📈 +11 B (+0.03%) 39.35 kB → 39.37 kB
node_modules/i18next/dist/esm/i18next.js 📈 +4 B (+0.00%) 86.37 kB → 86.37 kB
src/components/autocomplete/Autocomplete.tsx 📉 -1 B (-0.01%) 16.26 kB → 16.26 kB
node_modules/date-fns/esm/parse/index.js 📉 -2 B (-0.01%) 31.59 kB → 31.59 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/transactions.ts 📉 -2 B (-0.02%) 8.25 kB → 8.25 kB
src/components/accounts/Account.tsx 📉 -12 B (-0.03%) 43.91 kB → 43.9 kB
node_modules/@remix-run/router/dist/router.js 📉 -8 B (-0.03%) 28.41 kB → 28.4 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/util.ts 📉 -2 B (-0.03%) 6.43 kB → 6.43 kB
src/components/mobile/budget/BudgetTable.jsx 📉 -20 B (-0.04%) 53.37 kB → 53.35 kB
src/components/filters/SavedFilterMenuButton.tsx 📉 -2 B (-0.04%) 5 kB → 5 kB
src/style/styles.ts 📉 -2 B (-0.04%) 4.55 kB → 4.55 kB
src/components/budget/index.tsx 📉 -4 B (-0.04%) 8.8 kB → 8.8 kB
node_modules/yallist/yallist.js 📉 -4 B (-0.05%) 8.45 kB → 8.44 kB
src/components/common/Modal.tsx 📉 -5 B (-0.05%) 9.29 kB → 9.28 kB
src/components/modals/CreateEncryptionKeyModal.tsx 📉 -5 B (-0.06%) 8.37 kB → 8.37 kB
src/components/transactions/TransactionsTable.jsx 📉 -38 B (-0.06%) 63.57 kB → 63.53 kB
src/components/budget/tracking/TrackingBudgetComponents.tsx 📉 -8 B (-0.06%) 12.92 kB → 12.92 kB
src/components/budget/envelope/budgetsummary/BudgetSummary.tsx 📉 -5 B (-0.07%) 7.32 kB → 7.32 kB
src/components/budget/BudgetCategories.jsx 📉 -6 B (-0.07%) 8.53 kB → 8.53 kB
src/components/ManageRules.tsx 📉 -6 B (-0.07%) 8.33 kB → 8.33 kB
src/components/accounts/Balance.jsx 📉 -4 B (-0.07%) 5.43 kB → 5.43 kB
src/components/reports/graphs/BarGraph.tsx 📉 -7 B (-0.08%) 8.86 kB → 8.86 kB
src/components/reports/graphs/AreaGraph.tsx 📉 -7 B (-0.08%) 8.78 kB → 8.77 kB
node_modules/react-router-dom/dist/index.js 📉 -10 B (-0.09%) 11.35 kB → 11.34 kB
src/components/reports/graphs/SpendingGraph.tsx 📉 -7 B (-0.09%) 7.94 kB → 7.94 kB
src/components/reports/graphs/StackedBarGraph.tsx 📉 -7 B (-0.10%) 7.02 kB → 7.02 kB
src/components/Titlebar.tsx 📉 -8 B (-0.10%) 8 kB → 7.99 kB
src/components/budget/ExpenseCategory.tsx 📉 -2 B (-0.10%) 1.89 kB → 1.89 kB
node_modules/date-fns/esm/toDate/index.js 📉 -2 B (-0.10%) 1.86 kB → 1.86 kB
src/components/budget/envelope/EnvelopeBudgetComponents.tsx 📉 -16 B (-0.11%) 14.11 kB → 14.09 kB
src/components/reports/graphs/LineGraph.tsx 📉 -7 B (-0.11%) 6.17 kB → 6.16 kB
src/components/Notifications.tsx 📉 -8 B (-0.11%) 6.95 kB → 6.94 kB
src/components/common/Search.tsx 📉 -2 B (-0.12%) 1.68 kB → 1.68 kB
src/components/budget/BalanceWithCarryover.tsx 📉 -8 B (-0.12%) 6.3 kB → 6.29 kB
src/components/mobile/transactions/FocusableAmountInput.tsx 📉 -8 B (-0.13%) 5.89 kB → 5.88 kB
src/components/budget/DynamicBudgetTable.tsx 📉 -4 B (-0.14%) 2.88 kB → 2.88 kB
src/components/reports/graphs/CashFlowGraph.tsx 📉 -7 B (-0.14%) 4.92 kB → 4.91 kB
src/components/budget/ExpenseGroup.tsx 📉 -4 B (-0.16%) 2.49 kB → 2.49 kB
src/components/accounts/Header.jsx 📉 -28 B (-0.16%) 17.06 kB → 17.04 kB
src/components/budget/BudgetTable.jsx 📉 -10 B (-0.16%) 6.02 kB → 6.01 kB
src/components/budget/SidebarGroup.tsx 📉 -10 B (-0.17%) 5.64 kB → 5.63 kB
node_modules/@react-dnd/asap/dist/makeRequestCall.js 📉 -6 B (-0.17%) 3.37 kB → 3.36 kB
src/components/budget/MonthPicker.tsx 📉 -8 B (-0.18%) 4.45 kB → 4.44 kB
src/components/reports/graphs/BarLineGraph.tsx 📉 -7 B (-0.18%) 3.85 kB → 3.85 kB
src/components/common/Input.tsx 📉 -3 B (-0.18%) 1.63 kB → 1.63 kB
src/components/budget/BudgetTotals.tsx 📉 -6 B (-0.19%) 3.16 kB → 3.16 kB
src/components/common/Link.tsx 📉 -5 B (-0.19%) 2.58 kB → 2.58 kB
src/components/budget/SidebarCategory.tsx 📉 -10 B (-0.20%) 4.96 kB → 4.95 kB
src/components/autocomplete/PayeeAutocomplete.tsx 📉 -31 B (-0.20%) 14.9 kB → 14.87 kB
src/components/gocardless/GoCardlessLink.tsx 📉 -2 B (-0.22%) 909 B → 907 B
node_modules/date-fns/esm/isDate/index.js 📉 -2 B (-0.22%) 907 B → 905 B
src/components/budget/envelope/budgetsummary/ToBudgetAmount.tsx 📉 -5 B (-0.22%) 2.19 kB → 2.19 kB
src/components/table.tsx 📉 -59 B (-0.24%) 24.23 kB → 24.17 kB
src/components/schedules/index.tsx 📉 -8 B (-0.24%) 3.23 kB → 3.22 kB
src/components/accounts/Reconcile.tsx 📉 -14 B (-0.26%) 5.2 kB → 5.19 kB
src/components/budget/RenderMonths.tsx 📉 -2 B (-0.29%) 686 B → 684 B
src/components/autocomplete/CategoryAutocomplete.tsx 📉 -31 B (-0.30%) 10.18 kB → 10.15 kB
src/components/AppBackground.tsx 📉 -5 B (-0.33%) 1.46 kB → 1.46 kB
src/components/common/InfoBubble.tsx 📉 -6 B (-0.33%) 1.75 kB → 1.75 kB
node_modules/prop-types/factoryWithThrowingShims.js 📉 -6 B (-0.37%) 1.59 kB → 1.58 kB
src/components/budget/BudgetSummaries.tsx 📉 -9 B (-0.39%) 2.25 kB → 2.25 kB
src/components/AnimatedRefresh.tsx 📉 -2 B (-0.40%) 506 B → 504 B
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

Asset File Size % Changed
static/js/index.js 3.34 MB → 3.32 MB (-20.53 kB) -0.60%
static/js/wide.js 245.99 kB → 230.73 kB (-15.26 kB) -6.20%
static/js/narrow.js 82.58 kB → 82.57 kB (-20 B) -0.02%
static/js/ReportRouter.js 1.51 MB → 1.51 MB (-12 B) -0.00%
static/js/AppliedFilters.js 21.31 kB → 21.3 kB (-10 B) -0.05%

Unchanged

Asset File Size % Changed
static/js/BackgroundImage.js 122.29 kB 0%
static/js/usePreviewTransactions.js 1.64 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/resize-observer.js 18.37 kB 0%

Copy link
Contributor

github-actions bot commented Sep 20, 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.27 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.27 MB 0%

@joel-jeremy joel-jeremy force-pushed the @emotion/css branch 3 times, most recently from 1813ee4 to 335d399 Compare September 23, 2024 15:27
@joel-jeremy joel-jeremy changed the title [WIP] [POC] @emotion/css as drop-in replacement for abandoned glamor library [POC] [Need help testing] @emotion/css as drop-in replacement for abandoned glamor library Sep 23, 2024
@Jonathan-Fang
Copy link
Contributor

What does POC mean and how can I help test?

@joel-jeremy
Copy link
Contributor Author

What does POC mean and how can I help test?

@Jonathan-Fang Proof of concept :) Just testing out the app to find any styling issues as result of the change. Appreciate it! :)

@joel-jeremy joel-jeremy force-pushed the @emotion/css branch 2 times, most recently from 636090a to 0ca0cca Compare September 27, 2024 13:46
@matt-fidd
Copy link
Contributor

I've been running this a little, I've not found anything out of the ordinary, and VRT passing is a good sign

@joel-jeremy
Copy link
Contributor Author

@matt-fidd Thanks for the help testing it out! Just wanted to make sure that this I don't miss anything so I would like to have 2 or more maintainers review this.

I also wonder if Emotion JS is still the best option for us at the moment since the original decision (#701) was made a year ago. Thoughts?

@joel-jeremy joel-jeremy force-pushed the @emotion/css branch 2 times, most recently from 39813d5 to 333d119 Compare October 14, 2024 03:12
youngcw
youngcw previously approved these changes Oct 17, 2024
@joel-jeremy
Copy link
Contributor Author

@youngcw @matt-fidd I had to rebase to master. Do you mind approving again? Thanks! :)

youngcw
youngcw previously approved these changes Oct 17, 2024
Copy link
Member

@youngcw youngcw left a comment

Choose a reason for hiding this comment

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

Still seems good

matt-fidd
matt-fidd previously approved these changes Oct 17, 2024
@joel-jeremy joel-jeremy merged commit 0d9528e into master Oct 18, 2024
20 checks passed
@joel-jeremy joel-jeremy deleted the @emotion/css branch October 18, 2024 00:35
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.

4 participants