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

Upgrades theme-ui to the latest version #82

Closed
wants to merge 4 commits into from

Conversation

cmaycumber
Copy link
Contributor

@cmaycumber cmaycumber commented Apr 6, 2021

Upgrades theme-ui to the latest version.

Solves: #68

  • Upgrade packages
  • Solve all breaking changes
  • Testing

@nandorojo
Copy link
Owner

Some breaking changes I've found:

Will list more that I find outside of the changelog.

@nandorojo
Copy link
Owner

Here's a thought:

Could we detach fully from theme-ui? It's only used for 2 things:

  1. TS types (for sx, SxProps, etc.)
  2. Context (ThemeProvider, and hook for getting the theme)

For 1, could push a breaking change, that requires users to use ThemeProvider from theme-ui separately if they're using theme-ui's jsx pragma directly in web files.

For 2, we could just have a DripsyThemeContext. Since we already export the hook as useDripsyTheme, we can easily just return the theme prop there.

I also noticed that ThemeProvider is triggering re-renders, even though my theme is declared outside of render code. No idea why that is, might be a theme-ui bug.

This way, we'd only need theme-ui as a dependency for TS types.

I've been a bit disillusioned that theme-ui still hasn't added strict type support after years. By decoupling, we could add more features ourselves.

@cmaycumber
Copy link
Contributor Author

Here's a thought:

Could we detach fully from theme-ui? It's only used for 2 things:

  1. TS types (for sx, SxProps, etc.)
  2. Context (ThemeProvider, and hook for getting the theme)

For 1, could push a breaking change, that requires users to use ThemeProvider from theme-ui separately if they're using theme-ui's jsx pragma directly in web files.

For 2, we could just have a DripsyThemeContext. Since we already export the hook as useDripsyTheme, we can easily just return the theme prop there.

I also noticed that ThemeProvider is triggering re-renders, even though my theme is declared outside of render code. No idea why that is, might be a theme-ui bug.

This way, we'd only need theme-ui as a dependency for TS types.

I've been a bit disillusioned that theme-ui still hasn't added strict type support after years. By decoupling, we could add more features ourselves.

I'm interested in this change as well. Should we just close this PR and try to open one that's more in line with this approach?

@nandorojo
Copy link
Owner

Yeah I think that makes sense

@nandorojo
Copy link
Owner

Once we do "detach" from theme UI, this would be my favorite feature to implement: system-ui/theme-ui#1090

I wonder if we could cherry pick some of the logic from that PR into Dripsy. One goal would be to keep it simpler. There would be no magic styles when creating the theme itself; only on the actual sx prop. I want to see auto completes for colors and such as I type them.

Also relevant to #72

@cmaycumber
Copy link
Contributor Author

Once we do "detach" from theme UI, this would be my favorite feature to implement: system-ui/theme-ui#1090

I wonder if we could cherry pick some of the logic from that PR into Dripsy. One goal would be to keep it simpler. There would be no magic styles when creating the theme itself; only on the actual sx prop. I want to see auto completes for colors and such as I type them.

Also relevant to #72

Yeah, that would be awesome. Going to close this now.

@cmaycumber cmaycumber closed this Aug 25, 2021
@cmaycumber
Copy link
Contributor Author

Here's a thought:

Could we detach fully from theme-ui? It's only used for 2 things:

  1. TS types (for sx, SxProps, etc.)
  2. Context (ThemeProvider, and hook for getting the theme)

For 1, could push a breaking change, that requires users to use ThemeProvider from theme-ui separately if they're using theme-ui's jsx pragma directly in web files.

For 2, we could just have a DripsyThemeContext. Since we already export the hook as useDripsyTheme, we can easily just return the theme prop there.

I also noticed that ThemeProvider is triggering re-renders, even though my theme is declared outside of render code. No idea why that is, might be a theme-ui bug.

This way, we'd only need theme-ui as a dependency for TS types.

I've been a bit disillusioned that theme-ui still hasn't added strict type support after years. By decoupling, we could add more features ourselves.

If I start on this, do you have any direction you want to take? Should we try to mock the latest API used by theme-ui or just start replacing each piece of the current API we're using with theme-ui with internal code?

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.

2 participants