Skip to content

Commit 09710e3

Browse files
committed
add changelog entry for 0.30.0
also adds script to get PRs merged since the last release to make writing future changelog entries easier
1 parent 92e60b1 commit 09710e3

File tree

3 files changed

+107
-31
lines changed

3 files changed

+107
-31
lines changed

docs/source/changelog.rst

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

4+
0.30.0
5+
------
6+
7+
With recent changes to the custom component interface, it's now possible to remove all
8+
runtime reliance on NPM. Doing so has many virtuous knock-on effects:
9+
10+
1. Removal of large chunks of code
11+
2. Greatly simplifies how users dynamically experiment with React component libraries,
12+
because their usage no longer requires a build step. Instead they can be loaded in
13+
the browser from a CDN that distributes ESM modules.
14+
3. The built-in client code needs to make fewer assumption about where static resources
15+
are located, and as a result, it's also easier to coordinate the server and client
16+
code.
17+
4. Alternate client implementations benefit from this simplicity. Now, it's possible to
18+
install idom-client-react normally and write a ``loadImportSource()`` function that
19+
looks for route serving the contents of `IDOM_WEB_MODULES_DIR.`
20+
21+
This change includes large breaking changes:
22+
23+
- The CLI is being removed as it won't be needed any longer
24+
- The `idom.client` is being removed in favor of a stripped down ``idom.web`` module
25+
- The `IDOM_CLIENT_BUILD_DIR` config option will no longer exist and a new
26+
``IDOM_WEB_MODULES_DIR`` which only contains dynamically linked web modules. While
27+
this new directory's location is configurable, it is meant to be transient and should
28+
not be re-used across sessions.
29+
30+
The new ``idom.web`` module takes a simpler approach to constructing import sources and
31+
expands upon the logic for resolving imports by allowing exports from URLs to be
32+
discovered too. Now, that IDOM isn't using NPM to dynamically install component
33+
libraries ``idom.web`` instead creates JS modules from template files and links them
34+
into ``IDOM_WEB_MODULES_DIR``. These templates ultimately direct the browser to load the
35+
desired library from a CDN.
36+
37+
**Pull Requests**
38+
39+
- Add changelog entry for 0.30.0 - :pull:`415`
40+
- Fix typo in index.rst - :pull:`411`
41+
- Add event handlers docs - :pull:`410`
42+
- Misc doc improvements - :pull:`409`
43+
- Port first IDOM article to docs - :pull:`408`
44+
- Test build in CI - :pull:`404`
45+
- Remove all runtime reliance on NPM - :pull:`398`
46+
447
0.29.0
548
------
649

noxfile.py

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
import functools
44
import os
55
import re
6-
import subprocess
76
from pathlib import Path
8-
from typing import Any, Callable, Tuple
7+
from typing import Any, Callable
98

109
import nox
1110
from nox.sessions import Session
@@ -175,36 +174,11 @@ def test_docs(session: Session) -> None:
175174
session.run("sphinx-build", "-b", "doctest", "docs/source", "docs/build")
176175

177176

178-
@nox.session
179-
def commits_since_last_tag(session: Session) -> None:
177+
@nox.session(reuse_venv=True)
178+
def latest_pull_requests(session: Session) -> None:
180179
"""A basic script for outputing changelog info"""
181-
rst_format = "--format=rst" in session.posargs
182-
183-
latest_tag = (
184-
subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"])
185-
.decode()
186-
.strip()
187-
)
188-
commit_references = (
189-
subprocess.check_output(
190-
["git", "log", "--pretty=reference", f"{latest_tag}..HEAD"]
191-
)
192-
.decode()
193-
.strip()
194-
.split("\n")
195-
)
196-
197-
def parse_commit_reference(commit_ref: str) -> Tuple[str, str, str]:
198-
commit_sha, remainder = commit_ref.split(" ", 1)
199-
commit_message, commit_date = remainder[1:-1].rsplit(", ", 1)
200-
return commit_sha, commit_message, commit_date
201-
202-
for sha, msg, _ in map(parse_commit_reference, commit_references):
203-
if rst_format:
204-
sha_repr = f":commit:`{sha}`"
205-
else:
206-
sha_repr = sha
207-
print(f"- {msg} - {sha_repr}")
180+
session.install("requests", "python-dateutil")
181+
session.run("python", "scripts/latest_pull_requests.py", *session.posargs)
208182

209183

210184
def install_requirements_file(session: Session, name: str) -> None:

scripts/latest_pull_requests.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
from __future__ import annotations
2+
3+
import sys
4+
from datetime import datetime
5+
from typing import Any, Iterator
6+
7+
import requests
8+
from dateutil.parser import isoparse
9+
10+
11+
REPO = "idom-team/idom"
12+
STR_DATE_FORMAT = r"%Y-%m-%d"
13+
14+
15+
def last_release() -> datetime:
16+
response = requests.get(f"https://api.github.com/repos/{REPO}/releases/latest")
17+
return isoparse(response.json()["published_at"])
18+
19+
20+
def pull_requests_after(date: datetime) -> Iterator[Any]:
21+
then = date.strftime(STR_DATE_FORMAT)
22+
now = datetime.now().strftime(STR_DATE_FORMAT)
23+
query = f"repo:{REPO} type:pr merged:{then}..{now}"
24+
25+
page = 0
26+
while True:
27+
page += 1
28+
response = requests.get(
29+
"https://api.github.com/search/issues",
30+
{"q": query, "per_page": 15, "page": page},
31+
)
32+
33+
response_json = response.json()
34+
35+
if response_json["incomplete_results"]:
36+
raise RuntimeError(response)
37+
38+
items = response_json["items"]
39+
if items:
40+
yield from items
41+
else:
42+
break
43+
44+
45+
FORMAT_TEMPLATES = {
46+
"md": f"- {{title}} - [#{{number}}](https://github.com/{REPO}/pull/{{number}})",
47+
"rst": "- {title} - :pull:`{number}`",
48+
"text": "- {title} - #{number}",
49+
}
50+
51+
52+
def main(format: str = "text"):
53+
template = FORMAT_TEMPLATES[format]
54+
for pr in pull_requests_after(last_release()):
55+
print(template.format(**pr))
56+
57+
58+
if __name__ == "__main__":
59+
main(*sys.argv[1:])

0 commit comments

Comments
 (0)