Git Product home page Git Product logo

Comments (3)

waralex avatar waralex commented on May 17, 2024

I experimented with dependencies and found out that I didn’t have a very good idea of how they worked in Julia. There is much to discuss.
First of all, if Dash has dependency DashHtmlComponents, this does not mean that the user will be able to do using DashHtmlComponents after Pkg.add("Dash"), as we probably expected. The user still needs to do Pkg.add("DashHtmlComponents") . This dependency means that the version that fits Dash will be added by default to current environment at Pkg.add("DashHtmlComponents"). If the user tries to install an incompatible version, he will get an error. On the other hand, if DashHtmlComponents are already added to the current environment and the user tries to add Dash whose dependencies these components do not satisfy, he will also get an error. (edited)

It works, as I understand it, in the following way. Julia can store multiple versions of packages at the system level, and each environment has a Manifest.toml file that specifies which version of the package is used in this environment.
Pkg.add adds the package to the namespace. Checks its dependencies with other dependencies in the current environment and writes versions for all dependencies to the manifest, or returns an error if there is an unresolved version conflict. The dependencies themselves are not added to the namespace.

Therefore, 2 solutions seem to be suitable for solving our problem.

  • Include the component code itself in the package as submodules and export them to an external namespace
  • Add a DashBase package, reverse dependencies, and leave the components as separate packages, but again export them from Dash to an external namespace, something like:
using DashHtmlComponents
export .DasHtmlComponents

in Dash.jl file

In both cases, the user can include components using one of the following methods:

using Dash.DashHtmlComponents

or

using Dash
using .DashHtmlComponents

from dash.jl.

Byrth avatar Byrth commented on May 17, 2024

I would suggest looking into the Artifact system. It would restrict your compatibility to Julia 1.3+, but it should solve this problem even though your package isn't registered in JuliaRegistries/General.

As a basic overview of Artifacts, you can define the artifact name, git-tree-sha1 (for the right version) and download URL. It is intended to be used for non-Julia resources like your DashCoreComponents. Here is an example from Timezones.jl, which downloads a lot of artifacts. This also should make your project absolute path independent, which would make apps including dashboards easier to ship.

from dash.jl.

rpkyle avatar rpkyle commented on May 17, 2024

@waralex has successfully addressed this following his work on creating and loading DashBase.jl, so I believe that I may close this one as resolved.

from dash.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.