Repository: plotly/dash

Issue:
Importing Dash.jl component libraries prior to Dash throws a "UndefVarError: DashBase not defined" error
While generating the Julia version of `DashUserGuideComponents`, I noticed that the `Project.toml` doesn't contain an entry for `DashBase`, e.g.

```toml
name = "DashUserGuideComponents"
uuid = "1b08a953-4be3-4667-9a23-e667f8ac7b1d"
authors = ["Chris P <chris@plotly.com>"]
version = "0.0.4"

[deps]
Dash = "1b08a953-4be3-4667-9a23-3db579824955"

[compat]
julia = "1.2"
Dash = "0.1"
```

Glancing at `DashCoreComponents`, it looks like the `Project.toml` includes an entry for `DashBase` in both the `[deps]` and `[compat]` sections.

@waralex @alexcjohnson 


Discussion:
Yes, that’s expected. The core (dcc, html, table) depend on DashBase so that Dash can depend on them, rather than the other way around as non-core component packages do. 
> Yes, that’s expected. The core (dcc, html, table) depend on DashBase so that Dash can depend on them, rather than the other way around as non-core component packages do.

OK. I'm guessing that load order is important, then, since I see

```julia
julia> using DashUserGuideComponents
[ Info: Precompiling DashUserGuideComponents [1b08a953-4be3-4667-9a23-e667f8ac7b1d]
ERROR: InitError: UndefVarError: DashBase not defined
Stacktrace:
 [1] __init__() at /home/rpkyle/PlotlyRepos/dash-docs/dash-user-guide-components/src/DashUserGuideComponents.jl:12
 [2] run_repl(::REPL.AbstractREPL, ::Any) at /build/julia/src/julia-1.5.2/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:288
during initialization of module DashUserGuideComponents

julia> using Dash

julia> using DashUserGuideComponents
```

If that's true, we'll just have to be careful to note this in the documentation since it may cause some confusion otherwise. Closing.
Hmm, so dugc is trying to import DashBase? It shouldn’t, it should get the base component class from Dash instead. 
@waralex if I'm understanding this correctly we just need to have `DashBase` in these lines:

https://github.com/plotly/dash/blob/938c3cae72bc66b5f6de9610573f7834569acbfa/dash/development/_jl_components_generation.py#L62-L63

https://github.com/plotly/dash/blob/938c3cae72bc66b5f6de9610573f7834569acbfa/dash/development/_jl_components_generation.py#L92

swap to `Dash` based on whether we're building a core or non-core package, right?

https://github.com/plotly/dash/blob/938c3cae72bc66b5f6de9610573f7834569acbfa/dash/development/_jl_components_generation.py#L363-L364
This is pretty weird, I'm trying to figure out what the problem is
@alexcjohnson I think we can close this one once Dash.jl is updated via the Registrator, at least on my end the error no longer appears in v0.1.3.

Resolving patch:
diff --git a/dash/development/_jl_components_generation.py b/dash/development/_jl_components_generation.py
--- a/dash/development/_jl_components_generation.py
+++ b/dash/development/_jl_components_generation.py
@@ -84,9 +84,14 @@
 
 [compat]
 julia = "1.2"
-{base_package} = "0.1"
+{base_package} = "{base_version}"
 """
 
+jl_base_version = {
+    "Dash": "0.1.3",
+    "DashBase": "0.1",
+}
+
 jl_component_include_string = 'include("{name}.jl")'
 
 jl_resource_tuple_string = """DashBase.Resource(
@@ -417,12 +422,15 @@ def generate_toml_file(project_shortname, pkg_data):
         'authors = ["{}"]\n'.format(package_author) if package_author else ""
     )
 
+    base_package = base_package_name(project_shortname)
+
     toml_string = jl_projecttoml_string.format(
         package_name=package_name,
         package_uuid=package_uuid,
         version=project_ver,
         authors=authors_string,
-        base_package=base_package_name(project_shortname),
+        base_package=base_package,
+        base_version=jl_base_version[base_package],
         dash_uuid=base_package_uid(project_shortname),
     )
     file_path = "Project.toml"


Test patch: