feat: update the tailwind plugin to suuport tailwindv4 #2819#2903
feat: update the tailwind plugin to suuport tailwindv4 #2819#2903marvinhagemeister merged 33 commits intodenoland:mainfrom
Conversation
|
hello there, I attempted to make the plugin-tailwind support tailwind version 4 based on #2819, #2829, and https://github.com/pakornv/fresh-plugin-tailwind. It worked properly under the condition of "nodeModulesDir": "auto", and the "/www" functioned normally after the modification. However, when I tried to remove the support for node_modules, I encountered a situation where @tailwindcss/oxide (the new engine of Tailwind v4, written in Rust) didn't provide support. Due to the breaking changes in version 4, the new @tailwindcss/postcss will attempt to call @tailwindcss/oxide, and it currently seems that this issue cannot be easily resolved (it appears so). |
|
Personally, I'm good with requiring |
|
No need to close the PR. Would've loved to get this in |
I'm encountering too many file conflicts in this old branch and dealing with this issue for the time being. Thank you for your support. |
What This PR SolvesMajor Updates1. Dependency Optimization
2. Build Configuration Adjustments
3. Code Adaptation
4. Feature Restoration
How Testing Was ConductedLocal Environment Testing
rm -rf ./.cache/deno deno.lock node_modules
deno task www
Code Inspection
Current IssuesPending Issues
|
|
--patch-3 |
|
--patch-4
Meanwhile, I encountered the same problem as issue #2973 during the project upgrade to V2. The buttons don't seem to work, and currently, I'm not sure what's causing this problem. --patch 5 |
marvinhagemeister
left a comment
There was a problem hiding this comment.
LGTM, thanks for doing this, this is great!
|
Had to revert in #2988 because the styles on fresh.deno.dev were somehow missing. Not sure yet why. |
Sorry this happened😟. I checked plugins, local environment and codespace—styles are fine. Tried deploying fork to Deno Deploy, but it’s slow and affects PR. Not sure if there are other issues. I’ll track progress and hope to be kept informed. Thanks for your help. |
|
Na no worries, it isn't your fault. My suspicion is that something with |
When can I get it? I am currently encountering an error using Tailwind CSS 4 |
You encountered this information when using Tailwind v4 because the change brought by this Feat was reverted. Currently, it seems there are issues with the Esbuild Loader and NodeModules, and further fixes and attempts are still needed. However, for now, you can try the plugin by @pakornv: https://github.com/pakornv/fresh-plugin-tailwindcss. Based on this, I also provide a template initialization project for Fresh V2 with Tailwind v4 that is closer to this PR and the corresponding modifications plugin: https://github.com/SisyphusZheng/fresh-project-test/tree/main/fresh-tailwindv4-template. |
update /www and tailwind-plugin to support tailwind v4. Thanks to the merge of #3034, the work of integrating and advancing #2903 is promoted. related #3034 related #2903 close #3056 close #2819 --patch-1 based on review, 1. del compiler and make it more clean and simple, 2. fix init tailwind part, 3. fix test tailwind part --patch-2 1. fix the docs 2. fix the docs of plugin and version --patch-3 1. Addressed various maintenance tasks (chores) 2. Updated the Tailwind CSS plugin to align with this release. Generated a fresh project using the updated init configuration and 3. deployed it via Deno Deploy EA. Deployment is functioning correctly. --patch-4 Move postcss imports to Tailwind section in init script --patch-5 Refactored Tailwind plugin type definitions by copying PluginOptions properties from @tailwindcss/postcss and adding Fresh-specific exclude option, while exporting types from package entrypoint for better accessibility. Test Project: https://fresh.fresh-press.deno.net/ Test Project Repository: https://github.com/SisyphusZheng/fresh-tailwindv4 Test Plugin: https://jsr.io/@freshpress/fresh-plugin-tailwind@1.0.0 --------- Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com> Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com> Co-authored-by: Marvin Hagemeister <marvin@deno.com>

Inspired by #2819, #2829, and https://github.com/pakornv/fresh-plugin-tailwindcss, I made minimal modifications to the plugin-tailwind, I originally intended to update based on #2829, but I was informed by the system that I couldn't push.
Due to the breaking changes in Tailwind v4, some PostCSS plugins are no longer required. Additionally, I updated the syntax in the /www directory. The /www directory now uses the updated plugin supported by Tailwind v4.I think this has made initial progress.
What This PR Solves
The Tailwind plugin has been updated to support Tailwind v4, and it is currently functioning well both in the repository's www directory and in the initialized project which for test.
--patch-1
1. Dependency Optimization
cssnanodependency, using Tailwind v4's built-in optimization(Based on @csvn 's suggestion)autoprefixerdependencytailwind-pluginversion number2. Build Configuration Adjustments
--node-modules-dirparameter to/wwwtask for Tailwind v4 support (Based on @marvinhagemeister 's suggestion)--allow-scriptsparameter to enable@tailwindcss/oxideexecution3. Code Adaptation
/wwwto support Tailwind v4deno.json4. Feature Restoration
imagescriptandastraldependencies to restore screenshot functionality lost in previous PR updatestailwind-plugindependency was incorrectly pointing to the JSR package instead of the local repository source code in previous PR.--patch-2
@import "tailwindcss", and generate the new plugin format.cssto match/tailwindcss/instead of/@tailwind/.Co-authored-by: Asher Gomez ashersaupingomez@gmail.com
--patch-3
Addressing @marvinhagemeister feedback, this patch reverts the unintended loss of PR #2960's changes caused by merge conflicts.
--patch-4
I initialized a project according to the migration documentation and used @fresh/update to test whether the plugin works properly with v2-alpha-34. The results show that it works fine.
The plugin is published at jsr:@freshpress/fresh-plugin-tailwind@0.0.1-alpha.8.
The test project is published at https://github.com/SisyphusZheng/fresh-project-test/tree/main/fresh-project.
--patch-5
As plugin, work fine with fresh v2 proj, can check: fresh-tailwindv4-template
How Testing Was Conducted
Local Environment Testing
/wwwenvironmentCodespace Environment Testing
https://silver-trout-pjr4jw7xx5x9299x6-8000.app.github.dev/
As plugin for New Fresh v2 proj Environment Testing