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

Fix default import #313

Merged
merged 2 commits into from
Jun 19, 2024
Merged

Fix default import #313

merged 2 commits into from
Jun 19, 2024

Conversation

roppazvan
Copy link
Collaborator

@roppazvan roppazvan commented Jun 19, 2024

PR Type

Bug fix


Description

  • Fixed the import statement for mdn-data/css/properties.json to use default import in packages/graph-editor/src/registry/inputControls.tsx.

Changes walkthrough 📝

Relevant files
Bug fix
inputControls.tsx
Fix default import for `mdn-data/css/properties.json`       

packages/graph-editor/src/registry/inputControls.tsx

  • Fixed the import statement for mdn-data/css/properties.json to use
    default import.
  • +1/-1     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Copy link

    changeset-bot bot commented Jun 19, 2024

    🦋 Changeset detected

    Latest commit: 5486cac

    The changes in this PR will be included in the next version bump.

    This PR includes changesets to release 1 package
    Name Type
    @tokens-studio/graph-editor Patch

    Not sure what this means? Click here to learn what changesets are.

    Click here if you're a maintainer who wants to add another changeset to this PR

    @roppazvan roppazvan requested a review from SorsOps June 19, 2024 11:45
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review [1-5] 1
    🧪 Relevant tests No
    🔒 Security concerns No
    ⚡ Key issues to review None

    Copy link
    Contributor

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Performance
    Reduce bundle size by importing only necessary properties

    Consider using a specific import rather than importing the entire JSON module. This can
    help with reducing the bundle size if only certain properties are needed.

    packages/graph-editor/src/registry/inputControls.tsx [15]

    -import properties from 'mdn-data/css/properties.json';
    +import { margin, padding } from 'mdn-data/css/properties.json';
     
    Suggestion importance[1-10]: 4

    Why: While the suggestion to import specific properties can reduce the bundle size, it assumes that only 'margin' and 'padding' are needed, which may not be the case. The current import might be necessary if multiple properties are used.

    4

    @roppazvan roppazvan linked an issue Jun 19, 2024 that may be closed by this pull request
    @roppazvan
    Copy link
    Collaborator Author

    Screenshot 2024-06-19 at 14 58 00

    @roppazvan roppazvan merged commit f70b40d into master Jun 19, 2024
    2 checks passed
    @SorsOps SorsOps deleted the fix-mdn-import branch July 3, 2024 09:33
    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.

    CSS Map and CSS Function do not loading the props from MDN
    2 participants