diff --git a/.Rbuildignore b/.Rbuildignore index 67f8cf3..41cfc85 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -18,3 +18,4 @@ ^webpack\.config\.js$ ^yarn\.lock$ ^logo\.svg$ +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..a3ac618 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,49 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 092d345..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -matrix: - include: - # R for travis: see documentation at https://docs.travis-ci.com/user/languages/r - - language: r - r: - - release - sudo: required - cache: packages - before_install: - - sudo apt-get install -y libv8-dev - - language: node_js - node_js: - - "11.4.0" - addons: - - chrome: stable \ No newline at end of file diff --git a/CRAN-RELEASE b/CRAN-RELEASE deleted file mode 100644 index 1496baf..0000000 --- a/CRAN-RELEASE +++ /dev/null @@ -1,2 +0,0 @@ -This package was submitted to CRAN on 2021-02-20. -Once it is accepted, delete this file and tag the release (commit e167785db5). diff --git a/DESCRIPTION b/DESCRIPTION index d5b5f5e..79d5749 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: reactR Type: Package Title: React Helpers -Version: 0.4.4 -Date: 2021-02-20 +Version: 0.5.0 +Date: 2023-10-01 Authors@R: c( person( "Facebook", "Inc" @@ -46,5 +46,5 @@ Suggests: knitr, usethis, jsonlite -RoxygenNote: 7.1.1 +RoxygenNote: 7.2.3 VignetteBuilder: knitr diff --git a/R/meta.R b/R/meta.R index 35d322e..76c246d 100644 --- a/R/meta.R +++ b/R/meta.R @@ -1,3 +1,3 @@ #'@keywords internal -react_version <- function(){'17.0.0'} +react_version <- function(){'18.2.0'} babel_version <- function(){'6.26.0'} \ No newline at end of file diff --git a/README.Rmd b/README.Rmd index cd6d472..a2ff8fd 100644 --- a/README.Rmd +++ b/README.Rmd @@ -16,8 +16,7 @@ knitr::opts_chunk$set( ``` [![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/reactR)](https://cran.r-project.org/package=reactR) -[![Travis-CI Build Status](https://travis-ci.org/react-R/reactR.svg?branch=master)](https://travis-ci.org/react-R/reactR) -[![Slack Status](https://reactr-slackin.herokuapp.com/badge.svg)](https://reactr-slackin.herokuapp.com/) +[![R-CMD-check](https://github.com/react-R/reactR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/react-R/reactR/actions/workflows/R-CMD-check.yaml) `reactR` provides a set of convenience functions for using [`React`](https://reactjs.org/) in `R` with `htmlwidget` constructor templates and local JavaScript dependencies. The `React` ecosystem is rich with components that can enhance `R` web and Shiny apps. `scaffoldReactWidget()` helps build `htmlwidgets` to integrate these `React` components as `R` `htmlwidgets`. `scaffoldReactShinyInput()` does the same for `Shiny` inputs. The local dependency functions are modeled after the `html_dependency_*` functions from RStudio's [`rmarkdown`](https://github.com/rstudio/rmarkdown) package. diff --git a/README.md b/README.md index 84000b3..d9e9178 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,8 @@ -[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/reactR)](https://cran.r-project.org/package=reactR) -[![Travis-CI Build -Status](https://travis-ci.org/react-R/reactR.svg?branch=master)](https://travis-ci.org/react-R/reactR) -[![Slack -Status](https://reactr-slackin.herokuapp.com/badge.svg)](https://reactr-slackin.herokuapp.com/) +[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/reactR)](https://cran.r-project.org/package=reactR) +[![R-CMD-check](https://github.com/react-R/reactR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/react-R/reactR/actions/workflows/R-CMD-check.yaml) `reactR` provides a set of convenience functions for using [`React`](https://reactjs.org/) in `R` with `htmlwidget` constructor diff --git a/docs/404.html b/docs/404.html index becafbf..3c5f7d1 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,69 +1,33 @@ - - -
- + + + + -Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
-This Code of Conduct is adapted from the Contributor Covenant (http:contributor-covenant.org), version 1.0.0, available at http://contributor-covenant.org/version/1/0/0/
+This Code of Conduct is adapted from the Contributor Covenant (http:contributor-covenant.org), version 1.0.0, available at http://contributor-covenant.org/version/1/0/0/
Facebook Inc. Author, copyright holder.
+
React library in lib, https://reactjs.org/; see AUTHORS for full list of contributors
Michel Weststrate. Author, copyright holder.
+
mobx library in lib, https://github.com/mobxjs
Kent Russell. Author, maintainer.
+
R interface
Alan Dipert. Author.
+
R interface
DESCRIPTION
+ Facebook Inc. Author, copyright holder.
-
React library in lib, https://reactjs.org/; see AUTHORS for full list of contributors
Michel Weststrate. Author, copyright holder.
-
mobx library in lib, https://github.com/mobxjs
Kent Russell. Author, maintainer.
-
R interface
Alan Dipert. Author.
-
R interface
Inc F, Weststrate M, Russell K, Dipert A (2023). +reactR: React Helpers. +R package version 0.5.0, https://github.com/react-R/reactR. +
+@Manual{, + title = {reactR: React Helpers}, + author = {Facebook Inc and Michel Weststrate and Kent Russell and Alan Dipert}, + year = {2023}, + note = {R package version 0.5.0}, + url = {https://github.com/react-R/reactR}, +}
reactR
provides a set of convenience functions for using React
in R
with htmlwidget
constructor templates and local JavaScript dependencies. The React
ecosystem is rich with components that can enhance R
web and Shiny apps. scaffoldReactWidget()
helps build htmlwidgets
to integrate these React
components as R
htmlwidgets
. scaffoldReactShinyInput()
does the same for Shiny
inputs. The local dependency functions are modeled after the html_dependency_*
functions from RStudio’s rmarkdown
package.
You can install reactR from CRAN with install.packages("reactR")
. For the development version, please use devtools
as shown below.
# install.packages("devtools") -devtools::install_github("react-R/reactR")
To wrap a React
component as an htmlwidget
, please see the tutorial htmlwidgets with reactR. Also, there are a variety of examples in the react-R Github organization.
reactable
is a very well-built htmlwidget
leveraging this functionality.
htmlwidgets
built with reactR
work well in Shiny as outputs. In version 0.4.0
Alan Dipert has added the ability to easily create React-based official Shiny
inputs with helpers and scaffolds. Please see the tutorial for more details.
reactR
provides a set of convenience functions for using React
in R
with htmlwidget
constructor templates and local JavaScript dependencies. The React
ecosystem is rich with components that can enhance R
web and Shiny apps. scaffoldReactWidget()
helps build htmlwidgets
to integrate these React
components as R
htmlwidgets
. scaffoldReactShinyInput()
does the same for Shiny
inputs. The local dependency functions are modeled after the html_dependency_*
functions from RStudio’s rmarkdown
package.
You can install reactR from CRAN with install.packages("reactR")
. For the development version, please use devtools
as shown below.
+# install.packages("devtools")
+devtools::install_github("react-R/reactR")
To wrap a React
component as an htmlwidget
, please see the tutorial htmlwidgets with reactR. Also, there are a variety of examples in the react-R Github organization.
reactable
is a very well-built htmlwidget
leveraging this functionality.
htmlwidgets
built with reactR
work well in Shiny as outputs. In version 0.4.0
Alan Dipert has added the ability to easily create React-based official Shiny
inputs with helpers and scaffolds. Please see the tutorial for more details.
Below are examples of using reactR
directly.
library(reactR) -library(htmltools) - -browsable(tagList( - tags$div(id = "app"), - tags$script( - " - ReactDOM.render( - React.createElement( - 'h1', - null, - 'Powered by React' - ), - document.getElementById('app') - ) - " - ), - #add core-js first to work in RStudio Viewer - html_dependency_corejs(), - html_dependency_react() -))
+library(reactR)
+library(htmltools)
+
+browsable(tagList(
+ tags$div(id = "app"),
+ tags$script(
+ "
+ ReactDOM.render(
+ React.createElement(
+ 'h1',
+ null,
+ 'Powered by React'
+ ),
+ document.getElementById('app')
+ )
+ "
+ ),
+ #add core-js first to work in RStudio Viewer
+ html_dependency_corejs(),
+ html_dependency_react()
+))
reactR
uses the V8
package if available to transform JSX
and ES2015
code with babel
.
library(reactR) -library(htmltools) - -browsable( - tagList( - tags$div(id = "app"), - tags$script( - babel_transform('ReactDOM.render(<h1>Powered By React/JSX</h1>,document.getElementById("app"))') - ), - # add core-js shim first for React in older versions of RStudio Viewer - #html_dependency_corejs(), - html_dependency_react() - ) -)
We welcome contributors and would love your participation. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by the terms.
+
+library(reactR)
+library(htmltools)
+
+browsable(
+ tagList(
+ tags$div(id = "app"),
+ tags$script(
+ babel_transform('ReactDOM.render(<h1>Powered By React/JSX</h1>,document.getElementById("app"))')
+ ),
+ # add core-js shim first for React in older versions of RStudio Viewer
+ #html_dependency_corejs(),
+ html_dependency_react()
+ )
+)
We welcome contributors and would love your participation. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by the terms.
Developed by Facebook Inc, Michel Weststrate, Kent Russell, Alan Dipert.
+ +Developed by Facebook Inc, Michel Weststrate, Kent Russell, Alan Dipert.