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

Moved function definition #1136

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MichalLauer
Copy link

Hello,

the only purpose of this PR is to change the order of function definition. Currently, processWidget() is used in function widgetFunc(), but only after it's definition. This makes the package https://github.com/rstudio/shinytest2 fail because it does not allow global variables.

I am aware that this issue is more related to {shinytest2} rather than to {DT}, but the issue there is stale (rstudio/shinytest2#330). As this change does not affect any functionality, I thought it could be fixed right here.

If I should update also the package version/NEWS or something similar, please, feel free to let me know.

If you do not like this change, I will understand.
Thanks for this package and your hard work :)

@CLAassistant
Copy link

CLAassistant commented Apr 8, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@yihui yihui left a comment

Choose a reason for hiding this comment

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

That's okay to me. Thanks!

@yihui yihui requested a review from jcheng5 April 8, 2024 16:24
@jcheng5
Copy link
Member

jcheng5 commented Apr 8, 2024

Wow, this is incredibly bad if the order matters like this. Do you have a reprex that triggers on this particular issue? I don't see anything in rstudio/shinytest2#330.

@MichalLauer
Copy link
Author

I tried to create a reprex but it looks like this issue happens only in a package structure. I created a repository where the issue is replicable: https://github.com/MichalLauer/DTReprex.

To replicate, you need to:

  1. clone the repository
    git clone git@github.com:MichalLauer/DTReprex.git
  2. open the test.R file
  3. run all

It's strange that you really don't need to pass any data to it - the error happens with any DT settings.

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

4 participants