AaronWatters / jp_proxy_widget

Generic Jupyter/IPython widget implementation that will support many types of javascript libraries and interactions.
BSD 2-Clause "Simplified" License
61 stars 13 forks source link

Clear global state when kernel restarts to allow JS/CSS to reload #16

Closed sohailsomani closed 3 years ago

sohailsomani commented 3 years ago

JS: clear that.loaded_js_by_name CSS: remove all notes with data attribute data-jp-proxy-widget-node

This allows CSS/JS to be reloaded without reloading the page. Also in the future, nodes can be added using the data-jp-proxy-widget-node attribute and automatically be cleared in a similar way.

The main reason this is needed is if you are editing CSS/JS while developing a widget, it's quite cumbersome to have to reload the page and then restart the kernel. This makes it so only a kernel restart is necessary and allows for quicker iteration and fewer surprises.

codecov-io commented 3 years ago

Codecov Report

Merging #16 (9868e1a) into master (735ec6e) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #16   +/-   ##
=======================================
  Coverage   75.63%   75.63%           
=======================================
  Files           9        9           
  Lines        1174     1174           
=======================================
  Hits          888      888           
  Misses        286      286           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 735ec6e...9868e1a. Read the comment docs.