Repository: bokeh/bokeh

Issue:
legacy issues should not be in a subdirectory
@mattpap The legacy resources should go in the same "directory" level as all other resources. Instead of differentiating with directory, the distinction should be by filename, e.g. 
```
bokeh-2.0.0.legacy.min.js
```
The existing automation code we do still have does assumes a single directory (and as a result no legacy resources were ever uploaded for any 2.0 dev or rc to datae) and the SRI hash machinery also assumes a single directory as well.

Relative to changing the filename format for legacy resources, updating release and SRI machinery at this point is a *huge risk*. 


Discussion:

Resolving patch:
diff --git a/bokeh/resources.py b/bokeh/resources.py
--- a/bokeh/resources.py
+++ b/bokeh/resources.py
@@ -312,9 +312,8 @@ def components(self, kind):
 
     def _file_paths(self, kind):
         minified = ".min" if not self.dev and self.minified else ""
-        legacy = "legacy" if self.legacy else ""
         files = ["%s%s.%s" % (component, minified, kind) for component in self.components(kind)]
-        paths = [join(self.base_dir, kind, legacy, file) for file in files]
+        paths = [join(self.base_dir, kind, file) for file in files]
         return paths
 
     def _collect_external_resources(self, resource_attr):
@@ -644,7 +643,7 @@ def _get_cdn_urls(version=None, minified=True, legacy=False):
 
     # check if we want minified js and css
     _minified = ".min" if minified else ""
-    _legacy = "legacy/" if legacy else ""
+    _legacy = ".legacy" if legacy else ""
 
     base_url = _cdn_base_url()
     dev_container = "bokeh/dev"
@@ -654,10 +653,10 @@ def _get_cdn_urls(version=None, minified=True, legacy=False):
     container = dev_container if _DEV_PAT.match(version) else rel_container
 
     def mk_filename(comp, kind):
-        return f"{comp}-{version}{_minified}.{kind}"
+        return f"{comp}-{version}{_legacy}{_minified}.{kind}"
 
     def mk_url(comp, kind):
-        return f"{base_url}/{container}/{_legacy}" + mk_filename(comp, kind)
+        return f"{base_url}/{container}/" + mk_filename(comp, kind)
 
     result = {
         "urls": lambda components, kind: [mk_url(component, kind) for component in components],
@@ -686,10 +685,10 @@ def mk_url(comp, kind):
 
 def _get_server_urls(root_url, minified=True, legacy=False, path_versioner=None):
     _minified = ".min" if minified else ""
-    _legacy = "legacy/" if legacy else ""
+    _legacy = ".legacy" if legacy else ""
 
     def mk_url(comp, kind):
-        path = f"{kind}/{_legacy}{comp}{_minified}.{kind}"
+        path = f"{kind}/{comp}{_legacy}{_minified}.{kind}"
         if path_versioner is not None:
             path = path_versioner(path)
         return f"{root_url}static/{path}"


Test patch:
diff --git a/bokehjs/test/codebase/size.ts b/bokehjs/test/codebase/size.ts
--- a/bokehjs/test/codebase/size.ts
+++ b/bokehjs/test/codebase/size.ts
@@ -13,11 +13,11 @@ const LIMITS: {[key: string]: number} = {
   "js/bokeh-api.min.js":      90,
   "js/bokeh-gl.min.js":       70,
   // legacy (es5)
-  "js/legacy/bokeh.min.js":         800,
-  "js/legacy/bokeh-widgets.min.js": 252,
-  "js/legacy/bokeh-tables.min.js":  270,
-  "js/legacy/bokeh-api.min.js":      90,
-  "js/legacy/bokeh-gl.min.js":       70,
+  "js/bokeh.legacy.min.js":         800,
+  "js/bokeh-widgets.legacy.min.js": 252,
+  "js/bokeh-tables.legacy.min.js":  270,
+  "js/bokeh-api.legacy.min.js":      90,
+  "js/bokeh-gl.legacy.min.js":       70,
 }
 
 describe(`bokehjs/build/*/*.min.js file sizes`, () => {