Repository navigation
Share Tailwind v3/v4 plugin code in shared_tailwind - #7574
Open
quotentiroler wants to merge 2 commits into
Open
quotentiroler wants to merge 2 commits into
quotentiroler wants to merge 2 commits into
Conversation
tailwind_v3.py and tailwind_v4.py duplicated compile_config, add_tailwind_to_css_file, _index_of_element_that_has, pre_compile, get_frontend_development_dependencies and four of the six Constants. These now live once in shared_tailwind: TailwindConstants holds the common constants, TailwindPlugin implements pre_compile and the dependency list, and each version plugin only supplies its root style, its postcss rewrite and its packages. The v4 plugin pinned tailwindcss and @tailwindcss/postcss as two separate literals that were always bumped together; both now derive from one version string. Generated output is byte-identical to main (config, root style with and without Radix, postcss and css rewrites, dependency lists for both versions). Module-level names stay importable from tailwind_v3 and tailwind_v4. Adds a test that each plugin wires its own root-style and postcss tasks and pins its packages to one version.
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryMoves common Tailwind constants, file helpers, dependency lists, and compile tasks into
No actionable new issues or mounted-rule violations were found. No previous review threads were supplied. Tests were not run during this review. Reviews (2) · Last reviewed commit: "Keep TailwindConfig, TailwindPlugin and ..." · Reviewed by Greptile |
…version modules Before the refactor these names were imported into tailwind_v3 and tailwind_v4, so `from reflex_base.plugins.tailwind_v3 import TailwindConfig` worked. Re-import them and list them in __all__, with a test that pins the public names of both modules.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Internal refactor, no behavior change.
tailwind_v3.pyandtailwind_v4.pycarried identical copies ofcompile_config,add_tailwind_to_css_file,_index_of_element_that_has,pre_compile,get_frontend_development_dependenciesand four of their sixConstants. AGENTS.md asks to extract duplicated code into parameterized helpers, so these now live once inshared_tailwind:TailwindConstantsholds the shared constants. Each version'sConstantssubclasses it and addsVERSIONandROOT_STYLE_CONTENT.TailwindPluginimplementspre_compileand the dependency list. A version plugin supplies only its root style, its postcss rewrite and its packages.tailwindcss@4.3.0and@tailwindcss/postcss@4.3.0as two literals that were always bumped together. Both now come from one version string.Verification:
compile_config,compile_root_style,add_tailwind_to_css_file,add_tailwind_to_postcss_config,Constants) stay importable fromtailwind_v3andtailwind_v4.Includes a
miscnews fragment for reflex-base.