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 158447dd7..b32bd32fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ _old/ src/SharedAssemblyVersionInfo.cs *.nupkg +*.snupkg src/**/*.nuspec !src/template.nuspec site/jekyll/_site @@ -13,6 +14,7 @@ src/React.Sample.Webpack/build *.lock.json .vs/ results/ +dist/ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. diff --git a/README.md b/README.md index 6be5a09ab..8a6674e56 100644 --- a/README.md +++ b/README.md @@ -1,57 +1,44 @@ # [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/) # 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/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 (experimental!) -* [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 -* Server-side style rendering with CSS-in-JS libraries +- 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/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 # Quick Start -Install the package - ``` -Install-Package React.Web.Mvc4 # For ASP.NET MVC 4 or 5 -Install-Package React.AspNet # For ASP.NET Core MVC +dotnet new -i React.Template +dotnet new reactnet-vanilla +dotnet run ``` -Create JSX files - -```javascript -// /Scripts/HelloWorld.jsx -class HelloWorld extends React.Component { - render() { - return