Skip to content

Commit 5212fbd

Browse files
committed
deprecate inferring tailwind
1 parent 06b125e commit 5212fbd

6 files changed

Lines changed: 14 additions & 5 deletions

File tree

pyi_hashes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"reflex/__init__.pyi": "8a6d2350e96659846436792a5c7b772b",
2+
"reflex/__init__.pyi": "d7767c4fe815246a4409359da60aac25",
33
"reflex/components/__init__.pyi": "76ba0a12cd3a7ba5ab6341a3ae81551f",
44
"reflex/components/base/__init__.pyi": "e9aaf47be1e1977eacee97b880c8f7de",
55
"reflex/components/base/app_wrap.pyi": "387fc7a0c2da8760d9449e2893e44eec",

reflex/.templates/jinja/app/rxconfig.py.jinja2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ import reflex as rx
22

33
config = rx.Config(
44
app_name="{{ app_name }}",
5+
plugins=[rx.plugins.TailwindV3Plugin()],
56
)

reflex/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@
361361
"vars",
362362
"config",
363363
"compiler",
364+
"plugins",
364365
}
365366
_SUBMOD_ATTRS: dict = _MAPPING
366367
getattr, __dir__, __all__ = lazy_loader.attach(

reflex/config.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
from reflex import constants
3535
from reflex.base import Base
3636
from reflex.constants.base import LogLevel
37-
from reflex.plugins.base import Plugin
38-
from reflex.plugins.tailwind_v3 import TailwindV3Plugin
37+
from reflex.plugins import Plugin, TailwindV3Plugin
3938
from reflex.utils import console
4039
from reflex.utils.exceptions import ConfigError, EnvironmentVarValueError
4140
from reflex.utils.types import (
@@ -923,6 +922,13 @@ def __init__(self, *args, **kwargs):
923922
self._replace_defaults(**kwargs)
924923

925924
if self.tailwind is not None:
925+
console.deprecate(
926+
"Inferring tailwind usage",
927+
reason="Either set `tailwind` to `None` if you are not using tailwind, or add `rx.plugins.TailwindV3Plugin()` to the `plugins=[]` in rxconfig.py to be able to use it.",
928+
deprecation_version="0.7.10",
929+
removal_version="0.8.0",
930+
dedupe=True,
931+
)
926932
self.plugins.append(TailwindV3Plugin())
927933

928934
if (

reflex/plugins/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
from .base import CommonContext as CommonContext
44
from .base import Plugin as Plugin
55
from .base import PreCompileContext as PreCompileContext
6+
from .tailwind_v3 import Plugin as TailwindV3Plugin

reflex/plugins/tailwind_v3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pathlib import Path
44
from types import SimpleNamespace
55

6-
from reflex.plugins.base import Plugin
6+
from reflex.plugins.base import Plugin as PluginBase
77
from reflex.utils.decorator import once
88

99

@@ -191,7 +191,7 @@ def add_tailwind_to_postcss_config():
191191
return str(postcss_file), "\n".join(postcss_file_lines)
192192

193193

194-
class TailwindV3Plugin(Plugin):
194+
class Plugin(PluginBase):
195195
"""Plugin for Tailwind CSS."""
196196

197197
def get_frontend_development_dependencies(self, **context) -> list[str]:

0 commit comments

Comments
 (0)