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

Performance: select styles optimization #13006

Merged
merged 1 commit into from
May 21, 2024
Merged

Conversation

pettinarip
Copy link
Member

@pettinarip pettinarip commented May 21, 2024

Currently, all the Select component related code is being bundled in the main _app.js file which is not good since this code is only used by 4 different pages. We should only have global used code in this bundle.

Description

This PR creates the select styles context provider in a different file to have a better bundle generation.

Before:
image

Now:
image

Summary by CodeRabbit

  • Refactor

    • Improved the structure and organization of the Select component for better maintainability.
    • Updated style provider usage to enhance styling capabilities for the Select component.
  • Style

    • Improved styling context for Select components to ensure consistent and customizable styles.
  • Chores

    • Cleaned up import statements and adjusted component structure to align with new styling context.

Copy link

netlify bot commented May 21, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 0ef8977
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/664c53c5dfbe69000853f8f4
😎 Deploy Preview https://deploy-preview-13006--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 45 (🔴 down 11 from production)
Accessibility: 92 (no change from production)
Best Practices: 89 (🔴 down 9 from production)
SEO: 93 (🔴 down 2 from production)
PWA: -
View the detailed breakdown and full score reports

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

Copy link
Contributor

Page Performance Accessibility Best practices SEO PWA
/en/ 🟠 50 🟢 94 🟢 93 🟢 93 🔴 38
/en/wallets/find-wallet/ 🟠 67 🟠 88 🟢 96 🟢 93 🔴 38
/en/staking/ 🔴 48 🟢 91 🟢 93 🟢 93 🔴 38
/en/whitepaper/ 🟠 68 🟢 95 🟢 96 🟢 93 🔴 38
/en/nft/ 🟠 57 🟢 95 🟢 96 🟢 93 🔴 38
/en/developers/docs/intro-to-ethereum/ 🟠 72 🟢 94 🟢 96 🟢 93 🔴 38
/en/developers/tutorials/creating-a-wagmi-ui-for-your-contract/ 🟠 60 🟠 88 🟢 96 🟢 93 🔴 38

Lighthouse scores are calculated based on the latest audit results

Copy link
Contributor

@minimalsm minimalsm left a comment

Choose a reason for hiding this comment

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

Preview deploy looks good. Will let someone else double-check code, but it would be good to get this in this week's deploy.

@minimalsm
Copy link
Contributor

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented May 21, 2024

Actions Performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

coderabbitai bot commented May 21, 2024

Walkthrough

The changes across the src/components/Select directory primarily involve refactoring the styling context and usage within the Select component. The main adjustments include renaming and updating imports for the styles context provider and hooks, as well as modifying the structure of the Select component to align with these updates. This ensures a more organized and consistent approach to styling within the Select component.

Changes

File Path Change Summary
src/components/Select/context.ts Introduced ReactSelectStylesProvider and useReactSelectStyles to manage styles context for React Select components.
src/components/Select/index.tsx Refactored imports and updated the usage of style providers and context, removing outdated exports.
src/components/Select/innerComponents.tsx Modified import path for useSelectStyles to import from "./context" instead of ".".

Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 18b97ac and 0ef8977.
Files selected for processing (3)
  • src/components/Select/context.ts (1 hunks)
  • src/components/Select/index.tsx (3 hunks)
  • src/components/Select/innerComponents.tsx (1 hunks)
Files skipped from review due to trivial changes (2)
  • src/components/Select/index.tsx
  • src/components/Select/innerComponents.tsx
Additional comments not posted (3)
src/components/Select/context.ts (3)

1-1: Imports are correctly used and necessary for the context creation and type definitions.

Also applies to: 3-3


5-6: Context creation for React Select styles is correctly implemented.


8-13: Exports are well-defined and type-safe. Ensure that the updated exports are correctly used in other components.


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:

Note: Auto-reply has been disabled for this repository by the repository owner. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@nhsz nhsz merged commit fbec3c4 into dev May 21, 2024
11 checks passed
@nhsz nhsz deleted the performance/select-context-module branch May 21, 2024 13:01
This was referenced May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants