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

Dash R 0.9.1 release #272

Merged
merged 68 commits into from Oct 13, 2021
Merged

Dash R 0.9.1 release #272

merged 68 commits into from Oct 13, 2021

Conversation

HammadTheOne
Copy link
Contributor

@HammadTheOne HammadTheOne commented Oct 3, 2021

This PR merges in the changes from dev to master and updates the package, including the DESCRIPTION and CHANGELOG, in preparation for the Dash R 1.0 release to Github and CRAN.

  • Update CHANGELOG with updates based on commit history.
  • Run checks and update package for CRAN submission.

@daattali

rpkyle and others added 30 commits August 3, 2020 13:27
Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com>
Relocate metadata fixup logic from config.yml to R script
* Testing initial implementation

* More testing

* Callback Context Updates

* Updating callback context logic

* Fixing callback returns

* Adding callback args conditional

* Cleanup and additional changes to callback value conditionals

* Comment cleanup

* Added PMC callback validation, removed unnecessary code

* Update R/dependencies.R

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update R/dependencies.R

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update R/dependencies.R

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update R/dependencies.R

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Added build to gitignore

* Updated dependencies.R

* Update boilerplate docs and add wildcard symbols

* Drying up validation code and applying symbol logic

* Update test to use symbols

* Cleaned up code and added allsmaller test example

* Cleaning up redundant code

* Update FUNDING.yml

* Updated callback_args logic and example

* Adding basic unittests, updated validation

* Fixed response for MATCH callbacks

* Added integration test and updated examples for docs

* Added additional integration test

* Formatting and cleanup

* update docs

* Update to-do app

* Add comments to examples

* Change empy vector to character type.

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update boilerplate text.

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update tests/integration/callbacks/test_pattern_matching.py

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update tests/integration/callbacks/test_pattern_matching.py

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update tests/integration/callbacks/test_pattern_matching.py

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update tests/integration/callbacks/test_pattern_matching.py

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update tests/integration/callbacks/test_pattern_matching.py

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update tests/testthat/test-wildcards.R

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update wildcards_test.R

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update wildcards_test.R

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update wildcards_test.R

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update wildcards_test.R

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update wildcards_test.R

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update wildcards_test.R

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update wildcards_test.R

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Update wildcards_test.R

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>

* Removed triple colon syntax

* Use seq_along and remove unnecessary unittest

* Update CHANGELOG.md

* Update CHANGELOG.md

* Add support for arbitrary and sorted keys

* Whitespace deleted

* Added integration tests

* Fixing test output

* Fixing flakiness

* Update test_pattern_matching.py

* Update test_pattern_matching.py

* Updating boilerplate text and test with generalized keys

* Minor test fixes

Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>
Co-authored-by: Nicolas Kruchten <nicolas@plot.ly>
Co-authored-by: rpkyle <ryan@plotly.com>
* Fixing NULL error with glue interpolation

* Update utils.R

* Update utils.R
* bump dash-renderer to v1.8.2

* Update CHANGELOG.md

* add note about update to dash-renderer

* Fixing flaky test
Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com>
Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com>
Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com>
Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com>
Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com>
Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com>
* Update setCallbackContext

* Adding graphs test

* Slight fix

* bump version and update CHANGELOG

* Less flaky test

Co-authored-by: rpkyle <ryan@plotly.com>
@daattali
Copy link
Contributor

daattali commented Oct 7, 2021

  • Don't namespace dash:: inside the dash package - it's redundant and confusing (I saw a few such cases in /tests/manual/ and in documentation, there might be others)
  • I would prefer to combine all the HTML components (htmlDiv, htmlBr, etc) into one file, and similarly all the interactive components (dcc*) into another file. This way will dramatically reduc ethe number of source files clutter
  • I suggest updating the DESCRIPTION to use testthat version >3.0.0 , and then removing all context() calls from the test files (it's deprecated)
  • The tests/circleci/fixup_metadata.R file should either be removed or moved to an appropriate folder
  • In the dashCoreComponents package, the second argument of many components was value. Now the arguments are alphabetical and value has been moved to the last. This is a breaking change, and I strongly believe it should be fixed because having value as the second argument makes sense so that you don't have to always explicitly name it. @alexcjohnson @jackparmer this is now an issue with this package but this package is affected - where should I open an issue for this?
  • The check that all states come after all inputs can be removed using the new flexible callback syntax

    dashR/R/utils.R

    Lines 378 to 381 in 5c80285

    # Verify that 'input' parameters always precede 'state', if present
    if (!(valid_seq(params))) {
    stop(sprintf("Strict ordering of callback handler parameters is required. Please ensure that input parameters precede all state parameters."), call. = FALSE)
    }
  • This is perhaps not directly related to this PR, but should be fixed: using input() instead of output() inside callbacks works. It shouldn't. There should be a check that anything supplied to the callback outputs is actually of class "output"

Let me know when the package is ready for re-testing

DESCRIPTION Outdated
@@ -25,7 +25,7 @@ Imports:
rlang,
utils
Suggests:
testthat,
testthat (>= 3.1.0),
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't even know there was a 3.1.0! Looks like it only got released a couple days ago. I think 3.0.0 would be just fine too

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
testthat (>= 3.1.0),
testthat (>= 3.0.0),

@daattali
Copy link
Contributor

daattali commented Oct 7, 2021

I see that all dash:: have been removed 👍 Similarly, in test files the dash::: can/should be removed

@HammadTheOne
Copy link
Contributor Author

HammadTheOne commented Oct 8, 2021

Don't namespace dash:: inside the dash package - it's redundant and confusing (I saw a few such cases in /tests/manual/ and in documentation, there might be others)

Fixed in d419517 and 3aa7abd.

I would prefer to combine all the HTML components (htmlDiv, htmlBr, etc) into one file, and similarly all the interactive components (dcc*) into another file. This way will dramatically reduce the number of source files clutter

Concatenated components into package R scripts in cb93cdb. Note, this change requires the merge of plotly/dash#1798 to make this a streamlined process, and also address the NAMESPACE generation with devtools::document(). I'd also like to rebuild the package one more time with the npm run update command once that PR is merged to update the component packages.

I suggest updating the DESCRIPTION to use testthat version >3.0.0 , and then removing all context() calls from the test files (it's deprecated)

Updated in aff9b99.

The tests/circleci/fixup_metadata.R file should either be removed or moved to an appropriate folder

Removed in 0ad3b24.

In the dashCoreComponents package, the second argument of many components was value. Now the arguments are alphabetical and value has been moved to the last. This is a breaking change, and I strongly believe it should be fixed because having value as the second argument makes sense so that you don't have to always explicitly name it. @alexcjohnson @jackparmer this is now an issue with this package but this package is affected - where should I open an issue for this?

I think the most appropriate repo for this issue would be in dash, with a label for dashCoreComponents.

The check that all states come after all inputs can be removed using the new flexible callback syntax

Removed in 68427b3.

This is perhaps not directly related to this PR, but should be fixed: using input() instead of output() inside callbacks works. It shouldn't. There should be a check that anything supplied to the callback outputs is actually of class "output"

Fixed with 68427b3.

Copy link
Contributor

@daattali daattali left a comment

Choose a reason for hiding this comment

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

Suggestions/comments below. There are also still a few dash::: - in the test-components.R test file

DESCRIPTION Outdated
@@ -25,7 +25,7 @@ Imports:
rlang,
utils
Suggests:
testthat,
testthat (>= 3.1.0),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
testthat (>= 3.1.0),
testthat (>= 3.0.0),

R/utils.R Outdated
Comment on lines 368 to 372
if (!is.list(output[[1]])){output <- list(output)}
invalid_outputs <- vapply(output, function(x) {
!any(c('output', 'state') %in% attr(x, "class"))
}, FUN.VALUE=logical(1))

Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure this is the correct behaviour? I think outputs must only be of class "output", not "state"

R/utils.R Outdated
Comment on lines 383 to 385
# Verify that output contains no elements that are not either members of 'output' or 'state' classes
if (any(invalid_outputs)) {
stop(sprintf("Callback outputs must be outputs or states. Please verify formatting of callback outputs."), call. = FALSE)
Copy link
Contributor

Choose a reason for hiding this comment

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

If my above comment is correct, then this needs to update too

@HammadTheOne
Copy link
Contributor Author

Thanks for the sharp eye and feedback @daattali! I think I've removed all the references to the internal dash namespace now, and I've updated the broken tests (which were setting a named list for the output instead of calling the output function itself).

At Jack's suggestion, I'm also going to be adding the Dash Bootstrap Components library into the Dash R namespace. I'll do that in a separate PR, we're already pushing the scope of this one a little far.

@daattali
Copy link
Contributor

Awesome!

Do the CI checks run the unit tests, and that's why they failed previously? It looks like there's a build step in CircleCI , I assume that part of that includes running the tests, but I'm not able to see it since I don't have access to that account.

I think this PR is ready except for the breaking change of the order of parameters to dcc components changed. I think we should wait until we decide what to do about that, whether we'll fix it directly at the R level or higher up the chain

HammadTheOne and others added 2 commits October 12, 2021 15:49
* Adding dbc to dashR namespace

* updated gitignore

* Adding dbc docs and updating gulpfile

* Updating test with dbc

* Moved misc tests and added dbc snapshot

* Fixing test

* fixing id

* Fixed export and test
@HammadTheOne
Copy link
Contributor Author

HammadTheOne commented Oct 13, 2021

@daattali I've reverted the prop order to the original unsorted order for the time being. We can talk about that more in detail next week, but if everything else looks good I think this should be ready to merge at this point.

@HammadTheOne HammadTheOne merged commit f0a2826 into master Oct 13, 2021
@daattali
Copy link
Contributor

I'll test it again soon will let you know today

@HammadTheOne HammadTheOne changed the title Dash R 0.6.0 release Dash R 0.9.1 release Oct 13, 2021
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

Successfully merging this pull request may close these issues.

None yet

3 participants