Creating a JavaScript Library for Your Shiny Application
summary
Step-by-step recipe for moving from many scattered scripts to a maintainable library: create a srcjs directory inside the R package, install Node and use npm to manage dependencies (jQuery, shiny helper libs, sortable.js), split code into ES modules with explicit exports/imports, add linting (eslint) and unit tests (jest), add a build script and run npm run build to bundle and minify into a single minified file placed in inst/www, wire tests into GitHub Actions; result: one 25-line index that works in Designer and is far easier to maintain.
AI-written summary · about
