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(vite): Change config for mantine and chakra to use export default #8639

Merged
merged 7 commits into from
Jun 20, 2023

Conversation

dac09
Copy link
Collaborator

@dac09 dac09 commented Jun 16, 2023

This fixes the templates for Chakra UI and Mantine, to avoid using module.exports which is not supported in Vite (because its commonjs)

Note: not changing tailwind because tailwind is used differently. I think it was incorrect for us to place mantine and chakra config in the config folder - because it's actually imported in the app (it's a source file, not config), where as tailwind is not.


For release notes (existing users):
If you're using Chakra or Mantine, you will need to update how these libraries are configured. You might see this error in your browser console:

Uncaught ReferenceError: module is not defined

To fix this you'll need to make sure you're not using module.exports in your web/config/mantine.config.js or web/config/chakra.config.js.

Codemod available:

npx @redwoodjs/codemods@canary update-theme-config

Manual steps:
The change is simple:

// This is common JS lets get rid of it!
- module.exports = {/**....your theme **/}
+ const theme = {/**....your theme **/}
+ export default theme

@dac09 dac09 requested a review from thedavidprice June 16, 2023 11:05
@dac09
Copy link
Collaborator Author

dac09 commented Jun 16, 2023

@thedavidprice want to try this out in your branch? Simple change :)

@dac09 dac09 added release:fix This PR is a fix fixture-ok Override the test project fixture check labels Jun 16, 2023
Copy link
Contributor

@thedavidprice thedavidprice left a comment

Choose a reason for hiding this comment

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

Test QA for both chakra and mantine is ✅

Note: I did not do QA on codemod — leaving that to you.

Thanks! 🚀

@dac09 dac09 enabled auto-merge (squash) June 20, 2023 04:41
@dac09 dac09 merged commit 1ccf612 into redwoodjs:main Jun 20, 2023
28 checks passed
@redwoodjs-bot redwoodjs-bot bot added this to the next-release milestone Jun 20, 2023
dac09 added a commit to dac09/redwood that referenced this pull request Jun 21, 2023
…redwood into codemod/replace-svg-as-components

* 'codemod/replace-svg-as-components' of github.com:dac09/redwood:
  chore(deps): update react monorepo (redwoodjs#8677)
  chore(deps): update dependency postcss to v8.4.24 (redwoodjs#8675)
  chore(deps): update dependency esbuild to v0.18.6 (redwoodjs#8670)
  chore(deps): update dependency dependency-cruiser to v13.0.4 (redwoodjs#8674)
  chore(deps): update dependency autoprefixer to v10.4.14 (redwoodjs#8668)
  chore(deps): update dependency @clerk/clerk-react to v4.20.5 (redwoodjs#8672)
  Fix typos in documentation (redwoodjs#8659)
  fix(docs): Fix & make verifyOwnership consistent (redwoodjs#8596)
  chore(deps): update dependency vite to v4.1.5 [security] (redwoodjs#8671)
  fix(deps): update dependency react-hook-form to v7.45.0 (redwoodjs#8664)
  chore(studio): update tremor to v3 (redwoodjs#8645)
  fix(deps): update dependency webpack to v5.87.0 (redwoodjs#8549)
  fix(deps): update dependency dotenv to v16.3.1 (redwoodjs#8663)
  chore(deps): update dependency @clerk/clerk-react to v4.20.4 (redwoodjs#8662)
  fix(vite): Change config for mantine and chakra to use export default (redwoodjs#8639)
  fix(deps): update storybook monorepo to v7.0.22 (redwoodjs#8652)
  Fix failing v5 codemod for DevFatalErrorPage (redwoodjs#8661)
@jtoar jtoar modified the milestones: next-release, v6.0.0 Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixture-ok Override the test project fixture check release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants