Skip to content

Commit 7f6ee8a

Browse files
author
Alessio Civitillo
committed
Merge branch 'main' of https://github.com/acivitillo/idom
2 parents e0fb5e0 + 1527290 commit 7f6ee8a

File tree

28 files changed

+702
-473
lines changed

28 files changed

+702
-473
lines changed

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
recursive-include src/idom/client *
22
recursive-include src/idom/web/templates *
3+
include src/idom/py.typed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.34.0
1+
0.35.1

docs/source/creating-interfaces/rendering-data.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ see the server log a bunch of errors that look something like:
116116

117117
.. code-block:: text
118118
119-
Key not specified for dynamic child {'tagName': 'li', 'children': ['Do some coding']}
119+
Key not specified for child in list {'tagName': 'li', 'children': ...}
120120
121-
What this is telling you is that we haven't specified a unique ``key`` for each of the
121+
What this is telling us is that we haven't specified a unique ``key`` for each of the
122122
items in our todo list. In order to silence this warning we need to expand our data
123123
structure even further to include a unique ID for each item in our todo list:
124124

docs/source/developing-idom/changelog.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,59 @@
11
Changelog
22
=========
33

4+
The IDOM team manages their short and long term plans with `GitHub Projects
5+
<https://github.com/orgs/idom-team/projects/1>`__. If you have questions about what the
6+
team are working on, or have feedback on how issues should be prioritized, feel free to
7+
:discussion-type:`open up a discussion <question>`.
8+
9+
10+
0.35.1
11+
------
12+
13+
Re-add accidentally deleted ``py.typed`` file to distribution. See `PEP-561
14+
<https://www.python.org/dev/peps/pep-0561/#packaging-type-information>`__ for info on
15+
this marker file.
16+
17+
18+
0.35.0
19+
------
20+
21+
The highlight of this release is that the default :ref:`"key" <Organizing Items With
22+
Keys>` of all elements will be their index amongst their neighbors. Previously this
23+
behavior could be engaged by setting ``IDOM_FEATURE_INDEX_AS_DEFAULT_KEY=1`` when
24+
running IDOM. In this release though, you will need to explicitely turn off this feature
25+
(i.e. ``=0``) to return to the old behavior. With this change, some may notice
26+
additional error logs which warn that:
27+
28+
.. code-block:: text
29+
30+
Key not specified for child in list ...
31+
32+
This is saying is that an element or component which was created in a list does not have
33+
a unique ``key``. For more information on how to mitigate this warning refer to the docs
34+
on :ref:`Organizing Items With Keys`.
35+
36+
**Closed Issues**
37+
38+
- Support Starlette Server - :issue:`588`
39+
- Fix unhandled case in module_from_template - :issue:`584`
40+
- Hide "Children" within IDOM_DEBUG_MODE key warnings - :issue:`562`
41+
- Bug in Element Key Identity - :issue:`556`
42+
- Add iFrame to idom.html - :issue:`542`
43+
- Create a use_linked_inputs widget instead of Input - :issue:`475`
44+
- React warning from module_from_template - :issue:`440`
45+
- Use Index as Default Key - :issue:`351`
46+
47+
**Pull Requests**
48+
49+
- add ``use_linked_inputs`` - :pull:`593`
50+
- add starlette server implementation - :pull:`590`
51+
- Log on web module replacement instead of error - :pull:`586`
52+
- Make Index Default Key - :pull:`579`
53+
- reduce log spam from missing keys in children - :pull:`564`
54+
- fix bug in element key identity - :pull:`563`
55+
- add more standard html elements - :pull:`554`
56+
457

558
0.34.0
659
------

docs/source/developing-idom/index.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Developing IDOM
66

77
contributor-guide
88
changelog
9-
roadmap
109

1110
.. note::
1211

@@ -42,8 +41,8 @@ you can help move this project and community forward!
4241
Discover the features and fixes included in each release
4342

4443
.. grid-item-card:: :octicon:`milestone` Roadmap
45-
:link: roadmap
46-
:link-type: doc
44+
:link: https://github.com/orgs/idom-team/projects/1
45+
:link-type: url
4746

4847
See the long term goals of the IDOM team
4948

docs/source/developing-idom/roadmap.rst

Lines changed: 0 additions & 46 deletions
This file was deleted.

docs/source/escape-hatches/_examples/super_simple_chart/app.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@
44

55

66
file = Path(__file__).parent / "super-simple-chart.js"
7-
ssc = web.module_from_file(
8-
"super-simple-chart",
9-
file,
10-
fallback="⌛",
11-
# normally this option is not required
12-
replace_existing=True,
13-
)
7+
ssc = web.module_from_file("super-simple-chart", file, fallback="⌛")
148
SuperSimpleChart = web.export(ssc, "SuperSimpleChart")
159

1610

noxfile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def tag(session: Session) -> None:
299299
external=True,
300300
)
301301
except Exception:
302-
session.error("Cannot create a tag - tROOT are uncommited changes")
302+
session.error("Cannot create a tag - there are uncommited changes")
303303

304304
version = get_version()
305305
install_requirements_file(session, "make-release")
@@ -308,6 +308,7 @@ def tag(session: Session) -> None:
308308
changelog_file = ROOT / "docs" / "source" / "developing-idom" / "changelog.rst"
309309
for line in changelog_file.read_text().splitlines():
310310
if line == version:
311+
session.log(f"Found changelog section for version {version}")
311312
break
312313
else:
313314
session.error(

package-lock.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

requirements/pkg-extras.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ sanic-cors
66
fastapi >=0.63.0
77
uvicorn[standard] >=0.13.4
88

9+
# extra=starlette
10+
fastapi >=0.16.0
11+
uvicorn[standard] >=0.13.4
12+
913
# extra=flask
1014
flask<2.0
1115
flask-cors

setup.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ def list2cmdline(cmd_list):
2323

2424

2525
# the name of the project
26-
name = "idom"
26+
NAME = "idom"
2727

2828
# basic paths used to gather files
29-
root_dir = Path(__file__).parent
30-
src_dir = root_dir / "src"
31-
package_dir = src_dir / name
29+
ROOT_DIR = Path(__file__).parent
30+
SRC_DIR = ROOT_DIR / "src"
31+
PKG_DIR = SRC_DIR / NAME
32+
JS_DIR = SRC_DIR / "client"
3233

3334

3435
# -----------------------------------------------------------------------------
@@ -37,9 +38,9 @@ def list2cmdline(cmd_list):
3738

3839

3940
package = {
40-
"name": name,
41+
"name": NAME,
4142
"python_requires": ">=3.7",
42-
"packages": find_packages(str(src_dir)),
43+
"packages": find_packages(str(SRC_DIR)),
4344
"package_dir": {"": "src"},
4445
"description": "It's React, but in Python",
4546
"author": "Ryan Morshead",
@@ -70,7 +71,7 @@ def list2cmdline(cmd_list):
7071
# Library Version
7172
# -----------------------------------------------------------------------------
7273

73-
pkg_root_init_file = package_dir / "__init__.py"
74+
pkg_root_init_file = PKG_DIR / "__init__.py"
7475
for line in pkg_root_init_file.read_text().split("\n"):
7576
if line.startswith('__version__ = "') and line.endswith('" # DO NOT MODIFY'):
7677
package["version"] = (
@@ -96,15 +97,15 @@ def list2cmdline(cmd_list):
9697

9798

9899
requirements = []
99-
with (root_dir / "requirements" / "pkg-deps.txt").open() as f:
100+
with (ROOT_DIR / "requirements" / "pkg-deps.txt").open() as f:
100101
for line in map(str.strip, f):
101102
if not line.startswith("#"):
102103
requirements.append(line)
103104
package["install_requires"] = requirements
104105

105106
_current_extras = []
106107
extra_requirements = {"all": []} # type: ignore
107-
extra_requirements_path = root_dir / "requirements" / "pkg-extras.txt"
108+
extra_requirements_path = ROOT_DIR / "requirements" / "pkg-extras.txt"
108109
with extra_requirements_path.open() as f:
109110
for line in map(str.strip, f):
110111
if line.startswith("#") and line[1:].strip().startswith("extra="):
@@ -129,7 +130,7 @@ def list2cmdline(cmd_list):
129130
# -----------------------------------------------------------------------------
130131

131132

132-
with (root_dir / "README.md").open() as f:
133+
with (ROOT_DIR / "README.md").open() as f:
133134
long_description = f.read()
134135

135136
package["long_description"] = long_description
@@ -146,14 +147,13 @@ class Command(cls):
146147
def run(self):
147148
log.info("Installing Javascript...")
148149
try:
149-
js_dir = str(src_dir / "client")
150150
npm = shutil.which("npm") # this is required on windows
151151
if npm is None:
152152
raise RuntimeError("NPM is not installed.")
153153
for args in (f"{npm} install", f"{npm} run build"):
154154
args_list = args.split()
155155
log.info(f"> {list2cmdline(args_list)}")
156-
subprocess.run(args_list, cwd=js_dir, check=True)
156+
subprocess.run(args_list, cwd=str(JS_DIR), check=True)
157157
except Exception:
158158
log.error("Failed to install Javascript")
159159
log.error(traceback.format_exc())

src/client/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"publish": "npm --workspaces publish",
1515
"test": "npm --workspaces test"
1616
},
17-
"version": "0.34.0",
17+
"version": "0.35.1",
1818
"workspaces": [
1919
"./packages/*"
2020
]

src/client/packages/idom-app-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
"format": "prettier --write ./src",
2222
"test": "echo 'no tests'"
2323
},
24-
"version": "0.34.0"
24+
"version": "0.35.1"
2525
}

src/client/packages/idom-client-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
"test": "uvu tests"
3232
},
3333
"type": "module",
34-
"version": "0.34.0"
34+
"version": "0.35.1"
3535
}

src/idom/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
__author__ = "idom-team"
24-
__version__ = "0.34.0" # DO NOT MODIFY
24+
__version__ = "0.35.1" # DO NOT MODIFY
2525

2626
__all__ = [
2727
"component",

0 commit comments

Comments
 (0)