Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: manzt/anywidget
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: anywidget@0.9.13
Choose a base ref
...
head repository: manzt/anywidget
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: anywidget@0.9.14
Choose a head ref
Loading
Showing with 8,338 additions and 6,562 deletions.
  1. +50 −0 .github/ISSUE_TEMPLATE/bug_report.yml
  2. +5 −0 .github/ISSUE_TEMPLATE/config.yml
  3. +31 −0 .github/ISSUE_TEMPLATE/documentation.yml
  4. +35 −0 .github/ISSUE_TEMPLATE/feature_request.yml
  5. +28 −49 .github/workflows/ci.yml
  6. +10 −4 .github/workflows/jsr.yml
  7. +4 −15 .github/workflows/release.yml
  8. +1 −1 .gitignore
  9. +7 −3 CITATION.cff
  10. +20 −26 CONTRIBUTING.md
  11. +50 −10 README.md
  12. +2 −2 anywidget/__init__.py
  13. +2 −2 anywidget/_cellmagic.py
  14. +79 −36 anywidget/_descriptor.py
  15. +9 −5 anywidget/_file_contents.py
  16. +5 −2 anywidget/_protocols.py
  17. +28 −12 anywidget/_util.py
  18. +33 −21 anywidget/experimental.py
  19. +10 −9 anywidget/widget.py
  20. +2 −1 biome.json
  21. +8 −8 docs/package.json
  22. +35 −0 docs/src/components/Banner.astro
  23. +7 −2 docs/src/components/GitHubCard.astro
  24. +13 −0 docs/src/components/Header/Header.astro
  25. +1 −1 docs/src/components/Header/LanguageSelect.tsx
  26. +1 −1 docs/src/components/Header/Search.tsx
  27. +1 −3 docs/src/components/Header/ThemeToggleButton.css
  28. +2 −0 docs/src/components/Header/ThemeToggleButton.tsx
  29. +25 −1 docs/src/components/Hero.astro
  30. +51 −0 docs/src/components/IntegrationsGallery.astro
  31. +5 −1 docs/src/consts.ts
  32. +3 −1 docs/src/layouts/MainLayout.astro
  33. +2 −0 docs/src/layouts/SplashLayout.astro
  34. +229 −0 docs/src/pages/en/afm.md
  35. +1 −1 docs/src/pages/en/bundling.md
  36. +9 −0 docs/src/pages/en/community.mdx
  37. +51 −33 docs/src/pages/en/getting-started.mdx
  38. +1 −1 docs/src/pages/en/jupyter-widgets-the-good-parts.mdx
  39. +39 −152 docs/src/pages/en/notebooks/counter.ipynb
  40. +1 −1 docs/src/pages/index.astro
  41. +3 −4 docs/src/styles/index.css
  42. +4 −2 docs/src/styles/theme.css
  43. +1 −0 docs/tailwind.config.cjs
  44. +0 −183 examples/Counter.ipynb
  45. +0 −334 examples/minimal_example.ipynb
  46. +14 −13 package.json
  47. +6 −0 packages/anywidget/CHANGELOG.md
  48. +5 −7 packages/anywidget/package.json
  49. +1 −1 packages/anywidget/src/plugin.js
  50. +35 −8 packages/anywidget/src/widget.js
  51. +50 −0 packages/create-anywidget/CHANGELOG.md
  52. +320 −94 packages/create-anywidget/__tests__/__snapshots__/index.test.js.snap
  53. +31 −7 packages/create-anywidget/create.js
  54. +9 −9 packages/create-anywidget/package.json
  55. +18 −0 packages/deno/CHANGELOG.md
  56. +4 −2 packages/deno/deno.json
  57. +100 −66 packages/deno/deno.lock
  58. +1 −1 packages/deno/package.json
  59. +25 −33 packages/deno/src/mod.ts
  60. +32 −0 packages/deno/src/utilities.ts
  61. +37 −1 packages/deno/test.ts
  62. +13 −0 packages/react/CHANGELOG.md
  63. +9 −9 packages/react/package.json
  64. +118 −0 packages/signals/README.md
  65. +23 −0 packages/signals/deno.json
  66. +225 −0 packages/signals/mod.ts
  67. +8 −0 packages/signals/npm.README.md
  68. +10 −0 packages/signals/package.json
  69. +13 −0 packages/svelte/CHANGELOG.md
  70. +4 −3 packages/svelte/package.json
  71. +11 −0 packages/types/CHANGELOG.md
  72. +8 −3 packages/types/index.ts
  73. +1 −4 packages/types/package.json
  74. +6 −0 packages/vite/CHANGELOG.md
  75. +3 −3 packages/vite/package.json
  76. +0 −69 paper/export-pdf.ts
  77. +0 −38 paper/myst.yml
  78. +64 −34 paper/paper.bib
  79. +72 −61 paper/paper.md
  80. +3,737 −4,937 pnpm-lock.yaml
  81. +48 −65 pyproject.toml
  82. +2 −2 tests/test_cellmagic.py
  83. +64 −53 tests/test_descriptor.py
  84. +6 −6 tests/test_experimental.py
  85. +34 −33 tests/test_file_contents.py
  86. +1 −1 tests/test_protocols.py
  87. +15 −14 tests/test_utils.py
  88. +68 −58 tests/test_widget.py
  89. +2,183 −0 uv.lock
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "\U0001F41E Bug report"
description: Report an issue with anywidget
labels: ['bug']
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: bug-description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks!
placeholder: Bug description
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
description: Please provide a link to a repo or gist that can reproduce the problem you ran into. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided within a reasonable time-frame, the issue will be closed.
placeholder: Reproduction
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs
description: 'Please include browser console and/or Python logs around the time this bug occurred. Optional if provided reproduction. Please try not to insert an image but copy paste the log text.'
render: shell
- type: textarea
id: system-info
attributes:
label: System Info
description: Output of `npx envinfo --system --browsers` and `pip freeze | grep -E "anywidget|jupyter|notebook"`. And please, other relevant package versions.
render: shell
placeholder: System, Binaries, Browsers
validations:
required: true
- type: dropdown
id: severity
attributes:
label: Severity
description: Select the severity of this issue
options:
- annoyance
- blocking an upgrade
- blocking all usage of anywidget
validations:
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Discord Chat
url: https://discord.gg/W5h4vPMbDQ
about: Ask questions and discuss with other anywidget devs/users in real time.
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Documentation
description: Create a report to help us improve the documentation
labels: [docs]
body:
- type: input
id: link
attributes:
label: Documentation Link
description: >-
Link to any documentation or examples that you are referencing.
placeholder: https://anywidget.dev/...
- type: textarea
id: issue
attributes:
label: Issue
description: What is lacking, unclear, or incorrect in the documentation?
placeholder: |
* The section on [...] is confusing because [...]
* [...] gives the impression that [...] whereas it should be [...]
* An example demonstrating [...] is missing
validations:
required: true
- type: textarea
id: recommendation
attributes:
label: Recommended improvement
placeholder: |
* Change this line to [...]
* Add a paragraph that explains [...]
* Add a new section with [...]
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Feature Request'
description: Request a new anywidget feature
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to request this feature!
- type: textarea
id: problem
attributes:
label: Describe the problem
description: Please provide a clear and concise description the problem this feature would solve. The more information you can provide here, the better.
placeholder: I'm always frustrated when...
validations:
required: true
- type: textarea
id: solution
attributes:
label: Describe the proposed solution
description: Please provide a clear and concise description of what you would like to happen.
placeholder: I would like to see...
validations:
required: true
- type: dropdown
id: importance
attributes:
label: Importance
description: How important is this feature to you?
options:
- nice to have
- would make my life easier
- i cannot use anywidget without it
validations:
required: true
77 changes: 28 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -19,67 +19,53 @@ jobs:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
# Disable jupyter-builder build hook because not needed for linting/formatting, and requires pnpm
- run: |
sed -i '' 's/\[tool.hatch.build.hooks.\(.*\)\]/\[_tool.hatch.build.hooks.\1\]/' pyproject.toml
- uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
version: "0.5.x"
- run: |
pip install uv
uv pip install --system ruff
ruff check
ruff format
uv run ruff check
uv run ruff format
TypecheckPython:
name: Python / Typecheck
runs-on: macos-14
steps:
- uses: actions/checkout@v4

# Disable jupyter-builder build hook because not needed for typechecking, and requires npm
# Disable jupyter-builder build hook because not needed for typechecking, and requires pnpm
- run: |
sed -i '' 's/\[tool.hatch.build.hooks.\(.*\)\]/\[_tool.hatch.build.hooks.\1\]/' pyproject.toml
cat pyproject.toml
- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- run: |
pip install uv
uv pip install --system -e '.[test,dev]'
- run: mypy
version: "0.5.x"
- run: uv run mypy

TestPython:
name: Python / Test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "22.x"
- run: pnpm install --frozen-lock

- uses: actions/setup-python@v5
run_install: true
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}

- if: ${{ matrix.python-version != '3.7' }}
run: |
pip install uv
uv pip install --system -e '.[test,dev]'
- if: ${{ matrix.python-version == '3.7' }}
run: |
pip install -e '.[test,dev]'
version: "0.5.x"
- name: Run tests
run: pytest ./tests --color=yes --cov anywidget --cov-report xml

- uses: codecov/codecov-action@v4
run: uv run --with pytest-cov pytest ./tests --color=yes --cov anywidget --cov-report xml
env:
UV_PYTHON: ${{ matrix.python-version }}
- uses: codecov/codecov-action@v5

LintJavaScript:
name: JavaScript / Lint
@@ -91,29 +77,22 @@ jobs:
version: latest
- run: biome ci .


TypecheckJavaScript:
name: JavaScript / Typecheck
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "22.x"
- run: |
pnpm install
pnpm typecheck
run_install: true
- run: pnpm typecheck

TestJavaScript:
name: JavaScript / Test
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "22.x"
- run: |
pnpm install
pnpm test
run_install: true
- run: pnpm test
14 changes: 10 additions & 4 deletions .github/workflows/jsr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish @anywidget/deno to jsr
name: Publish to jsr

on:
push:
@@ -13,16 +13,22 @@ jobs:
publish:
if: github.repository == 'manzt/anywidget'
runs-on: macos-14
strategy:
matrix:
directory:
- packages/deno
- packages/signals
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
- uses: denoland/setup-deno@v2
with:
deno-version: v1.x
deno-version: v2.x
- run: |
cd packages/deno
cd ${{ matrix.directory }}
# sync deno version with package.json
sed -i '' 's/\"version\": \"[^\"]*\"/\"version\": \"'$(jq -r '.version' package.json)'\"/' deno.json
rm package.json
deno publish --allow-dirty
19 changes: 4 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -22,28 +22,17 @@ jobs:
issues: read
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "22.x"
- run: pnpm install --frozen-lock

- uses: actions/setup-python@v5
run_install: true
- uses: astral-sh/setup-uv@v5
with:
python-version: "3.11"
- run: |
python -m pip install --upgrade pip
pip install build twine
version: "0.5.x"
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
# this expects you to have a npm script called version that runs some logic and then calls `changeset version`.
version: npm run version
# This expects you to have a script called release which does a build for the packages and calls `changeset publish`
publish: npm run release
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__pycache__/

*.egg-info/
*.tsbuildinfo
.eggs/*

.ipynb_checkpoints/
10 changes: 7 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -29,7 +29,11 @@ preferred-citation:
family-names: "Gehlenborg"
affiliation: "Harvard Medical School"
orcid: "https://orcid.org/0000-0003-0327-8297"
doi: "10.31219/osf.io/tw9sg"
journal: "OSF preprint"
month: 6
doi: "10.21105/joss.06939"
journal: "Journal of Open Source Software"
volume: "9"
number: "102"
pages: "6939"
year: 2024
publisher:
name: "The Open Journal"
Loading