Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anatomy of a Dash component library #119

Open
xhluca opened this issue Feb 15, 2021 · 2 comments
Open

Anatomy of a Dash component library #119

xhluca opened this issue Feb 15, 2021 · 2 comments

Comments

@xhluca
Copy link

xhluca commented Feb 15, 2021

When we look at the root of the generated component library, we notice a lot of files from various aspects of Dash. We will have files related to

  • JS (.eslintrc, src/, index.html),
  • webpack (webpack.config.js, webpack.serve.config.js),
  • npm (package.json, .npmignore, package-lock.json),
  • R (.Rbuildignore, R/, inst/deps/),
  • Julia (src/),
  • pypi (MANIFEST.in, setup.py)
  • docs (.md files)
  • etc.

Although you get a hang of what each file does after a while, I think it might be a bit disorienting for a beginner, especially since the files span 4 different languages. It would be nice to have a md doc describing what each file does, whether you will need to worry about it not. The doc could be grouped by language (Python, R, JS, Julia).

Thoughts on this?

@xhluca
Copy link
Author

xhluca commented Aug 16, 2021

To expand on this, if there's some way to move all files related to a directory, that'd make the repo much cleaner, e.g.:

js_dev/
  .eslintrc
  demo/
    App.js
    index.js
  index.html
  .npmignore
  webpack.config.js
  webpack.serve.config.js
  package-lock.json
  package.json
  ...

jl_dev/
  MyDashComponent.jl
  ...

r_dev/
  .Rbuildignore/
  ...

py_dev/
  tests/
  venv/
  demos/
  usage.py

dash_builds/
  my_dash_component/
  R/
  inst/deps
  man/
  NAMESPACE

This is a simple way for everyone to understand which files you are supposed to edit if you are building a component for a certain language, and you can also ignore dash_builds if you don't want to commit auto-generated files. Also it will result in significantly less files in the root directory (I don't use 80% of them most of the time)

@xhluca
Copy link
Author

xhluca commented Aug 16, 2021

Or perhaps we can adopt the CRA approach: a root level public/ directory for files that should be included in the build/.

Then we can additionally have a public/ directory inside each *_dev directory that add to/overrides the files in public/ in the final build/. We could have a structure like this:

js_dev/
  public/
    my_file.js
  ...

py_dev/
  public/
    setup.py

jl_dev/
  public/
     custom.jl

r_dev/
  public/
    .RBuildignore

public/
  LICENSE
  README.md

# Auto-generated:
build/
  python/
    README.md
    LICENSE
    setup.py
  r/
    README.md
    LICENSE
    .Rbuildignore
  jl/
    README.md
    LICENSE
    custom.jl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant