-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error handling & refresh for with-d3-require
#231
Conversation
e91208b
to
6e7b94b
Compare
After a chat with @mk tried another route - using hooks and a function component. It's not particularly ergonomic to do with reagent but much easier to achieve exactly what we want. But the original issue - async error catching - is not handled in this version, we now pass our |
I added the async error handler back in, using a hook, and to simplify things - I changed the default reagent compiler to functional components. So this would now need more testing. But supporting hooks IMO is very useful. |
- use-promise hook - remove support for :then in with-d3-require - :refresh-key no longer needed
further re-implemented everything using hooks, much simpler and composed of small parts. |
Very nice. There still seems to be an issue with Plotly in the static build still, see https://snapshots.nextjournal.com/clerk/build/88e94fce8b12fd4c6770ecfea60f616fbb00388f/index.html#/notebooks/viewers/plotly.clj Locally I saw an |
@mk I also see that hook error locally when switching between different notebooks. Looking into it. |
…react-component (for hook state)
I found two issues -
|
@mhuebert just getting around now to play with this, it's SO much better than what we had before, both in experience (without the height flickering) and code. Would love to go over the |
# Conflicts: # resources/viewer-js-hash
with-d3-require
Addresses the issues of
:ref
function.:!error
as react contextuse-handle-error
hook so that child views can write to the nearest error handler manuallyuse-d3-require
hookwith-d3-require
: no need for a:key
- the component stays mounted and re-fetches packages whenever the args change. the invalidation now occurs where we pass deps touseEffect