-
Notifications
You must be signed in to change notification settings - Fork 3
Deprecate external link and reactable to reuse from shinyGovstyle #124
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #124 +/- ##
==========================================
- Coverage 65.54% 63.70% -1.84%
==========================================
Files 15 15
Lines 1364 1295 -69
==========================================
- Hits 894 825 -69
Misses 470 470 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
rmbielby
left a comment
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.
One question in the comments and then main thought is around the deprecation warnings for dfeshiny functions using these deprecated functions. I've not got much familiarity with deprecation practices, but feel like the other dfeshiny functions flagging warnings for external_links seems sub-optimal as:
a) users will get warnings about things outside of their control
b) the test output is full of junk-warnings
Off the top of my head, I'd imagine doing a find and replace all on external_link( to update to shinyGovstyle::external_link( in functions like support_panel() would make the deprecation process a lot cleaner.
tests/test_dashboard/tests/testthat/_snaps/UI-04-table/table_example-001.json
Show resolved
Hide resolved
|
Good point on the reuse of this in other functions - I hadn't clocked that at all, sorry! Will move the PR to draft and update accordingly, you're right that should be handled more neatly (and also that we should take our own advice and move to using shinyGovstyle within the package itself too). |
|
That should be sorted now @rmbielby, thank you for catching that! I'd taken the approach of just moving our internal calls straight over to shinyGovstyle. Though there is also the always argument that we can use instead or in other instances instead, that will toggle whether only direct calls get a warning or not. I've also marked the Air did a bit of tidying on some of those new files (e.g. the bad links list) too, just in case it looks like more changes than you're expecting. |
Brief overview of changes
The logic from
dfeshiny::external_link()anddfeshiny::dfe_reactable()has been moved to shinyGovstyle.This PR deprecates the old functions from dfeshiny, warning users of their impending removal, as well as switching the logic to just wrap around the shinyGovstyle functions so that there's only one place to maintain that code in the short term while we're deprecating.
Also tidied up a few linting and other warnings as I went around the package.
Why are these changes being made?
The functions are more widely useable across departments, so was worth moving to shinyGovstyle. In response we want to avoid duplicated effort so deprecating here is the best way to gently move users across while instantly removing the duplicated code.
Detailed description of changes
|>spellingpackage checksreturn()calls where we're expected to use the implicit version insteadinstall.packages()external_link()to wrap aroundshinyGovstyle::external_link()and marked as deprecateddfe_reactable()to wrap aroundshinyGovstyle::govReactable(), marked as deprecated, and updated tests to be less specific on HTML output, in line with best practice moving to a snapshot approach for the more detailed checksAdditional information for reviewers
Expecting @rmbielby will review as dfeshiny owner, though @mzayeddfe may be interested to see this as an example too as we've not done this moving of functions between packages in this way before.
Versioning
This deprecation doesn't break (or really change) anything; it's an official, explicit, advance warning that something will change in a future version, and behind the scenes we've cleaned out the duplicated logic so will get any updates from shinyGovstyle directly.
The SemVer specification specifically says to bump the minor version when deprecating in a backwards compatible way. It's only necessary for >v1.0.0, as v0.x.x is treated as free development reign, but given the adoption already of the package, and the chance for us to practice an example of this, I've gone for the same approach we'd use if the package was fully established and past v1.0.0 already.
I've suggested we intentionally break both functions with
lifecycle::deprecate_stop()at v1.0.0, which will just error for users and effectively remove the functions while leaving a clear message. This fits with their suggestion for when to bump the major version number.Issue ticket number/s and link
Resolves #85