Skip to content

feat:support tailwindcss v4#3054

Merged
marvinhagemeister merged 37 commits into
freshframework:mainfrom
SisyphusZheng:patch-test
Jul 21, 2025
Merged

feat:support tailwindcss v4#3054
marvinhagemeister merged 37 commits into
freshframework:mainfrom
SisyphusZheng:patch-test

Conversation

@SisyphusZheng

@SisyphusZheng SisyphusZheng commented Jun 22, 2025

Copy link
Copy Markdown
Contributor

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

@SisyphusZheng SisyphusZheng marked this pull request as draft June 22, 2025 19:54
@SisyphusZheng SisyphusZheng marked this pull request as ready for review June 22, 2025 20:31
Comment thread plugin-tailwindcss/src/mod.ts Outdated
Comment thread deno.json
SisyphusZheng and others added 3 commits June 24, 2025 14:33
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
@SisyphusZheng SisyphusZheng requested a review from iuioiua June 24, 2025 09:06

@iuioiua iuioiua left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instances of tailwind() not being awaited still remain in the codebase. E.g. https://github.com/SisyphusZheng/fresh/blob/aac6207306cfcda2405e2761958136fb637cf470/docs/canary/examples/migration-guide.md?plain=1#L62. I suggest searching for "tailwind(".

@SisyphusZheng

Copy link
Copy Markdown
Contributor Author

Instances of tailwind() not being awaited still remain in the codebase. E.g. https://github.com/SisyphusZheng/fresh/blob/aac6207306cfcda2405e2761958136fb637cf470/docs/canary/examples/migration-guide.md?plain=1#L62. I suggest searching for "tailwind(".

thx for pointing out this issue. This is actually part of the documentation and does not affect the code. I hope the documentation can be revised later.

Of course, I will also double-check if there is any code that hasn't been actually fixed.

@iuioiua

iuioiua commented Jun 24, 2025

Copy link
Copy Markdown
Contributor

But it matters that the documentation is correct according to the implementation. Otherwise, users will be mislead on how to use tailwind().

@SisyphusZheng

SisyphusZheng commented Jun 24, 2025

Copy link
Copy Markdown
Contributor Author

But it matters that the documentation is correct according to the implementation. Otherwise, users will be mislead on how to use tailwind().

I understand the importance of this issue now and will make the modification. Thank you.

@SisyphusZheng SisyphusZheng requested a review from iuioiua June 24, 2025 16:27

@iuioiua iuioiua left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

Comment thread www/deno.json Outdated
{
"tasks": {
"start": "deno run -A --watch=static/,routes/,../src,../docs dev.ts",
"start": "deno run -A --allow-scripts --watch=static/,routes/,../src,../docs dev.ts",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is --allow-scripts required now? Genuine question. I haven't checked. If so, we should consider whether other tasks such as build need it too, including those created from the init script.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The oxide script requires --allow-script during deno install, and I can't figure out a way to avoid this warning for the time being.

@SisyphusZheng SisyphusZheng marked this pull request as draft June 25, 2025 04:41
@SisyphusZheng SisyphusZheng marked this pull request as ready for review June 25, 2025 06:10
Comment thread plugin-tailwindcss/src/types.ts Outdated
SisyphusZheng and others added 4 commits June 25, 2025 17:09
Relocates the addition of 'postcss' and '@tailwindcss/postcss' imports to the block where Tailwind-related imports are set, ensuring they are only included when Tailwind is used.
Comment thread plugin-tailwindcss/src/mod.ts Outdated
SisyphusZheng and others added 6 commits June 30, 2025 22:34
Refactored the tailwind plugin to be synchronous instead of async, updating its function signature and all usage examples and documentation accordingly. This simplifies integration and removes unnecessary awaits from code and docs.
Comment thread plugin-tailwindcss/src/mod.ts
@Anutrix Anutrix mentioned this pull request Jul 18, 2025
@iuioiua

iuioiua commented Jul 21, 2025

Copy link
Copy Markdown
Contributor

Are you able to resolve the merge conflicts? @marvinhagemeister, are you able to take a look? It seems a lot of people would love to have this added.

@marvinhagemeister

marvinhagemeister commented Jul 21, 2025

Copy link
Copy Markdown
Contributor

Resolved the merge conflicts, but it looks like the PR is not yet ready to be merged. Several aspects of the site in www are missing styling and look broken. I've followed the update instructions on this page https://tailwindcss.com/docs/upgrade-guide and applied them, but looks like there is more going on.

main:

Screenshot 2025-07-21 at 09 16 49

This PR:

Screenshot 2025-07-21 at 09 16 21

@marvinhagemeister marvinhagemeister left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, Thanks for updating the plugin! I've went ahead and updated the code in www for v4 too.

@marvinhagemeister marvinhagemeister merged commit bb23643 into freshframework:main Jul 21, 2025
7 checks passed
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.

suggestion:support tailwindcss v4 Tailwind 4

3 participants