Files
shiny/tools
Winston Chang 4264760113 Add binding and el fields to shiny:inputchanged event (#1596)
* Remove unused 'immediate' arguments

* Add opts argument to setInput methods

* Extract input values without opts

* Consistent interface for setting initial values

* Update NEWS

* Add binding and el when fileInputBinding triggers shiny:inputchanged

* Revert "Consistent interface for setting initial values"

This reverts commit 12c0b6e72a.

* Move InputDeferDecorater function

The new placement properly reflects the decorator stack

* Fix indentation

* bindInputs: make sure value is set immediately

* Only use opts where necessary in input decorators

* Properly send initial values

* Move initial value of .clientdata_allowDataUriScheme to better place

* Fix indentation

* Add InputValidateDecorator

* Better variable name

* Add function for default input options

* Simplify code
2017-03-03 15:27:32 -06:00
..
2016-10-11 13:04:38 -05:00
2017-01-03 14:29:43 -06:00
2016-10-12 12:51:05 -05:00

This directory contains build tools for Shiny.

JavaScript build tools

First-time setup

Shiny's JavaScript build tools use Node.js, along with yarn to manage the JavaScript packages.

Installation of Node.js differs across platforms and is generally pretty easy, so I won't include instructions here.

Install yarn using the official instructions.

Then, in this directory (tools/), run the following to install the packages:

yarn

If in the future you want to upgrade or add a package, run:

yarn add --dev [packagename]

If someone else updates the package.json and/or yarn.lock files, simply run yarn to update your packages.

For information about upgrading or installing new packages, see the yarn workflow documentation.

Grunt

Grunt is a build tool that runs on node.js and will be installed. In Shiny, it is used for concatenating, minifying, and linting Javascript code.

Installing Grunt

# Install grunt command line tool globally
sudo yarn global add grunt-cli

Using Grunt

To run all default grunt tasks (concatenation, minification, and jshint), simply go into the tools directory and run:

grunt

Sometimes grunt gets confused about whether the output files are up to date, and won't overwrite them even if the input files have changed. If this happens, run:

grunt clean

It's also useful to run grunt so that it monitors files for changes and run tasks as necessary. This is done with:

grunt watch

One of the tasks concatenates all the .js files in /srcjs together into /inst/www/shared/shiny.js. Another task minifies shiny.js to generate shiny.min.js. The minified file is supplied to the browser, along with a source map file, shiny.min.js.map, which allows a user to view the original Javascript source when using the debugging console in the browser.

During development of Shiny's Javascript code, it's best to use grunt watch so that the minified file will get updated whenever you make changes the Javascript sources.

Updating web libraries

babel-polyfill

To update the version of babel-polyfill:

  • Check if there is a newer version available by running yarn outdated babel-polyfill. (If there's no output, then you have the latest version.)
  • Run yarn add --dev babel-polyfill --exact.
  • Edit R/shinyui.R. The renderPage function has an htmlDependency for babel-polyfill. Update this to the new version number.