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

Refactor Dash.jl to support same parameters as Dash for Python & R #12

Merged
merged 6 commits into from
Apr 26, 2020

Conversation

waralex
Copy link
Collaborator

@waralex waralex commented Apr 17, 2020

Partial implementation of the issue #4
Added to config:

  • assets_url_path
  • assets_ignore
  • requests_pathname_prefix
  • routes_pathname_prefix
  • serve_locally
  • suppress_callback_exceptions
  • eager_loading
  • meta_tags
  • index_string
  • assets_external_path
  • include_assets_files
  • show_undo_redo

Implemented and added to tests behavior for:

  • assets_url_path
  • requests_pathname_prefix
  • routes_pathname_prefix
  • suppress_callback_exceptions
  • meta_tags
  • index_string
  • show_undo_redo

It makes sense to deal with parameters related to resource collection and management (assets_ignore, include_assets_files, serve_locally, eager_loading) simultaneously with the new component generation system, because as part of this task, I will need to re-create the resource storage system.

The server-related parameters (server and compression) will also be implemented as a separate issue, because to do this, I need to learn more about the HTTP.jl package

@github-actions github-actions bot added enhancement New feature or request tests labels Apr 17, 2020
@rpkyle rpkyle self-requested a review April 17, 2020 14:59
Copy link
Contributor

@rpkyle rpkyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@waralex Wow, this is really coming along! I've made a few initial comments, but I'll also run locally and take a look while running some of the sample code.

This PR will be a big leap in the right direction where the Dash.jl API is concerned, at least in terms of parity with the existing backend implementations.

src/app.jl Show resolved Hide resolved
src/ComponentPackages.jl Show resolved Hide resolved
src/app.jl Outdated Show resolved Hide resolved
callable_components ::Dict{Symbol, Component}

DashApp(name::String, config::DashConfig) = new(name, config, Layout(nothing), Dict{Symbol, Callback}(), Dict{Symbol, Component}())

end

function layout!(app::DashApp, component::Component)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@waralex I imagine this function updates the layout within app to include the tree of components that are passed? If that's the case, does layout support passing a function that returns a component?

i.e. in both Python and R, I believe, the layout can be passed a tree of components or a single function. for example:

    def _layout_value(self):
        return self._layout() if self._layout_is_function else self._layout

or

    layout = function(...) {
      private$layout_ <- if (is.function(..1)) ..1 else list(...)
      invisible(private$layout_render())
    },

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rpkyle function is not supported yet, so you can add it to issues list so I don't forget it later

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@waralex Added in #15.

src/app.jl Show resolved Hide resolved
src/index_page.jl Outdated Show resolved Hide resolved
src/index_page.jl Outdated Show resolved Hide resolved
src/utils.jl Outdated Show resolved Hide resolved
src/utils.jl Show resolved Hide resolved
test/config_functional.jl Show resolved Hide resolved
waralex and others added 4 commits April 24, 2020 15:19
Co-Authored-By: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>
Co-Authored-By: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>
Co-Authored-By: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>
@rpkyle
Copy link
Contributor

rpkyle commented Apr 26, 2020

I decided to take a stab at HTTP compression in #14, so hopefully that will help with a small portion of the HTTP.jl work. Otherwise, this looks great. Onward to the next set of challenges! 💃

@rpkyle rpkyle self-requested a review April 26, 2020 06:03
@waralex waralex merged commit 05d4fc6 into dev Apr 26, 2020
@rpkyle rpkyle added this to Done in Dash for Julia Apr 27, 2020
@etpinard etpinard deleted the dash_arguments_refactor branch June 13, 2023 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tests
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants