diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000..9ac2a53b9
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,13 @@
+# editorconfig.org
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+indent_size = 4
+indent_style = tab
+insert_final_newline = true
+
+[*.json]
+indent_size = 2
+indent_style = space
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000..90b9f343a
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,5 @@
+* text eol=lf
+*.png binary
+*.exe binary
+*.dll binary
+
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 000000000..a958ae0e2
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,24 @@
+Thanks for filing a bug! To save time, if you're having trouble using the library, please check off the items you have tried. If you are just asking a question, skip right to the bottom.
+
+### Please verify these steps before filing an issue, and check them off as you go
+- [ ] The relevant native JavascriptEngineSwitcher library packages are installed (such as `JavaScriptEngineSwitcher.V8.Native.win-x64`)
+- [ ] The VC++ 2017 runtime is installed
+- [ ] The value of `SetUseReact` and `SetUseBabel` is correct in `ReactConfig.cs` or `Startup.cs`
+- [ ] I've looked at the sample projects in this repo to verify that my app is configured correctly
+
+### I'm using these library versions:
+- `ReactJS.NET`:
+- `JavaScriptEngineSwitcher`:
+- `react` and `react-dom`: (N/A if using bundled react, or version number)
+- `webpack`: (N/A if using bundled react)
+- `node`: (N/A if using bundled react)
+
+### Runtime environment:
+- OS: (Mac, Windows, Linux flavor. Include 32-bit/64-bit and version)
+- .NET Framework or .NET Core Version:
+
+### Steps to reproduce
+
+-------
+
+(Describe your issue here)
diff --git a/.github/workflows/dotnet-core-desktop.yml b/.github/workflows/dotnet-core-desktop.yml
new file mode 100644
index 000000000..194ac738e
--- /dev/null
+++ b/.github/workflows/dotnet-core-desktop.yml
@@ -0,0 +1,64 @@
+name: .NET Core Desktop
+
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+ branches: [ main ]
+
+jobs:
+
+ build:
+
+ strategy:
+ matrix:
+ configuration: [Debug, Release]
+
+ runs-on: windows-latest # For a list of available runner types, refer to
+ # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: Cache node modules
+ uses: actions/cache@v2
+ env:
+ cache-name: cache-node-modules
+ with:
+ # npm cache files are stored in `~/.npm` on Linux/macOS
+ path: ~/.npm
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-
+ ${{ runner.os }}-build-
+ ${{ runner.os }}-
+
+ - name: Install .NET Core
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: 3.1.x
+
+ - name: Use Node.js 12
+ uses: actions/setup-node@v1
+ with:
+ node-version: 12
+
+ - name: Setup MSBuild.exe
+ uses: microsoft/setup-msbuild@2008f912f56e61277eefaac6d1888b750582aa16
+ env:
+ ACTIONS_ALLOW_UNSECURE_COMMANDS: true
+
+ - name: Build
+ run: msbuild build.proj /p:PackageOutputDir="${{ env.GITHUB_WORKSPACE }}/nuget-output" /p:Configuration=${{ matrix.configuration }}
+ env:
+ ACTIONS_ALLOW_UNSECURE_COMMANDS: true
+ Configuration: ${{ matrix.configuration }}
+
+ - name: Upload build artifacts
+ uses: actions/upload-artifact@v1
+ with:
+ name: Nuget Package
+ path: "${{ env.GITHUB_WORKSPACE }}/nuget-output"
diff --git a/.gitignore b/.gitignore
index 0acd04f96..b32bd32fb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
_old/
src/SharedAssemblyVersionInfo.cs
*.nupkg
+*.snupkg
src/**/*.nuspec
!src/template.nuspec
site/jekyll/_site
@@ -10,9 +11,10 @@ src/React.Sample.Webpack/build
*.generated.js
*.generated.js.map
*.generated.min.js
-src/React.Sample.Mvc6/wwwroot/js/Sample.js
*.lock.json
-src/.vs
+.vs/
+results/
+dist/
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
diff --git a/.gitmodules b/.gitmodules
index 1f4bb89ae..e69de29bb 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +0,0 @@
-[submodule "lib/VroomJs"]
- path = lib/VroomJs
- url = https://github.com/Daniel15/vroomjs.git
diff --git a/LICENSE b/LICENSE
index 3cac634d4..10d9a688c 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,28 +1,21 @@
-BSD License for ReactJS.NET
+MIT License for ReactJS.NET
-Copyright (c) 2014, Facebook, Inc. All rights reserved.
+Copyright (c) Facebook, Inc. and its affiliates.
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- * Neither the name Facebook nor the names of its contributors may be used to
- endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/PATENTS b/PATENTS
deleted file mode 100644
index 755baf53f..000000000
--- a/PATENTS
+++ /dev/null
@@ -1,33 +0,0 @@
-Additional Grant of Patent Rights Version 2
-
-"Software" means the ReactJS.NET software distributed by Facebook, Inc.
-
-Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software
-("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable
-(subject to the termination provision below) license under any Necessary
-Claims, to make, have made, use, sell, offer to sell, import, and otherwise
-transfer the Software. For avoidance of doubt, no license is granted under
-Facebook's rights in any patent claims that are infringed by (i) modifications
-to the Software made by you or any third party or (ii) the Software in
-combination with any software or other technology.
-
-The license granted hereunder will terminate, automatically and without notice,
-if you (or any of your subsidiaries, corporate affiliates or agents) initiate
-directly or indirectly, or take a direct financial interest in, any Patent
-Assertion: (i) against Facebook or any of its subsidiaries or corporate
-affiliates, (ii) against any party if such Patent Assertion arises in whole or
-in part from any software, technology, product or service of Facebook or any of
-its subsidiaries or corporate affiliates, or (iii) against any party relating
-to the Software. Notwithstanding the foregoing, if Facebook or any of its
-subsidiaries or corporate affiliates files a lawsuit alleging patent
-infringement against you in the first instance, and you respond by filing a
-patent infringement counterclaim in that lawsuit against that party that is
-unrelated to the Software, the license granted hereunder will not terminate
-under section (i) of this paragraph due to such counterclaim.
-
-A "Necessary Claim" is a claim of a patent owned by Facebook that is
-necessarily infringed by the Software standing alone.
-
-A "Patent Assertion" is any lawsuit or other action alleging direct, indirect,
-or contributory infringement or inducement to infringe any patent, including a
-cross-claim or counterclaim.
diff --git a/README.md b/README.md
index c74dc8295..8a6674e56 100644
--- a/README.md
+++ b/README.md
@@ -1,67 +1,55 @@
-[ReactJS.NET](http://reactjs.net/)
-===========
+# [ReactJS.NET](http://reactjs.net/)
-ReactJS.NET is a library that makes it easier to use [Babel](http://babeljs.io/) along with Facebook's [React](http://facebook.github.io/react/) and [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) from C#.
+ReactJS.NET is a library that makes it easier to use [Babel](http://babeljs.io/) along with Facebook's [React](https://reactjs.org/) and [JSX](https://reactjs.org/docs/jsx-in-depth.html) from C#.
-[](https://ci.appveyor.com/project/Daniel15/react-net/branch/master)
-[](https://www.nuget.org/packages/React.Core/)
+
[](https://www.nuget.org/packages/React.Core/)
+[](https://www.nuget.org/packages/React.Core/)
-Features
-========
- * On-the-fly [JSX to JavaScript compilation](http://reactjs.net/getting-started/usage.html) via [Babel](http://babeljs.io/)
- * JSX to JavaScript compilation via popular minification/combination
- libraries:
- * [ASP.NET Bundling and Minification](http://reactjs.net/guides/weboptimizer.html)
- * [Cassette](http://reactjs.net/guides/cassette.html)
- * [Webpack](http://reactjs.net/guides/webpack.html)
- * [MSBuild](http://reactjs.net/guides/msbuild.html)
- * [Server-side component rendering](http://reactjs.net/guides/server-side-rendering.html)
- to make your initial render super-fast (experimental!)
- * [Runs on Linux](http://reactjs.net/guides/mono.html) via Mono and V8
- * Supports both ASP.NET 4.0/4.5 and ASP.NET 5
+# Features
-Quick Start
-===========
-Install the package
-```
-Install-Package React.Web.Mvc4 # For ASP.NET MVC 4 or 5
-Install-Package React.AspNet # For ASP.NET MVC 6 (ASP.NET 5)
-```
+- On-the-fly [JSX to JavaScript compilation](http://reactjs.net/getting-started/usage.html) via [Babel](http://babeljs.io/)
-Create JSX files
-```javascript
-// /Scripts/HelloWorld.jsx
-var HelloWorld = React.createClass({
- render: function () {
- return (
-
Hello {this.props.name}
- );
- }
-});
-```
+* JSX to JavaScript compilation via popular minification/combination
+ libraries:
+ - [ASP.NET Bundling and Minification](http://reactjs.net/bundling/weboptimizer.html)
+ - [Cassette](http://reactjs.net/bundling/cassette.html)
+ - [Webpack](http://reactjs.net/bundling/webpack.html)
+ - [MSBuild](http://reactjs.net/bundling/msbuild.html)
+* [Server-side component rendering](http://reactjs.net/features/server-side-rendering.html)
+ to make your initial render super-fast, including support for:
+ - [CSS-in-JS libraries](https://reactjs.net/features/css-in-js.html)
+ - [React Router](https://reactjs.net/features/react-router.html)
+ - [React Helmet](https://reactjs.net/features/react-helmet.html)
+ - Custom JS logic via implementing [IRenderFunctions](https://github.com/reactjs/React.NET/blob/c93921f059bfe9419ad7094c184979da422a4477/src/React.Core/IRenderFunctions.cs) and passing to [Html.React](https://github.com/reactjs/React.NET/blob/c93921f059bfe9419ad7094c184979da422a4477/src/React.AspNet/HtmlHelperExtensions.cs#L71)
+* [Runs on Windows, OS X and Linux](http://reactjs.net/getting-started/chakracore.html) via .NET Core and ChakraCore
+* Supports both ASP.NET 4.0/4.5 and ASP.NET Core
-Reference the JSX files from your HTML
-```html
-
+# Quick Start
+
+```
+dotnet new -i React.Template
+dotnet new reactnet-vanilla
+dotnet run
```
-Now you can use the `HelloWorld` component.
+#### Planning on using `require` or `import` module syntax in your application? Use the `reactnet-webpack` template instead for webpack support.
+
+See also:
-For information on more advanced topics (including precompilation and
-server-side rendering), check out [the documentation](http://reactjs.net/docs)
+- [Getting Started](https://reactjs.net/getting-started/aspnetcore.html)
+- [Tutorial](https://reactjs.net/tutorials/aspnetcore.html)
-Building Manually and Contributing
-----------------------------------
+## Building Manually and Contributing
When building your own copy of ReactJS.NET (for example, if implementing a new
-feature or fixing a bug), your first build always needs to be done using the
-build script (`dev-build.bat`) as this generates a few files required by the
-build (such as `SharedAssemblyVersionInfo.cs`). Once this build is completed,
+feature or fixing a bug), your first build always needs to be done using the
+build script (`dev-build.bat`) as this generates a few files required by the
+build (such as `SharedAssemblyVersionInfo.cs`). Once this build is completed,
you can open `React.sln` in Visual Studio and compile directly from Visual
-Studio. Please refer to the [documentation page on
+Studio. Please refer to the [documentation page on
contributing](http://reactjs.net/dev/contributing.html) for more information on
contributing to ReactJS.NET.
-Note that the build requires you to have Git installed. If you do not want to
+Note that the build requires you to have Git installed. If you do not want to
install Git, you may remove the `GitVersion` task from `build.proj`.
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index 16b033454..000000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-version: '{build}'
-os: Visual Studio 2015
-install:
-- set PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin;%PATH%
-- dnvm update-self
-- dnvm install 1.0.0-rc1-update1
-build:
- project: build.proj
- verbosity: normal
-test_script:
-- nunit3-console.exe bin\ReleaseTests\React.Tests\React.Tests.dll
-artifacts:
-- path: output\*.nupkg
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
new file mode 100644
index 000000000..2c176e021
--- /dev/null
+++ b/azure-pipelines.yml
@@ -0,0 +1,39 @@
+trigger:
+ - main
+ - ci-updates
+
+pool:
+ vmImage: 'windows-2019'
+
+variables:
+ buildPlatform: 'Any CPU'
+ buildConfiguration: 'Release'
+ buildType: 'Release'
+
+steps:
+ - task: NodeTool@0
+ inputs:
+ versionSpec: '10.x'
+
+ - script: npm install --global npm
+
+ - task: UseDotNet@2
+ displayName: 'Use .NET Core sdk'
+ inputs:
+ packageType: 'sdk'
+ version: '3.1.x'
+
+ - task: VSBuild@1
+ inputs:
+ solution: 'build.proj'
+ msbuildArgs: '/p:PackageOutputDir="$(build.artifactStagingDirectory)"'
+ platform: '$(buildPlatform)'
+ configuration: '$(buildConfiguration)'
+
+ - task: DotNetCoreCLI@2
+ inputs:
+ command: 'test'
+ projects: 'tests/React.Tests/React.Tests.csproj'
+ arguments: '--no-build --configuration $(buildConfiguration)'
+
+ - task: PublishBuildArtifacts@1
diff --git a/build.proj b/build.proj
index 05d69c070..afbf537d6 100644
--- a/build.proj
+++ b/build.proj
@@ -9,43 +9,44 @@ of patent rights can be found in the PATENTS file in the same directory.
-->
- 2
- 3
- 1
+ 5
+ 2
+ 130http://reactjs.net/packages/$(MSBuildProjectDirectory)\tools\MSBuildTasks
- output
+ $(MSBuildProjectDirectory)\outputDev
-
+
src\React.sln
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
+
@@ -67,77 +72,63 @@ of patent rights can be found in the PATENTS file in the same directory.
- $(Build)
+ $(Major).$(Minor).$(Build)
- $(Build)-dev-$(Date)
+ $(Major).$(Minor).$(Build)-dev-$(Date)
-
+
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -145,16 +136,13 @@ of patent rights can be found in the PATENTS file in the same directory.
-
-
-
-
-
-
+
+
+
@@ -167,7 +155,7 @@ of patent rights can be found in the PATENTS file in the same directory.
diff --git a/dev-build-push.bat b/dev-build-push.bat
index c0b12fe22..68f142d80 100644
--- a/dev-build-push.bat
+++ b/dev-build-push.bat
@@ -1,7 +1 @@
-@echo off
-IF EXIST "%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" (
- "%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" build.proj /t:Package;Push /p:BuildType=Dev
-) ELSE (
- "%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" build.proj /t:Package;Push /p:BuildType=Dev
-)
-pause
\ No newline at end of file
+call runs-msbuild.bat "/p:BuildType=Dev" "/t:Package;Push"
diff --git a/dev-build.bat b/dev-build.bat
index 3c1b92482..b09ae3031 100644
--- a/dev-build.bat
+++ b/dev-build.bat
@@ -1,7 +1 @@
-@echo off
-IF EXIST "%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" (
- "%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" build.proj
-) ELSE (
- "%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" build.proj
-)
-pause
\ No newline at end of file
+call runs-msbuild.bat "/p:BuildType=Dev"
diff --git a/lib/Mvc3/System.Web.Mvc.dll b/lib/Mvc3/System.Web.Mvc.dll
deleted file mode 100644
index eed0d994a..000000000
Binary files a/lib/Mvc3/System.Web.Mvc.dll and /dev/null differ
diff --git a/lib/Mvc3/System.Web.Razor.dll b/lib/Mvc3/System.Web.Razor.dll
deleted file mode 100644
index cd950e6d1..000000000
Binary files a/lib/Mvc3/System.Web.Razor.dll and /dev/null differ
diff --git a/lib/Mvc3/System.Web.WebPages.Razor.dll b/lib/Mvc3/System.Web.WebPages.Razor.dll
deleted file mode 100644
index 9846dd3fc..000000000
Binary files a/lib/Mvc3/System.Web.WebPages.Razor.dll and /dev/null differ
diff --git a/lib/Mvc3/System.Web.WebPages.dll b/lib/Mvc3/System.Web.WebPages.dll
deleted file mode 100644
index 9fea01285..000000000
Binary files a/lib/Mvc3/System.Web.WebPages.dll and /dev/null differ
diff --git a/lib/VroomJs b/lib/VroomJs
deleted file mode 160000
index eaccce84a..000000000
--- a/lib/VroomJs
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit eaccce84afe473ffc62ce8a9d632b6c3b43eaed3
diff --git a/lib/VroomJs.dll b/lib/VroomJs.dll
deleted file mode 100644
index 2167ac61a..000000000
Binary files a/lib/VroomJs.dll and /dev/null differ
diff --git a/lib/build-vroomjs.bat b/lib/build-vroomjs.bat
deleted file mode 100644
index 51d905dc0..000000000
--- a/lib/build-vroomjs.bat
+++ /dev/null
@@ -1,3 +0,0 @@
-@echo off
-"%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" VroomJs\VroomJs\VroomJs.csproj /p:BuildProjectReferences=false /p:Configuration=Release /p:OutputPath=..\..\ /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=..\..\..\src\Key.snk
-pause
\ No newline at end of file
diff --git a/netlify.toml b/netlify.toml
new file mode 100644
index 000000000..31296b025
--- /dev/null
+++ b/netlify.toml
@@ -0,0 +1,65 @@
+[build]
+ base = "site/jekyll"
+ publish = "site/jekyll/_site"
+ command = "bundle exec jekyll build"
+
+# Shortcuts
+[[redirects]]
+ from = "/download"
+ to = "/getting-started/download.html"
+ status = 302
+
+[[redirects]]
+ from = "/docs"
+ to = "/getting-started/aspnetcore.html"
+ status = 302
+
+# Old documentation URLs
+[[redirects]]
+ from = "/getting-started/aspnet5.html"
+ to = "/getting-started/aspnetcore.html"
+
+[[redirects]]
+ from = "/getting-started/tutorial.html"
+ to = "/tutorials/aspnetcore.html"
+
+[[redirects]]
+ from = "/guides/weboptimizer.html"
+ to = "/bundling/weboptimizer.html"
+
+[[redirects]]
+ from = "/guides/cassette.html"
+ to = "/bundling/cassette.html"
+
+[[redirects]]
+ from = "/guides/webpack.html"
+ to = "/bundling/webpack.html"
+
+[[redirects]]
+ from = "/guides/msbuild.html"
+ to = "/bundling/msbuild.html"
+
+[[redirects]]
+ from = "/guides/server-side-rendering.html"
+ to = "/features/server-side-rendering.html"
+
+[[redirects]]
+ from = "/guides/es6.html"
+ to = "/features/es6.html"
+
+[[redirects]]
+ from = "/guides/react-router.html"
+ to = "/features/react-router.html"
+
+[[redirects]]
+ from = "/guides/chakracore.html"
+ to = "/getting-started/chakracore.html"
+
+# Old package URLs
+[[redirects]]
+ from = "/packages/*"
+ to = "https://ci.appveyor.com/nuget/reactjs.net/:splat"
+
+[[redirects]]
+ from = "/dev/packages/*"
+ to = "https://ci.appveyor.com/nuget/reactjs.net/:splat"
diff --git a/release-build-push.bat b/release-build-push.bat
index adb004cd5..9a9f15c34 100644
--- a/release-build-push.bat
+++ b/release-build-push.bat
@@ -1,7 +1 @@
-@echo off
-IF EXIST "%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" (
- "%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" build.proj /t:Package;Push /p:BuildType=Release
-) ELSE (
- "%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" build.proj /t:Package;Push /p:BuildType=Release
-)
-pause
\ No newline at end of file
+call runs-msbuild.bat "/p:BuildType=Release" "/t:Package;Push"
diff --git a/release-build.bat b/release-build.bat
index 6c847f6ba..788e125a5 100644
--- a/release-build.bat
+++ b/release-build.bat
@@ -1,8 +1 @@
-@echo off
-IF EXIST "%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" (
- "%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" build.proj /p:BuildType=Release
-) ELSE (
- "%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" build.proj /p:BuildType=Release
-)
-pause
-pause
\ No newline at end of file
+call runs-msbuild.bat "/p:BuildType=Release"
diff --git a/renovate.json b/renovate.json
new file mode 100644
index 000000000..f197b0de8
--- /dev/null
+++ b/renovate.json
@@ -0,0 +1,39 @@
+{
+ "extends": [
+ "config:base"
+ ],
+ "packageRules": [
+ {
+ "sourceUrlPrefixes": ["https://github.com/Taritsyn/JavaScriptEngineSwitcher"],
+ "groupName": "JavaScriptEngineSwitcher packages"
+ },
+ {
+ "sourceUrlPrefixes": ["https://github.com/aspnet/Extensions"],
+ "groupName": "ASP.NET Extensions"
+ },
+ {
+ "packagePatterns": ["^Microsoft.AspNetCore"],
+ "groupName": "ASP.NET Core packages"
+ },
+ {
+ "packagePatterns": ["^Microsoft.Owin"],
+ "groupName": "Owin packages"
+ },
+ {
+ "sourceUrlPrefixes": [
+ "https://github.com/aspnet/MetaPackages",
+ "https://github.com/aspnet/AspNetCore"
+ ],
+ "groupName": "ASP.NET Core packages"
+ },
+ {
+ "packagePatterns": ["^React"],
+ "groupName": "React.NET packages"
+ }
+ ],
+ "separateMinorPatch": true,
+ "automerge": false,
+ "patch": {
+ "automerge": true
+ }
+}
diff --git a/runs-msbuild.bat b/runs-msbuild.bat
new file mode 100644
index 000000000..360f79b15
--- /dev/null
+++ b/runs-msbuild.bat
@@ -0,0 +1,23 @@
+@echo off
+
+set BUILDTYPE="%~1"
+set ACTION="%~2"
+
+for %%s in (
+ "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe"
+ "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe"
+ "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe"
+ "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\MSBuild.exe"
+) do (
+ if exist %%s (
+ echo %%s build.proj %ACTION% %BUILDTYPE%
+ %%s build.proj %ACTION% %BUILDTYPE%
+ goto :done
+ )
+)
+
+:notfound
+echo Could not find MSBuild.exe. Make sure Visual Studio 2019 is installed and try again.
+
+:done
+pause
diff --git a/site/build.sh b/site/build.sh
new file mode 100755
index 000000000..69fdc556d
--- /dev/null
+++ b/site/build.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+set -ex
+cd jekyll
+bundle install
+bundle exec jekyll build
+cd ..
diff --git a/site/jekyll/Gemfile b/site/jekyll/Gemfile
new file mode 100644
index 000000000..5b8edb617
--- /dev/null
+++ b/site/jekyll/Gemfile
@@ -0,0 +1,10 @@
+source 'https://rubygems.org'
+
+gem 'jekyll', '~>1.5.1'
+gem 'jekyll-assets', '~>0.9.2'
+gem 'bourbon', '~>3'
+
+# For markdown header cleanup
+gem 'sanitize'
+
+gem 'wdm', '~> 0.1.0' if Gem.win_platform?
diff --git a/site/jekyll/Gemfile.lock b/site/jekyll/Gemfile.lock
new file mode 100644
index 000000000..60c113656
--- /dev/null
+++ b/site/jekyll/Gemfile.lock
@@ -0,0 +1,96 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ blankslate (2.1.2.4)
+ bourbon (3.2.4)
+ sass (~> 3.2)
+ thor
+ classifier (1.3.4)
+ fast-stemmer (>= 1.0.0)
+ colorator (0.1)
+ commander (4.1.6)
+ highline (~> 1.6.11)
+ crass (1.0.6)
+ fast-stemmer (1.0.2)
+ ffi (1.9.18)
+ ffi (1.9.18-x64-mingw32)
+ highline (1.6.21)
+ hike (1.2.3)
+ jekyll (1.5.1)
+ classifier (~> 1.3)
+ colorator (~> 0.1)
+ commander (~> 4.1.3)
+ liquid (~> 2.5.5)
+ listen (~> 1.3)
+ maruku (= 0.7.0)
+ pygments.rb (~> 0.5.0)
+ redcarpet (~> 2.3.0)
+ safe_yaml (~> 1.0)
+ toml (~> 0.1.0)
+ jekyll-assets (0.9.2)
+ jekyll (>= 1.0.0, < 3.0.0)
+ sass (~> 3.2)
+ sprockets (~> 2.10)
+ sprockets-helpers
+ sprockets-sass
+ liquid (2.5.5)
+ listen (1.3.1)
+ rb-fsevent (>= 0.9.3)
+ rb-inotify (>= 0.9)
+ rb-kqueue (>= 0.2)
+ maruku (0.7.0)
+ mini_portile2 (2.4.0)
+ multi_json (1.12.1)
+ nokogiri (1.10.9)
+ mini_portile2 (~> 2.4.0)
+ nokogiri (1.10.9-x64-mingw32)
+ mini_portile2 (~> 2.4.0)
+ nokogumbo (2.0.2)
+ nokogiri (~> 1.8, >= 1.8.4)
+ parslet (1.5.0)
+ blankslate (~> 2.0)
+ posix-spawn (0.3.13)
+ pygments.rb (0.5.4)
+ posix-spawn (~> 0.3.6)
+ yajl-ruby (~> 1.1.0)
+ rack (1.6.12)
+ rb-fsevent (0.9.8)
+ rb-inotify (0.9.8)
+ ffi (>= 0.5.0)
+ rb-kqueue (0.2.4)
+ ffi (>= 0.5.0)
+ redcarpet (2.3.0)
+ safe_yaml (1.0.4)
+ sanitize (5.2.1)
+ crass (~> 1.0.2)
+ nokogiri (>= 1.8.0)
+ nokogumbo (~> 2.0)
+ sass (3.4.23)
+ sprockets (2.12.4)
+ hike (~> 1.2)
+ multi_json (~> 1.0)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sprockets-helpers (1.2.1)
+ sprockets (>= 2.2)
+ sprockets-sass (1.3.1)
+ sprockets (~> 2.0)
+ tilt (~> 1.1)
+ thor (0.19.4)
+ tilt (1.4.1)
+ toml (0.1.2)
+ parslet (~> 1.5.0)
+ yajl-ruby (1.1.0)
+
+PLATFORMS
+ ruby
+ x64-mingw32
+
+DEPENDENCIES
+ bourbon (~> 3)
+ jekyll (~> 1.5.1)
+ jekyll-assets (~> 0.9.2)
+ sanitize
+
+BUNDLED WITH
+ 1.14.5
diff --git a/site/jekyll/_assets/stylesheets/react.scss b/site/jekyll/_assets/stylesheets/react.scss
index cb9f4b8c4..36ea1f560 100644
--- a/site/jekyll/_assets/stylesheets/react.scss
+++ b/site/jekyll/_assets/stylesheets/react.scss
@@ -17,7 +17,28 @@ $columnGutter: 40px;
$twoColumnWidth: 2 * $columnWidth + $columnGutter;
$navHeight: 50px;
+// Breakpoints
+$bp-large: 960px;
+$bp-medium: 640px;
+$bp-small: 480px;
+@mixin bp-small {
+ @media (max-width: $bp-small) {
+ @content;
+ }
+}
+
+@mixin bp-medium {
+ @media (max-width: $bp-medium) {
+ @content;
+ }
+}
+
+@mixin bp-large {
+ @media (max-width: $bp-large) {
+ @content;
+ }
+}
// basic reset
* {
@@ -764,3 +785,47 @@ div[data-twttr-id] iframe {
.three-column > ul:first-child {
margin-left: 20px;
}
+
+/* Algolia Doc Search */
+
+input#algolia-doc-search {
+ background: transparent url('../img/search.png') no-repeat 10px center;
+ background-size: 16px 16px;
+
+ position: relative;
+ vertical-align: top;
+ margin-left: 10px;
+ padding: 0 10px;
+ padding-left: 35px;
+ height: 30px;
+ margin-top: 10px;
+ font-size: 16px;
+ line-height: 20px;
+ background-color: #333;
+ border-radius: 4px;
+ color: white;
+ outline: none;
+ width: 170px;
+
+ transition: width .2s ease;
+
+ &:focus {
+ width: 240px;
+ }
+
+ @include bp-large {
+ background-color: transparent;
+ width: 0;
+ cursor: pointer;
+
+ &:focus {
+ width: 200px;
+ background-color: #333;
+ }
+ }
+}
+
+.algolia-autocomplete {
+ vertical-align: top;
+ height: 53px;
+}
diff --git a/site/jekyll/_config.yml b/site/jekyll/_config.yml
index c7ff9a184..7f32721e7 100644
--- a/site/jekyll/_config.yml
+++ b/site/jekyll/_config.yml
@@ -4,13 +4,19 @@ pygments: true
permalink: /:year/:month/:title.html
paginate: 5
paginate_path: /blog/page:num.html
-url: http://reactjs.net
+url: https://reactjs.net
doc-sections:
- - id: getting-started
- title: Getting Started
- - id: guides
- title: Guides
- - id: dev
- title: Development
+ - id: getting-started
+ title: 'Getting Started'
+ - id: tutorials
+ title: Tutorials
+ - id: features
+ title: Features
+ - id: bundling
+ title: Bundling
+ - id: dev
+ title: Development
+
+title: Development
assets:
- css_compressor: sass
+ css_compressor: sass
diff --git a/site/jekyll/_layouts/default.html b/site/jekyll/_layouts/default.html
index dc6eb2726..d59c8b506 100644
--- a/site/jekyll/_layouts/default.html
+++ b/site/jekyll/_layouts/default.html
@@ -9,7 +9,7 @@
-
+
@@ -17,6 +17,7 @@
{% stylesheet main %}
+
@@ -41,6 +42,7 @@
{{ site.name }}
+
```
-See the [React.Samples.Cassette](https://github.com/reactjs/React.NET/tree/master/src/React.Sample.Cassette)
+See the [React.Samples.Cassette](https://github.com/reactjs/React.NET/tree/main/src/React.Sample.Cassette)
project for an example.
-Precompilation
-==============
+# Precompilation
Cassette supports using an MSBuild task to minify and combine your assets before
deployment. This makes the start time of your application a lot quicker. Refer
diff --git a/site/jekyll/guides/msbuild.md b/site/jekyll/bundling/msbuild.md
similarity index 74%
rename from site/jekyll/guides/msbuild.md
rename to site/jekyll/bundling/msbuild.md
index 62280b409..fc294ff2e 100644
--- a/site/jekyll/guides/msbuild.md
+++ b/site/jekyll/bundling/msbuild.md
@@ -1,8 +1,14 @@
---
layout: docs
-title: MSBuild
+title: MSBuild (ASP.NET 4.x)
---
+> **Note:**
+>
+> This guide applies only to ASP.NET 4.x. Please consider using [webpack](/bundling/webpack.html) if possible.
+
+Just want to see the code? Check out the [sample project](https://github.com/reactjs/React.NET/tree/main/src/React.Sample.Mvc4).
+
ReactJS.NET includes an MSBuild task for compiling JSX into JavaScript. This is
handy to improve the start time of your application, especially if you have a
large number of JSX files.
@@ -20,8 +26,7 @@ you like:
```
-To get started easily, you can install the [React.MSBuild]
-(https://www.nuget.org/packages/React.MSBuild/) NuGet package which will
+To get started easily, you can install the [React.MSBuild](https://www.nuget.org/packages/React.MSBuild/) NuGet package which will
automatically modify your web application's `.csproj` file to reference the task
and run it after every site compilation. To customise the process (for example,
to only compile the JSX files for release builds), modify the `TransformBabel`
diff --git a/site/jekyll/guides/weboptimizer.md b/site/jekyll/bundling/weboptimizer.md
similarity index 68%
rename from site/jekyll/guides/weboptimizer.md
rename to site/jekyll/bundling/weboptimizer.md
index 481d65783..1565d4c67 100644
--- a/site/jekyll/guides/weboptimizer.md
+++ b/site/jekyll/bundling/weboptimizer.md
@@ -1,8 +1,14 @@
---
layout: docs
-title: ASP.NET Bundling and Minification
+title: Bundling and Minification (ASP.NET 4.x)
---
+> **Note:**
+>
+> This guide applies only to ASP.NET 4.x. Please consider using [webpack](/bundling/webpack.html) if possible.
+
+Just want to see the code? Check out the [sample project](https://github.com/reactjs/React.NET/tree/main/src/React.Sample.Mvc4).
+
ReactJS.NET supports the use of Microsoft's
[ASP.NET Bundling and Minification](http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification)
library to transform JavaScript via Babel, and minify it along with all your other
@@ -36,3 +42,12 @@ bundles.Add(new Bundle("~/bundles/main", new IBundleTransform[]
"~/Content/HelloWorld.react.jsx"
));
```
+
+Note that debug mode should be set to `false` in your `Web.config` file for this to work.
+
+```csharp
+// Web.config
+
+
+
+```
diff --git a/site/jekyll/bundling/webpack.md b/site/jekyll/bundling/webpack.md
new file mode 100644
index 000000000..0f39b168e
--- /dev/null
+++ b/site/jekyll/bundling/webpack.md
@@ -0,0 +1,126 @@
+---
+layout: docs
+title: Webpack
+---
+
+#### 👀 Just want to see the code? Check out the [sample project](https://github.com/reactjs/React.NET/tree/main/src/React.Template/reactnet-webpack).
+
+## For new projects:
+
+```
+dotnet new -i React.Template
+dotnet new reactnet-webpack
+dotnet run
+```
+
+## For existing projects:
+
+[Webpack](https://webpack.js.org/) is a popular module bundling system built on top of Node.js. It can handle not only combination and minification of JavaScript and CSS files, but also other assets such as image files (spriting) through the use of plugins. Webpack is the recommended bundling solution and should be preferred over Cassette or ASP.NET Bundling.
+
+Your project will bundle its own copy of react and react-dom with webpack, and ReactJS.NET will be used only for server-side rendering.
+
+Copy from the sample project to the root of your project:
+
+- [package.json](https://github.com/reactjs/React.NET/blob/main/src/React.Template/reactnet-webpack/package.json), which includes everything you need to bundle with webpack
+- [webpack.config.js](https://github.com/reactjs/React.NET/blob/main/src/React.Template/reactnet-webpack/webpack.config.js), which contains the configuration needed for webpack to create the bundles
+- [.babelrc](https://github.com/reactjs/React.NET/blob/main/src/React.Template/reactnet-webpack/.babelrc), which contains the Babel settings needed to compile JSX files
+
+Run `npm install` to start the package restore process.
+
+Then, create the `Content/components/expose-components.js` file which will be the entrypoint for both your client and server-side Javascript.
+
+```javascript
+// Content/components/expose-components.js
+
+import React from 'react';
+import ReactDOM from 'react-dom';
+import ReactDOMServer from 'react-dom/server';
+
+import RootComponent from './home.jsx';
+
+// any css-in-js or other libraries you want to use server-side
+import { ServerStyleSheet } from 'styled-components';
+import { renderStylesToString } from 'emotion-server';
+import Helmet from 'react-helmet';
+
+global.React = React;
+global.ReactDOM = ReactDOM;
+global.ReactDOMServer = ReactDOMServer;
+
+global.Styled = { ServerStyleSheet };
+global.Helmet = Helmet;
+
+global.Components = { RootComponent };
+```
+
+Once Webpack has been configured, run `npm run build` to build the bundles. Once you have verified that the bundle is being created correctly, you can modify your ReactJS.NET configuration (normally `App_Start\ReactConfig.cs`) to load the newly-created bundle.
+
+Reference the runtime, vendor, and main app bundles that were generated:
+
+```csharp
+ReactSiteConfiguration.Configuration
+ .SetLoadBabel(false)
+ .SetLoadReact(false)
+ .AddScriptWithoutTransform("~/dist/runtime.js")
+ .AddScriptWithoutTransform("~/dist/vendor.js")
+ .AddScriptWithoutTransform("~/dist/main.js");
+```
+
+This will load all your components into the `Components` global, which can be used from `Html.React` to render any of the components:
+
+```csharp
+// at the top of your layout
+@using React.AspNet
+
+@Html.React("Components.RootComponent", new {
+ someProp = "some value from .NET"
+})
+```
+
+Reference the built bundle directly in a script tag at the end of the page in `_Layout.cshtml`:
+
+```html
+// at the top of your layout
+@using React.AspNet
+
+
+
+
+
+```
+
+A full example is available in [the ReactJS.NET repository](https://github.com/reactjs/React.NET/tree/main/src/React.Template/reactnet-webpack).
+
+### 💡 Beta feature: Asset manifest handling
+
+An asset manifest is generated by the `webpack-asset-manifest` plugin, written to `asset-manifest.json`. See the webpack config example above for details on how to set this up. This manifest file contains a list of all of the bundles required to run your app. To use it, call `.SetReactAppBuildPath("~/dist")`. You may still provide exact paths to additional scripts by calling `AddScriptWithoutTransform("~/dist/path-to-your-file.js")`.
+
+```csharp
+ReactSiteConfiguration.Configuration
+ .SetLoadBabel(false)
+ .SetLoadReact(false)
+ .SetReactAppBuildPath("~/dist");
+```
+
+Then, make calls to `@Html.ReactGetScriptPaths()` and `@Html.ReactGetStylePaths()` where you would normally reference styles and scripts from your layout.
+
+```html
+// at the top of your layout
+@using React.AspNet
+
+
+ @Html.ReactGetStylePaths()
+
+
+```
diff --git a/site/jekyll/dev/contributing.md b/site/jekyll/dev/contributing.md
index c10ddef64..ff9bb920c 100644
--- a/site/jekyll/dev/contributing.md
+++ b/site/jekyll/dev/contributing.md
@@ -3,31 +3,25 @@ layout: docs
title: Contributing
---
-Pull Requests
--------------
+## Pull Requests
+
We actively welcome your pull requests on the
-[React.NET project on GitHub](http://github.com/reactjs/React.NET):
+[ReactJS.NET project on GitHub](http://github.com/reactjs/React.NET):
-1. Fork the repo and create your branch from `master`.
+1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
-6. If you haven't already, complete the Contributor License Agreement ("CLA").
-Contributor License Agreement ("CLA")
--------------------------------------
-In order to accept your pull request, we need you to submit a CLA. You only need
-to do this once to work on any of Facebook's open source projects.
+Visual Studio 2019 is required to compile ReactJS.NET. If you don't have Visual Studio 2019, get the [community edition](https://visualstudio.microsoft.com/downloads/) (it's free!)
-Complete your CLA here:
+## Issues
-Issues
-------
We use GitHub issues to track public bugs. Please ensure your description is
clear and has sufficient instructions to be able to reproduce the issue.
-License
--------
+## License
+
By contributing to ReactJS.NET, you agree that your contributions will be
licensed under its BSD license.
diff --git a/site/jekyll/features/css-in-js.md b/site/jekyll/features/css-in-js.md
new file mode 100644
index 000000000..9beba66ea
--- /dev/null
+++ b/site/jekyll/features/css-in-js.md
@@ -0,0 +1,237 @@
+---
+layout: docs
+title: CSS-in-JS
+---
+
+Just want to see the code? Check out the [sample project](https://github.com/reactjs/React.NET/tree/main/src/React.Template/reactnet-webpack).
+
+CSS-in-JS is a technique for declaring styles within components. ReactJS.NET supports server-rendered stylesheets for several libraries (pull requests welcome to add support for more!). Your project must be using a Javascript bundler such as webpack already.
+
+Make sure ReactJS.NET is up to date. You will need at least ReactJS.NET 4.0 (which is in public beta at the time of writing).
+
+If you're using more than one CSS-in-JS library in your project, we've got you covered! Just pass mutliple server-render helper functions into `ChainedRenderFunctions`, and they will be called in the order they are passed in.
+
+### [Styled Components](https://github.com/styled-components/styled-components)
+
+#### ⚠️ This may break when styled-components publishes a major update, please look at the [webpack sample](https://github.com/reactjs/React.NET/blob/main/src/React.Template/reactnet-webpack/package.json) for the currently known compatible version.
+
+Expose styled-components in your server bundle:
+
+```js
+import { ServerStyleSheet } from 'styled-components';
+global.Styled = { ServerStyleSheet };
+```
+
+Add the render helper to the call to `Html.React`:
+
+```
+@using React.AspNet
+@using React.RenderFunctions
+
+@{
+ var styledComponentsFunctions = new StyledComponentsFunctions();
+}
+
+@Html.React("RootComponent", new { exampleProp = "a" }, renderFunctions: new ChainedRenderFunctions(styledComponentsFunctions))
+
+@{
+ ViewBag.ServerStyles = styledComponentsFunctions.RenderedStyles;
+}
+```
+
+In your layout file, render the styles that are in the ViewBag:
+
+```
+
+
+
+ React Router Sample
+
+ @Html.Raw(ViewBag.ServerStyles)
+
+