The issues mentioned above are also a concern in JavaScript, though here one has to consider additional pitfalls.
Another method often used is to build the project as an R package, thereby enforcing a particular structure and enabling reproducibility, unit tests, and more. Some of these solutions may include the drake (Landau 2021 a) or targets (Landau 2021 b) packages, both of which provide tools to manage complex workflows. Therefore when tackling more extensive projects, the R programmer will turn to solutions that enforce a specific file structure and provide utilities to harmonise how those files work together. While a small script of 300 lines of code will do the job, a large script of 10,000 lines quickly becomes unmanageable. It’s the same problem one faces when writing R code. While this works for the smaller projects, it is bound to lead to headaches for the larger ones. Thus far, all of the JavaScript code written in this book was placed directly in the file that was imported in the front end, be it htmlwidgets or Shiny-related code. 15.4.6 Subscribe and Unsubscribe Inputs.