File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import logging
4- from typing import Any , Mapping , cast
4+ from functools import wraps
5+ from typing import Any , Mapping , TypeVar , cast
6+ from warnings import warn
57
68from fastjsonschema import compile as compile_json_schema
79
@@ -128,6 +130,31 @@ def is_vdom(value: Any) -> bool:
128130 )
129131
130132
133+ _T = TypeVar ("_T" )
134+
135+
136+ def _help_message (func : _T ) -> _T :
137+ @wraps (func )
138+ def wrapper (* args , ** kwargs ):
139+ try :
140+ return func (* args , ** kwargs )
141+ except TypeError : # pragma: no cover
142+ warn (
143+ (
144+ "Element constructor signatures have changed! A CLI tool for "
145+ "automatically updating code to the latest API has been provided "
146+ "with this release of IDOM (e.g. 'idom update-html-usages'). For "
147+ "start a discussion if you need help transitioning to this new "
148+ "interface: https://github.com/idom-team/idom/discussions/new?category=question"
149+ ),
150+ UserWarning ,
151+ )
152+ raise
153+
154+ return wrapper
155+
156+
157+ @_help_message
131158def vdom (
132159 tag : str , * children : VdomChild , key : Key | None = None , ** attributes : Any
133160) -> VdomDict :
You can’t perform that action at this time.
0 commit comments