Skip to content

Commit c6056fa

Browse files
authored
Create reactjs_component_from_*, deprecate export and module_from_*. (#1307)
1 parent 1455f70 commit c6056fa

File tree

4 files changed

+395
-96
lines changed

4 files changed

+395
-96
lines changed

docs/source/about/changelog.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ Unreleased
3131
- :pull:`1281` - Added type hints to ``reactpy.html`` attributes.
3232
- :pull:`1285` - Added support for nested components in web modules
3333
- :pull:`1289` - Added support for inline JavaScript as event handlers or other attributes that expect a callable via ``reactpy.types.InlineJavaScript``
34+
-:pull:`1307` - Added ``reactpy.web.reactjs_component_from_file`` to import ReactJS components from a file.
35+
-:pull:`1307` - Added ``reactpy.web.reactjs_component_from_url`` to import ReactJS components from a URL.
36+
-:pull:`1307` - Added ``reactpy.web.reactjs_component_from_string`` to import ReactJS components from a string.
3437

3538
**Changed**
3639

@@ -51,6 +54,13 @@ Unreleased
5154
- :pull:`1281` - ``reactpy.types.VdomDictConstructor`` has been renamed to ``reactpy.types.VdomConstructor``.
5255
- :pull:`1196` - Rewrite the ``event-to-object`` package to be more robust at handling properties on events.
5356

57+
**Deprecated**
58+
-:pull:`1307` - ``reactpy.web.export`` is deprecated. Use ``reactpy.web.reactjs_component_from_*`` instead.
59+
-:pull:`1307` - ``reactpy.web.module_from_file`` is deprecated. Use ``reactpy.web.reactjs_component_from_file`` instead.
60+
-:pull:`1307` - ``reactpy.web.module_from_url`` is deprecated. Use ``reactpy.web.reactjs_component_from_url`` instead.
61+
-:pull:`1307` - ``reactpy.web.module_from_string`` is deprecated. Use ``reactpy.web.reactjs_component_from_string`` instead.
62+
63+
5464
**Removed**
5565

5666
- :pull:`1255` - Removed the ability to import ``reactpy.html.*`` elements directly. You must now call ``html.*`` to access the elements.

src/reactpy/web/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@
33
module_from_file,
44
module_from_string,
55
module_from_url,
6+
reactjs_component_from_file,
7+
reactjs_component_from_string,
8+
reactjs_component_from_url,
69
)
710

811
__all__ = [
912
"export",
1013
"module_from_file",
1114
"module_from_string",
1215
"module_from_url",
16+
"reactjs_component_from_file",
17+
"reactjs_component_from_string",
18+
"reactjs_component_from_url",
1319
]

0 commit comments

Comments
 (0)