Skip to content

Commit

Permalink
add changelog entry for 0.30.0
Browse files Browse the repository at this point in the history
also adds script to get PRs merged since the last release to make
writing future changelog entries easier
  • Loading branch information
rmorshea committed Jun 29, 2021
1 parent 92e60b1 commit 09710e3
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 31 deletions.
43 changes: 43 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,49 @@
Changelog
=========

0.30.0
------

With recent changes to the custom component interface, it's now possible to remove all
runtime reliance on NPM. Doing so has many virtuous knock-on effects:

1. Removal of large chunks of code
2. Greatly simplifies how users dynamically experiment with React component libraries,
because their usage no longer requires a build step. Instead they can be loaded in
the browser from a CDN that distributes ESM modules.
3. The built-in client code needs to make fewer assumption about where static resources
are located, and as a result, it's also easier to coordinate the server and client
code.
4. Alternate client implementations benefit from this simplicity. Now, it's possible to
install idom-client-react normally and write a ``loadImportSource()`` function that
looks for route serving the contents of `IDOM_WEB_MODULES_DIR.`

This change includes large breaking changes:

- The CLI is being removed as it won't be needed any longer
- The `idom.client` is being removed in favor of a stripped down ``idom.web`` module
- The `IDOM_CLIENT_BUILD_DIR` config option will no longer exist and a new
``IDOM_WEB_MODULES_DIR`` which only contains dynamically linked web modules. While
this new directory's location is configurable, it is meant to be transient and should
not be re-used across sessions.

The new ``idom.web`` module takes a simpler approach to constructing import sources and
expands upon the logic for resolving imports by allowing exports from URLs to be
discovered too. Now, that IDOM isn't using NPM to dynamically install component
libraries ``idom.web`` instead creates JS modules from template files and links them
into ``IDOM_WEB_MODULES_DIR``. These templates ultimately direct the browser to load the
desired library from a CDN.

**Pull Requests**

- Add changelog entry for 0.30.0 - :pull:`415`
- Fix typo in index.rst - :pull:`411`
- Add event handlers docs - :pull:`410`
- Misc doc improvements - :pull:`409`
- Port first IDOM article to docs - :pull:`408`
- Test build in CI - :pull:`404`
- Remove all runtime reliance on NPM - :pull:`398`

0.29.0
------

Expand Down
36 changes: 5 additions & 31 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import functools
import os
import re
import subprocess
from pathlib import Path
from typing import Any, Callable, Tuple
from typing import Any, Callable

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


@nox.session
def commits_since_last_tag(session: Session) -> None:
@nox.session(reuse_venv=True)
def latest_pull_requests(session: Session) -> None:
"""A basic script for outputing changelog info"""
rst_format = "--format=rst" in session.posargs

latest_tag = (
subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"])
.decode()
.strip()
)
commit_references = (
subprocess.check_output(
["git", "log", "--pretty=reference", f"{latest_tag}..HEAD"]
)
.decode()
.strip()
.split("\n")
)

def parse_commit_reference(commit_ref: str) -> Tuple[str, str, str]:
commit_sha, remainder = commit_ref.split(" ", 1)
commit_message, commit_date = remainder[1:-1].rsplit(", ", 1)
return commit_sha, commit_message, commit_date

for sha, msg, _ in map(parse_commit_reference, commit_references):
if rst_format:
sha_repr = f":commit:`{sha}`"
else:
sha_repr = sha
print(f"- {msg} - {sha_repr}")
session.install("requests", "python-dateutil")
session.run("python", "scripts/latest_pull_requests.py", *session.posargs)


def install_requirements_file(session: Session, name: str) -> None:
Expand Down
59 changes: 59 additions & 0 deletions scripts/latest_pull_requests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
from __future__ import annotations

import sys
from datetime import datetime
from typing import Any, Iterator

import requests
from dateutil.parser import isoparse


REPO = "idom-team/idom"
STR_DATE_FORMAT = r"%Y-%m-%d"


def last_release() -> datetime:
response = requests.get(f"https://api.github.com/repos/{REPO}/releases/latest")
return isoparse(response.json()["published_at"])


def pull_requests_after(date: datetime) -> Iterator[Any]:
then = date.strftime(STR_DATE_FORMAT)
now = datetime.now().strftime(STR_DATE_FORMAT)
query = f"repo:{REPO} type:pr merged:{then}..{now}"

page = 0
while True:
page += 1
response = requests.get(
"https://api.github.com/search/issues",
{"q": query, "per_page": 15, "page": page},
)

response_json = response.json()

if response_json["incomplete_results"]:
raise RuntimeError(response)

items = response_json["items"]
if items:
yield from items
else:
break


FORMAT_TEMPLATES = {
"md": f"- {{title}} - [#{{number}}](https://github.com/{REPO}/pull/{{number}})",
"rst": "- {title} - :pull:`{number}`",
"text": "- {title} - #{number}",
}


def main(format: str = "text"):
template = FORMAT_TEMPLATES[format]
for pr in pull_requests_after(last_release()):
print(template.format(**pr))


if __name__ == "__main__":
main(*sys.argv[1:])

0 comments on commit 09710e3

Please sign in to comment.