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 theme proxy generation performance issue #971

Merged

Conversation

YoussefHenna
Copy link
Collaborator

@YoussefHenna YoussefHenna commented Nov 20, 2024

  • After some trial and error testing in this PR and Performance tests #969, was able to pinpoint the issue to zod not being performant enough to use in the proxy generation logic (which is called everytime a theme value is used)
  • This PR keeps zod for the initial validation only (as it was intended to be used) and uses simpler util functions in the theme value proxy generation.

Important

Improves theme proxy generation performance by replacing zod with utility functions for runtime checks, retaining zod for initial validation.

  • Performance Improvement:
    • Replaces zod with utility functions isTextStyleObject and asThemeValuesObject in createThemeValuesProxy.ts for runtime checks.
    • Keeps zod for initial validation in validators.ts.
  • Refactoring:
    • Moves isTextStyleObject and asThemeValuesObject from validators.ts to utils.ts.
  • Dependencies:
    • Adds lodash.isobject to package.json for object checks.

This description was created by Ellipsis for a1ef4c1. It will automatically update as commits are pushed.

Copy link

linear bot commented Nov 20, 2024

@YoussefHenna YoussefHenna changed the title logging and prevent excessive theme changes Fix performance issues Nov 20, 2024
Copy link

Published version: @draftbit/[email protected]

Copy link

Published version: @draftbit/[email protected]

Copy link

Published version: @draftbit/[email protected]

Copy link

Published version: @draftbit/[email protected]

Copy link

Published version: @draftbit/[email protected]

Copy link

Published version: @draftbit/[email protected]

Copy link

Published version: @draftbit/[email protected]

@YoussefHenna YoussefHenna changed the title Fix performance issues Fix theme proxy generation performance issue Nov 20, 2024
@YoussefHenna YoussefHenna marked this pull request as ready for review November 20, 2024 12:09
@YoussefHenna YoussefHenna merged commit 092e234 into master Nov 20, 2024
3 checks passed
@YoussefHenna YoussefHenna deleted the youssef/p-5705-super-lag-after-recent-published-application branch November 20, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants