manzt / anywidget

reusable widgets made easy
https://anywidget.dev
MIT License
490 stars 39 forks source link

Allow semver-compatible frontend versions #521

Closed kylebarron closed 6 months ago

kylebarron commented 7 months ago

In relation to the discussion about JupyterHub in https://github.com/manzt/anywidget/issues/385, I've suggested to a few of my users to install anywidget on the server, then install lonboard in the client environment. Lonboard does not pin a version of anywidget, so when a new anywidget version is released, the next install of lonboard will break because the client anywidget version does not exactly match the server anywidget version.

I have reason to believe that using "~major.minor.*" works, because pydeck has been doing that for its frontend code for a while, to allow the Python code and JS bindings to be versioned separately (see 1, 2, 3).

That said, I haven't yet tested this in a JupyterHub environment. (I haven't tried to set up the development environment yet)

changeset-bot[bot] commented 7 months ago

🦋 Changeset detected

Latest commit: b7d0a7e89a976eeff1b66cad05a3fa6d05e3dd37

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | --------- | ----- | | anywidget | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

manzt commented 6 months ago

Hey, just wanted to check in on this. I notice the PR is still in a Draft state. I should have some time to push it forward if that is ok with you. Thanks!

kylebarron commented 6 months ago

I only set it as "draft" because I hadn't figured out how to test it yet. But it "looks" valid based on what pydeck was using

Let me know if I can help at all

manzt commented 6 months ago

Ah, sorry for the misunderstanding. I thought it wasn't ready for review. I'll have a look and get back to you :) thanks for the contribution!

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.21%. Comparing base (12ca2f8) to head (b7d0a7e). Report is 129 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #521 +/- ## ========================================== - Coverage 98.45% 97.21% -1.25% ========================================== Files 8 8 Lines 452 502 +50 ========================================== + Hits 445 488 +43 - Misses 7 14 +7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

manzt commented 6 months ago

Ok, I tried this out in a few different environments (Lab, standalone HTML, Colab) and things seem to be working. The various CDN importers seem to resolve the version specifier correctly, which would be the main thing I would worry about.

I think this should be seen as a temporary fix. We should ideally separately version the anywidget frontend in the future, or figure out a way to bypass this strictness from JupyterLab all together. But in the meantime, this is great. Thank you!

kylebarron commented 5 months ago

awesome 🙌