DT icon indicating copy to clipboard operation
DT copied to clipboard

Moved function definition

Open MichalLauer opened this issue 1 year ago • 3 comments

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 (https://github.com/rstudio/shinytest2/issues/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 :)

MichalLauer avatar Apr 08 '24 15:04 MichalLauer

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 08 '24 15:04 CLAassistant

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 https://github.com/rstudio/shinytest2/issues/330.

jcheng5 avatar Apr 08 '24 17:04 jcheng5

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 [email protected]: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.

MichalLauer avatar Apr 09 '24 06:04 MichalLauer