-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add support for user-defined server routes #225
Conversation
This looks great - much nicer than the existing interface. I'm not sure about the utility of Redirects seem to be a primary use case here, so we may as well make them even easier:
I notice in dash-docs we also have some parametrized redirects - in as far as these are simply replacing the head of the path and keeping the tail intact there may be some syntax we could use like:
|
OK, I have added a note on the usage of |
e38f523
to
df49e5c
Compare
024e116
to
8ced8ff
Compare
@alexcjohnson I did change the terminology in this feature to use |
added in 8ced8ff
I think the parameterized redirects you describe are already supported by https://github.com/thomasp85/routr/blob/ca37cc8c57ee644966fbba2cacd40646b9bcf2bd/R/route.R#L8-L15 I went ahead and added some examples to demonstrate this functionality within the online help, though. @alexcjohnson Whoops, 🙈 I accidentally edited your comment instead of mine. I managed to restore it, I think, so hopefully the flow makes sense again. |
b6589ed
to
7cde03f
Compare
4d6c27d
to
00305a5
Compare
R/dash.R
Outdated
"handler" = handler, | ||
"methods" = methods) | ||
|
||
self$server$set_data("user-routes", user_routes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could possibly 🌴 a little more by calling self$server_route
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexcjohnson Definitely, not sure why I didn't think of that but your suggestions have really helped to clean up the implementation. app$redirect
is looking nice and lean now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! Just one minor comment, this looks great. 💃
1f3e838
to
b4bd677
Compare
* New feature: callback graph improvements and timing (#224) * New feature: support user-defined server routes and redirects (#225) * Enable setting script and stylesheet attributes (#226) * New feature: Pattern-Matching Callbacks (#228) * Authenticate on pulls from Docker Hub (#231) * Fixed a bug in the usage of glue (#233) * Update dash-renderer to v1.8.2 (#234) Co-authored-by: HammadTheOne <hammadkhan@plotly.com>
* contribute test script * remove version updating in DESCRIPTION * fix EOL Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * Add support for user-defined server routes (#225) * Provide support for script and stylesheet attributes (#226) * Authenticate on pulls from Docker Hub (#231) * Add support for callback graph improvements and timing (#224) * Update CHANGELOG.md * 189 - Add Pattern Matching Callbacks for Dash R (#228) * 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::glue interpolation (#233) * Fixing NULL error with glue interpolation * Update utils.R * Update utils.R * Update CHANGELOG.md * Update dash-renderer to v1.8.2 (#234) * bump dash-renderer to v1.8.2 * Update CHANGELOG.md * add note about update to dash-renderer * Fixing flaky test * bump package version to v0.8.0 * Update R/dash.R Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * Update tests/testthat/test-wildcards.R Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * Update DESCRIPTION Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * add PMC example * update documentation * update CHANGELOG release date * 🔨 PMC docs refactor * Update tests/integration/callbacks/test_pattern_matching.py Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * Update tests/integration/callbacks/test_pattern_matching.py Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * Update tests/integration/callbacks/test_pattern_matching.py Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * add import of glue * add glue to imports.R * fix line length issue * Fix setCallbackContext for wildcard and ordinary inputs (#237) * Update setCallbackContext * Adding graphs test * Slight fix * bump version and update CHANGELOG * Less flaky test Co-authored-by: rpkyle <ryan@plotly.com> * bump dependency versions * update CHANGELOG * update dash-renderer to v1.8.3 * update CHANGELOG * Favicon fix (#240) * Adding default favicon * Removing redundant codeblock * Added default favicon * Minor fix to requests prefix * Update CHANGELOG.md Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com> * Added simple test * Fixed typo * Fixed typo Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com> * Remove context reference from CircleCI (#241) * Dash R Core Package Unification (#243) * Initialize npm and gulpfile in repo * Adding directory structure * Initial implementation of unification script * Minor grep fixes * Fixed DESCRIPTION imports * Added updated dash-table deps * Regex for version numbers * Cut import entries from NAMESPACE * Remove && include(dashr) * Removing gulp-asset artifacts and rebuilding complete package * Removing unnecessary files * fix: remove html, core pkgs from tests * fix: update script tags unit test * Revert R6 import * Add temporary collate * Update README examples * Scrubbing imports * More import scrubbing * Package development updates * Update gitignore and namespace * Updated gulpfile jobs * Updated all dependencies * Added templates for namespace/internal exports * Update internal, namespace, and gulpfile cleanup * Fix dependency sourcing * Linting * Adding job for asset retrieval and deletion * Minor src change * Added error handling * Fixing favicon bug * chore: use shallow clone Co-authored-by: Ryan Patrick Kyle <ryan@plotly.com> * Added deprecation warning if dcc, html, or table packages are attached (#249) * Added deprecation warning * Update R/dash.R Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com> Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com> * Update `highlight.js` dependency for dash-table (#262) * Updating gulpfile * Updating dependencies for dash components * Updated highlight.js dependency source * Add Dash 2 layout syntax wrappers and html tags (#265) * Added add_meta helper * Add helper functions and export pipe * Adding in tags wrapper * Updating ci config * Updated CHANGELOG * Updated circleci to include rust package manager (cargo). * Removed dashr command in circleci config. * Updating changelog * added basic test * Cleaning up Dash 2 references and duplication * Updated documentation * Allow conditional UI * Add meta tag check * More cleanup * Last bit of cleanup Co-authored-by: Steve Sperandeo <steve.sperandeo@gmail.com> * Fix suppress_callback_exceptions config (#268) * Add config key * Fixing CI * Simplified callback syntax and addtional utility functions (#270) * Tag updates * Added RStudio dash snippet * Added simple_table * Added flexible callbacks * Documentation and NAMESPACE updates * Updated DESCRIPTION * Adding unittests * Adding context tags to tests * Updated CHANGELOG * Update monorepo and rebuild package (#271) * Updating gulpfile and package.json * More package.json and linting updates * Adding in simplified callback updates/tests * Import fixes * Updating package.json * Gulpfile script changes * Gulpfile updates * Rebuilding package with monorepo updates * Re-running test * Updating unittest * Updating test dependencies * Updating DESCRIPTION and .Rbuildignore forchecks * Updating function descriptions and NAMESPACE imports * Fixed examples and updated docs * Updating version * Remove references to dash namespace within package * Update testthat and remove deprecated context calls * Removed fixup_metadata.R * Removing more dash namespace references * Concatenating component function files * Updating checks * Merging components into package R files * Fixing check * More package cleanup * testthat 3.0.0 * Rebuilding package * Fixed conditional for multiple outputs * Fix no_update test * Fixing callback_instrumentation test * Fixing unit test * Added DBC to Dash R package (#273) * 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 * Reverting sorted prop order * Checks updates * Re-running test Co-authored-by: Ryan Patrick Kyle <ryan@plot.ly> 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> Co-authored-by: Steve Sperandeo <steve.sperandeo@gmail.com>
* contribute test script * remove version updating in DESCRIPTION * fix EOL Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * Add support for user-defined server routes (#225) * Provide support for script and stylesheet attributes (#226) * Authenticate on pulls from Docker Hub (#231) * Add support for callback graph improvements and timing (#224) * Update CHANGELOG.md * 189 - Add Pattern Matching Callbacks for Dash R (#228) * 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::glue interpolation (#233) * Fixing NULL error with glue interpolation * Update utils.R * Update utils.R * Update CHANGELOG.md * Update dash-renderer to v1.8.2 (#234) * bump dash-renderer to v1.8.2 * Update CHANGELOG.md * add note about update to dash-renderer * Fixing flaky test * bump package version to v0.8.0 * Update R/dash.R Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * Update tests/testthat/test-wildcards.R Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * Update DESCRIPTION Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * add PMC example * update documentation * update CHANGELOG release date * 🔨 PMC docs refactor * Update tests/integration/callbacks/test_pattern_matching.py Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * Update tests/integration/callbacks/test_pattern_matching.py Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * Update tests/integration/callbacks/test_pattern_matching.py Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * add import of glue * add glue to imports.R * fix line length issue * Fix setCallbackContext for wildcard and ordinary inputs (#237) * Update setCallbackContext * Adding graphs test * Slight fix * bump version and update CHANGELOG * Less flaky test Co-authored-by: rpkyle <ryan@plotly.com> * bump dependency versions * update CHANGELOG * update dash-renderer to v1.8.3 * update CHANGELOG * Favicon fix (#240) * Adding default favicon * Removing redundant codeblock * Added default favicon * Minor fix to requests prefix * Update CHANGELOG.md Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com> * Added simple test * Fixed typo * Fixed typo Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com> * Remove context reference from CircleCI (#241) * Dash R Core Package Unification (#243) * Initialize npm and gulpfile in repo * Adding directory structure * Initial implementation of unification script * Minor grep fixes * Fixed DESCRIPTION imports * Added updated dash-table deps * Regex for version numbers * Cut import entries from NAMESPACE * Remove && include(dashr) * Removing gulp-asset artifacts and rebuilding complete package * Removing unnecessary files * fix: remove html, core pkgs from tests * fix: update script tags unit test * Revert R6 import * Add temporary collate * Update README examples * Scrubbing imports * More import scrubbing * Package development updates * Update gitignore and namespace * Updated gulpfile jobs * Updated all dependencies * Added templates for namespace/internal exports * Update internal, namespace, and gulpfile cleanup * Fix dependency sourcing * Linting * Adding job for asset retrieval and deletion * Minor src change * Added error handling * Fixing favicon bug * chore: use shallow clone Co-authored-by: Ryan Patrick Kyle <ryan@plotly.com> * Added deprecation warning if dcc, html, or table packages are attached (#249) * Added deprecation warning * Update R/dash.R Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com> Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com> * Update `highlight.js` dependency for dash-table (#262) * Updating gulpfile * Updating dependencies for dash components * Updated highlight.js dependency source * Add Dash 2 layout syntax wrappers and html tags (#265) * Added add_meta helper * Add helper functions and export pipe * Adding in tags wrapper * Updating ci config * Updated CHANGELOG * Updated circleci to include rust package manager (cargo). * Removed dashr command in circleci config. * Updating changelog * added basic test * Cleaning up Dash 2 references and duplication * Updated documentation * Allow conditional UI * Add meta tag check * More cleanup * Last bit of cleanup Co-authored-by: Steve Sperandeo <steve.sperandeo@gmail.com> * Fix suppress_callback_exceptions config (#268) * Add config key * Fixing CI * Simplified callback syntax and addtional utility functions (#270) * Tag updates * Added RStudio dash snippet * Added simple_table * Added flexible callbacks * Documentation and NAMESPACE updates * Updated DESCRIPTION * Adding unittests * Adding context tags to tests * Updated CHANGELOG * Update monorepo and rebuild package (#271) * Updating gulpfile and package.json * More package.json and linting updates * Adding in simplified callback updates/tests * Import fixes * Updating package.json * Gulpfile script changes * Gulpfile updates * Rebuilding package with monorepo updates * Re-running test * Updating unittest * Updating test dependencies * Updating DESCRIPTION and .Rbuildignore forchecks * Updating function descriptions and NAMESPACE imports * Fixed examples and updated docs * Updating version * Remove references to dash namespace within package * Update testthat and remove deprecated context calls * Removed fixup_metadata.R * Removing more dash namespace references * Concatenating component function files * Updating checks * Merging components into package R files * Fixing check * More package cleanup * testthat 3.0.0 * Rebuilding package * Fixed conditional for multiple outputs * Fix no_update test * Fixing callback_instrumentation test * Fixing unit test * Added DBC to Dash R package (#273) * 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 * Reverting sorted prop order * Checks updates * Re-running test * Remove html exports and update tags (#274) * Updating tags and html exports * Re-running tests * Updating tag generation * Re-running tests * Updating tests to use new html list syntax * Adjusting tests * Re-run tests again * Updating tests * Wrapping up test fixes * Percy test Co-authored-by: Ryan Patrick Kyle <ryan@plot.ly> 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> Co-authored-by: Steve Sperandeo <steve.sperandeo@gmail.com>
* contribute test script * remove version updating in DESCRIPTION * fix EOL Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * Add support for user-defined server routes (#225) * Provide support for script and stylesheet attributes (#226) * Authenticate on pulls from Docker Hub (#231) * Add support for callback graph improvements and timing (#224) * Update CHANGELOG.md * 189 - Add Pattern Matching Callbacks for Dash R (#228) * 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::glue interpolation (#233) * Fixing NULL error with glue interpolation * Update utils.R * Update utils.R * Update CHANGELOG.md * Update dash-renderer to v1.8.2 (#234) * bump dash-renderer to v1.8.2 * Update CHANGELOG.md * add note about update to dash-renderer * Fixing flaky test * bump package version to v0.8.0 * Update R/dash.R Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * Update tests/testthat/test-wildcards.R Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * Update DESCRIPTION Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * add PMC example * update documentation * update CHANGELOG release date * 🔨 PMC docs refactor * Update tests/integration/callbacks/test_pattern_matching.py Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * Update tests/integration/callbacks/test_pattern_matching.py Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * Update tests/integration/callbacks/test_pattern_matching.py Co-authored-by: HammadTheOne <30986043+HammadTheOne@users.noreply.github.com> * add import of glue * add glue to imports.R * fix line length issue * Fix setCallbackContext for wildcard and ordinary inputs (#237) * Update setCallbackContext * Adding graphs test * Slight fix * bump version and update CHANGELOG * Less flaky test Co-authored-by: rpkyle <ryan@plotly.com> * bump dependency versions * update CHANGELOG * update dash-renderer to v1.8.3 * update CHANGELOG * Favicon fix (#240) * Adding default favicon * Removing redundant codeblock * Added default favicon * Minor fix to requests prefix * Update CHANGELOG.md Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com> * Added simple test * Fixed typo * Fixed typo Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com> * Remove context reference from CircleCI (#241) * Dash R Core Package Unification (#243) * Initialize npm and gulpfile in repo * Adding directory structure * Initial implementation of unification script * Minor grep fixes * Fixed DESCRIPTION imports * Added updated dash-table deps * Regex for version numbers * Cut import entries from NAMESPACE * Remove && include(dashr) * Removing gulp-asset artifacts and rebuilding complete package * Removing unnecessary files * fix: remove html, core pkgs from tests * fix: update script tags unit test * Revert R6 import * Add temporary collate * Update README examples * Scrubbing imports * More import scrubbing * Package development updates * Update gitignore and namespace * Updated gulpfile jobs * Updated all dependencies * Added templates for namespace/internal exports * Update internal, namespace, and gulpfile cleanup * Fix dependency sourcing * Linting * Adding job for asset retrieval and deletion * Minor src change * Added error handling * Fixing favicon bug * chore: use shallow clone Co-authored-by: Ryan Patrick Kyle <ryan@plotly.com> * Added deprecation warning if dcc, html, or table packages are attached (#249) * Added deprecation warning * Update R/dash.R Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com> Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com> * Update `highlight.js` dependency for dash-table (#262) * Updating gulpfile * Updating dependencies for dash components * Updated highlight.js dependency source * Add Dash 2 layout syntax wrappers and html tags (#265) * Added add_meta helper * Add helper functions and export pipe * Adding in tags wrapper * Updating ci config * Updated CHANGELOG * Updated circleci to include rust package manager (cargo). * Removed dashr command in circleci config. * Updating changelog * added basic test * Cleaning up Dash 2 references and duplication * Updated documentation * Allow conditional UI * Add meta tag check * More cleanup * Last bit of cleanup Co-authored-by: Steve Sperandeo <steve.sperandeo@gmail.com> * Fix suppress_callback_exceptions config (#268) * Add config key * Fixing CI * Simplified callback syntax and addtional utility functions (#270) * Tag updates * Added RStudio dash snippet * Added simple_table * Added flexible callbacks * Documentation and NAMESPACE updates * Updated DESCRIPTION * Adding unittests * Adding context tags to tests * Updated CHANGELOG * Update monorepo and rebuild package (#271) * Updating gulpfile and package.json * More package.json and linting updates * Adding in simplified callback updates/tests * Import fixes * Updating package.json * Gulpfile script changes * Gulpfile updates * Rebuilding package with monorepo updates * Re-running test * Updating unittest * Updating test dependencies * Updating DESCRIPTION and .Rbuildignore forchecks * Updating function descriptions and NAMESPACE imports * Fixed examples and updated docs * Updating version * Remove references to dash namespace within package * Update testthat and remove deprecated context calls * Removed fixup_metadata.R * Removing more dash namespace references * Concatenating component function files * Updating checks * Merging components into package R files * Fixing check * More package cleanup * testthat 3.0.0 * Rebuilding package * Fixed conditional for multiple outputs * Fix no_update test * Fixing callback_instrumentation test * Fixing unit test * Added DBC to Dash R package (#273) * 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 * Reverting sorted prop order * Checks updates * Re-running test * Remove html exports and update tags (#274) * Updating tags and html exports * Re-running tests * Updating tag generation * Re-running tests * Updating tests to use new html list syntax * Adjusting tests * Re-run tests again * Updating tests * Wrapping up test fixes * Percy test * CRAN submission updates * Fix callback outputs with short ID's (#280) * CRAN submission updates * Callback output ID validation fixes * Updating duplicate callbacks test * Security updates * Update R/utils.R Co-authored-by: Dean Attali <dean@attalitech.com> * Updating error message Co-authored-by: Dean Attali <dean@attalitech.com> * Updating README link Co-authored-by: Ryan Patrick Kyle <ryan@plot.ly> 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> Co-authored-by: Steve Sperandeo <steve.sperandeo@gmail.com> Co-authored-by: Dean Attali <dean@attalitech.com>
This PR proposes to address #131, in order that Dash for R users may be able to create and modify routes as is currently possible in Dash for Python, thanks to Flask's customizable routing. Fiery supports routing "plugins", but it can be complicated to use them, or modify routes that already exist (see below). Two new methods are proposed in Dash for R:
server_route
: this method registers a new URL rule, as described by itsmethods
,url
andhandler
functionredirect
: this method can be used to redirect a path (single, or parameterized/with wildcards) to another path, as the handler is specified internally and returns a301
(Moved Permanently) status within the responseSince Dash for R lacks the support for decorator methods that Python provides, the
handler
argument allows matching a handler function with a URL to be routed. In brief, theserver_route
method registers the URL routing information viaself$server$set_data("user-routes")
. Upon invokingapp$run_server
, Dash checks whether anyuser-routes
are defined; if one or more routes exists, a plugin is generated on the fly, to insert all the routes in the order they were defined. Finally, the plugin is attached to the running server object. This process is repeated when the server shuts down/is aborted and restarted. The routing information remains intact, as it was stored viaset_data
.The proposed changes are a compromise between making the code succinct and continuing to take advantage of
routr
features, while making it easier for users to add/remove routes and find documentation for this feature generally.Previous interface
Proposed interface
The
redirect
method provides a simplification of the above:To do:
app$redirect
in lieu of a string for thenew_path
argument, which would be evaluated as a string withinapp$redirect
's internal handler