Open bryevdv opened 4 years ago
CDNs have their own downsides. But overall I think the change of the default choice makes sense.
Local dev will be slightly complicated by needing to specify to use local resources.
The "Getting Set Up" section of the dev guide should probably mention setting BOKEH_DEV=true
. Even if the switch to CDN is not realized.
OK will this is slightly more complicated by
@property
def root_url(self):
if self._root_url is not None:
return self._root_url
else:
return self._default_root_url
which is I guess is to support serving compiled bundles. But I think this is currently broken anyway, since AFAICT if you specify CDN resources, and also run the server on a non-default port, there is no way to configure things correctly. Bundles will always try to load from the default server URL, which is incorrect:
In [1]: from bokeh.resources import CDN
In [2]: CDN.root_url
Out[2]: 'http://localhost:5006/'
I will clean this up as well.
Digging further, I think I am going to punt on this for 2.1 and leave to 2.2 or even 3.x TLDR things seem fairly hard-wired to the idea of a single bundle for a singe Resources
. Handling e.g. "cdn" for BokehJS but "server" for compiled extensions will require more extensive changes that should not just be bolted on without some planning and consideration. I think the entire resources handling really needs to be overhauled/streamlined but I don't have bandwitdth for that presently.
@bokeh/dev I would like to consider changing the default resources for Bokeh server to CDN. For almost all real user situations I can think of this represents an improvement. Viewers of apps will get to take advantage of CDN caching and apps will not have to waste compute and bandwidth on serving resources themselves.
Local dev will be slightly complicated by needing to specify to use local resources.
Thoughts? I would say this could happen for 2.1 personally.