Repository: plotly/dash

Issue:
[BUG] some extras in dcc (and table?) not working with dash 1.x imports
```py
import dash_core_components as dcc

dcc.send_data_frame  # doesn't work
```
The reason for this is that the `dash_core_components` stub does [`from dash.dcc import *`](https://github.com/plotly/dash-core-components/blob/6c790f0d89635b996776f94e87d13e6028a0c8ad/dash_core_components/__init__.py#L1) and the extra `dcc.express` items  imported [here](https://github.com/plotly/dash/blob/4bdc6e9250cfe8cc751a3dc610be39402bf4fdd4/components/dash-core-components/dash_core_components_base/__init__.py#L8) aren't included in [`__all__`](https://github.com/plotly/dash/blob/4bdc6e9250cfe8cc751a3dc610be39402bf4fdd4/components/dash-core-components/dash_core_components_base/__init__.py#L7)

There may well be similar missing items in `dash_table` as well.


Discussion:
Yes, [`Format` and `FormatTemplate`](https://github.com/plotly/dash/blob/4bdc6e9250cfe8cc751a3dc610be39402bf4fdd4/components/dash-table/dash_table_base/__init__.py#L18-L19) likely need to be added to `dash_table.__all__`

Resolving patch:
diff --git a/components/dash-core-components/dash_core_components_base/__init__.py b/components/dash-core-components/dash_core_components_base/__init__.py
--- a/components/dash-core-components/dash_core_components_base/__init__.py
+++ b/components/dash-core-components/dash_core_components_base/__init__.py
@@ -4,7 +4,7 @@
 import dash as _dash
 
 from ._imports_ import *  # noqa: F401, F403, E402
-from ._imports_ import __all__  # noqa: E402
+from ._imports_ import __all__ as _components
 from .express import (  # noqa: F401, E402
     send_bytes,
     send_data_frame,
@@ -12,6 +12,13 @@
     send_string,
 )
 
+__all__ = _components + [
+    "send_bytes",
+    "send_data_frame",
+    "send_file",
+    "send_string",
+]
+
 _basepath = _os.path.dirname(__file__)
 _filepath = _os.path.abspath(_os.path.join(_basepath, "package-info.json"))
 with open(_filepath) as f:
diff --git a/components/dash-table/dash_table_base/__init__.py b/components/dash-table/dash_table_base/__init__.py
--- a/components/dash-table/dash_table_base/__init__.py
+++ b/components/dash-table/dash_table_base/__init__.py
@@ -14,10 +14,12 @@
     _sys.exit(1)
 
 from ._imports_ import *  # noqa: E402, F401, F403
-from ._imports_ import __all__  # noqa: E402
+from ._imports_ import __all__ as _components
 from . import Format  # noqa: F401, E402
 from . import FormatTemplate  # noqa: F401, E402
 
+__all__ = _components + ["Format", "FormatTemplate"]
+
 _basepath = _os.path.dirname(__file__)
 _filepath = _os.path.abspath(_os.path.join(_basepath, "package-info.json"))
 with open(_filepath) as f:
diff --git a/components/dash-table/index.py b/components/dash-table/index.py
deleted file mode 100644
--- a/components/dash-table/index.py
+++ /dev/null
@@ -1,87 +0,0 @@
-import dash
-from dash.dependencies import Input, Output
-import dash_core_components as dcc
-import dash_html_components as html
-import dash_table
-import logging
-import os
-
-
-logging.getLogger("werkzeug").setLevel(logging.ERROR)
-
-app = dash.Dash(
-    __name__, external_stylesheets=["https://codepen.io/chriddyp/pen/dZVMbK.css"]
-)
-app.config["suppress_callback_exceptions"] = True
-
-server = app.server
-
-apps = {
-    filename.replace(".py", "").replace("app_", ""): getattr(
-        getattr(
-            __import__(".".join(["tests", "integration", filename.replace(".py", "")])),
-            "integration",
-        ),
-        filename.replace(".py", ""),
-    )
-    for filename in os.listdir(os.path.join("tests", "integration"))
-    if filename.startswith("app_") and filename.endswith(".py")
-}
-
-
-app.layout = html.Div(
-    children=[
-        dcc.Location(id="location"),
-        html.Div(id="container"),
-        html.Div(style={"display": "none"}, children=dash_table.DataTable(id="hidden")),
-    ]
-)
-
-
-@app.callback(Output("container", "children"), [Input("location", "pathname")])
-def display_app(pathname):
-    if pathname == "/" or pathname is None:
-        return html.Div(
-            className="container",
-            children=[
-                html.H1("Dash Table Review App"),
-                html.Ol(
-                    [
-                        html.Li(
-                            dcc.Link(
-                                name.replace("app_", "").replace("_", " "),
-                                href="/{}".format(
-                                    name.replace("app_", "").replace("_", "-")
-                                ),
-                            )
-                        )
-                        for name in apps
-                    ]
-                ),
-            ],
-        )
-
-    app_name = pathname.replace("/", "").replace("-", "_")
-    if app_name in apps:
-        return html.Div(
-            [
-                html.H3(app_name.replace("-", " ")),
-                html.Div(id="waitfor"),
-                html.Div(apps[app_name].layout()),
-            ]
-        )
-    else:
-        return """
-            App not found.
-            You supplied "{}" and these are the apps that exist:
-            {}
-        """.format(
-            app_name, list(apps.keys())
-        )
-
-
-app.css.config.serve_locally = True
-app.scripts.config.serve_locally = True
-
-if __name__ == "__main__":
-    app.run_server(debug=True)


Test patch:
diff --git a/tests/unit/test_old_imports.py b/tests/unit/test_old_imports.py
new file mode 100644
--- /dev/null
+++ b/tests/unit/test_old_imports.py
@@ -0,0 +1,42 @@
+from pytest import warns
+
+from dash import dcc, dash_table
+
+
+def filter_dir(package):
+    ignore = [
+        "warnings",
+        "json",
+        "async_resources",
+        "package",
+        "package_name",
+        "f",
+        "express",
+    ]
+    return sorted(
+        [
+            item
+            for item in dir(package)
+            if item == "__version__" or (item[0] not in "@_" and item not in ignore)
+        ]
+    )
+
+
+def test_old_dcc():
+    with warns(UserWarning, match="dash_core_components package is deprecated"):
+        import dash_core_components as _dcc
+
+        old_dir = filter_dir(_dcc)
+        new_dir = filter_dir(dcc)
+
+        assert old_dir == new_dir
+
+
+def test_old_table():
+    with warns(UserWarning, match="dash_table package is deprecated"):
+        import dash_table as _dt
+
+        old_dir = filter_dir(_dt)
+        new_dir = filter_dir(dash_table)
+
+        assert old_dir == new_dir