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

refactor(tailwind): bump all projects to v4 with vite tailwind plugin #1189

Merged
merged 13 commits into from
Jan 27, 2025

Conversation

tylersayshi
Copy link
Contributor

@tylersayshi tylersayshi commented Jan 26, 2025

docs: https://tailwindcss.com/blog/tailwindcss-v4

swapped to vite plugin to improve dev perf as well per the rec from the blog post.

Copy link

vercel bot commented Jan 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
waku ✅ Ready (Inspect) Visit Preview Jan 26, 2025 10:15pm

Copy link

codesandbox-ci bot commented Jan 26, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

dai-shi pushed a commit that referenced this pull request Jan 26, 2025
it is not helpful for the purposes of the monorepo e2e test was causing
issues in upgrading tailwind for #1189 so opting to remove

the styles are not meant to be 100% accurate to the original. I just
wanted something reasonably close

---------

Co-authored-by: Tyler <[email protected]>
@tylersayshi
Copy link
Contributor Author

@dai-shi it seems like the examples work with vite.config.ts but not with the common member of unstable_viteConfig in waku.config.ts

The website seems to be having a different bug that I am investigating - weird that that wasn't there before

@dai-shi
Copy link
Owner

dai-shi commented Jan 26, 2025

but not with the common member of unstable_viteConfig in waku.config.ts

Is it for DEV or PRD? Or both?

@tylersayshi
Copy link
Contributor Author

but not with the common member of unstable_viteConfig in waku.config.ts

Is it for DEV or PRD? Or both?

both

@dai-shi
Copy link
Owner

dai-shi commented Jan 26, 2025

Now that you have tried and learned it, what do you think about #1185 approach without vite plugin? Do you think using the vite plugin is less confusing or more confusing?

@tylersayshi
Copy link
Contributor Author

tylersayshi commented Jan 26, 2025

Now that you have tried and learned it, what do you think about #1185 approach without vite plugin? Do you think using the vite plugin is less confusing or more confusing?

from a user perspective, if the vite solution works I think the complexity is equivalent

postcss.config.js or adding a vite plugin seem like the same sort of setup step to me.


I think it is worth following the tailwind recommendation of using the vite plugin for "performance and the best developer experience".

Maybe we could give an easier way to add vite plugins to waku though? this seems a bit verbose for just "add a plugin"

export default defineConfig({
  unstable_viteConfigs: {
    common: () => ({
      plugins: [tailwindcss()],
    }),
  },
});

@dai-shi
Copy link
Owner

dai-shi commented Jan 26, 2025

this seems a bit verbose for just "add a plugin"

It's still "unstable".

I think it is worth following the tailwind recommendation of using the vite plugin

I don't disagree, but we might not be ready yet.

postcss.config.js or adding a vite plugin seem like the same sort of setup step to me.

So, I'm fine with postcss.config.js for an intermediate/temporary solution. But, it's up to you.

@tylersayshi
Copy link
Contributor Author

@dai-shi i agree with all the above. I'll set it back to the postcss setup in the morning :)

@tylersayshi
Copy link
Contributor Author

@dai-shi I was able to get this working with vite.config.ts + the hack to skip css files in processModule. Everything should be ready now I think :)

Copy link
Owner

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

LGTM

We are still interested in learning why unstable_viteConfigs.common doesn't work for the tailwindcss vite plugin. For now, having vite.config.ts is fine, but we should be able to configure everything through waku.config.ts. Having two config files doesn't feel nice.

@dai-shi dai-shi merged commit 18965de into dai-shi:main Jan 27, 2025
26 checks passed
This was referenced Jan 27, 2025
@tylersayshi tylersayshi deleted the tailwind-v4 branch January 27, 2025 04:50
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