实例介绍
ReactJS.NET是一个库,它使得在C#中使用Babel以及Facebook的React和JSX更加容易。
特点
- 通过Babel进行即时的JSX到JavaScript编译
- 通过流行的压缩/合并库进行JSX到JavaScript编译:
- ASP.NET捆绑和最小化
- Cassette
- Webpack
- MSBuild
- 服务器端组件渲染,使您的初始渲染超级快速,包括对以下内容的支持:
- CSS-in-JS库
- React路由器
- React头盔
- 通过实现IRenderFunctions并传递给Html.React的自定义JS逻辑
- 通过.NET Core和ChakraCore在Windows、OS X和Linux上运行
- 支持ASP.NET 4.0/4.5和ASP.NET Core
【实例截图】
【核心代码】
文件清单
└── React.NET-6d5bdb03157798e661900f895729496c0ffd9570
├── azure-pipelines.yml
├── build.proj
├── dev-build.bat
├── dev-build-push.bat
├── LICENSE
├── netlify.toml
├── README.md
├── release-build.bat
├── release-build-push.bat
├── renovate.json
├── runs-msbuild.bat
├── site
│ ├── build.sh
│ ├── jekyll
│ │ ├── _assets
│ │ │ └── stylesheets
│ │ │ ├── main.scss
│ │ │ ├── overrides.scss
│ │ │ ├── react.scss
│ │ │ ├── _solarized.scss
│ │ │ ├── syntax.scss
│ │ │ ├── _typography.scss
│ │ │ └── _variables.scss
│ │ ├── blog
│ │ │ ├── all.html
│ │ │ └── index.html
│ │ ├── bundling
│ │ │ ├── cassette.md
│ │ │ ├── msbuild.md
│ │ │ ├── weboptimizer.md
│ │ │ └── webpack.md
│ │ ├── _config.yml
│ │ ├── dev
│ │ │ ├── code-structure.md
│ │ │ └── contributing.md
│ │ ├── favicon
│ │ │ └── favicon.ico
│ │ ├── features
│ │ │ ├── css-in-js.md
│ │ │ ├── es6.md
│ │ │ ├── react-helmet.md
│ │ │ ├── react-router.md
│ │ │ ├── server-side-rendering.md
│ │ │ └── typescript.md
│ │ ├── feed.xml
│ │ ├── Gemfile
│ │ ├── Gemfile.lock
│ │ ├── getting-started
│ │ │ ├── aspnetcore.md
│ │ │ ├── aspnet.md
│ │ │ ├── chakracore.md
│ │ │ ├── download.md
│ │ │ └── usage.md
│ │ ├── img
│ │ │ ├── logo_64.png
│ │ │ ├── logo.svg
│ │ │ ├── search.png
│ │ │ └── tutorial
│ │ │ ├── basicmvc.png
│ │ │ ├── helloworld-2019.png
│ │ │ ├── helloworld.png
│ │ │ ├── json.png
│ │ │ ├── newproject_core_600.png
│ │ │ ├── newproject_core.png
│ │ │ ├── newproject.png
│ │ │ ├── new_webapp_2019.png
│ │ │ ├── new_webapp_600_2019.png
│ │ │ ├── nuget_core_2019.png
│ │ │ ├── nuget_core_650_2019.png
│ │ │ └── nuget.png
│ │ ├── _includes
│ │ │ ├── blog_post.html
│ │ │ ├── nav_blog.html
│ │ │ └── nav_docs.html
│ │ ├── index.md
│ │ ├── _layouts
│ │ │ ├── default.html
│ │ │ ├── docs.html
│ │ │ ├── page.html
│ │ │ └── post.html
│ │ ├── _plugins
│ │ │ ├── ext.rb
│ │ │ ├── header_links.rb
│ │ │ └── highlight_lines.rb
│ │ ├── _posts
│ │ │ ├── 2014-04-04-hello-world.md
│ │ │ ├── 2014-04-16-0.2.0-release.md
│ │ │ ├── 2014-04-25-1.0-release.md
│ │ │ ├── 2014-08-23-1.1-release.md
│ │ │ ├── 2014-09-14-1.1.2-release.md
│ │ │ ├── 2014-11-02-1.1.3-release.md
│ │ │ ├── 2014-11-22-1.2.0-release.md
│ │ │ ├── 2014-11-30-1.3.0-release.md
│ │ │ ├── 2015-03-02-1.4.0-release.md
│ │ │ ├── 2015-04-13-1.5.0-release.md
│ │ │ ├── 2015-04-23-1.5.1-release.md
│ │ │ ├── 2015-10-17-2.0.0-release.md
│ │ │ ├── 2015-11-16-2.1.0-release.md
│ │ │ ├── 2016-01-23-2.2.0-release.md
│ │ │ ├── 2016-04-11-2.3.0-release.md
│ │ │ ├── 2016-05-24-2.4.0-release.md
│ │ │ ├── 2016-08-23-protected-memory-exceptions-and-dotnet-core.md
│ │ │ ├── 2016-10-09-3.0.0-release.md
│ │ │ ├── 2017-07-02-3.1.0-release.md
│ │ │ ├── 2017-11-07-3.2.0-release.md
│ │ │ ├── 2018-03-04-3.3.0-release.md
│ │ │ ├── 2018-06-30-3.4.0-release.md
│ │ │ ├── 2019-01-16-4.0.0-release.md
│ │ │ ├── 2019-03-14-4.1.1-release.md
│ │ │ ├── 2019-07-16-5.0.0-release.md
│ │ │ ├── 2019-11-24-5.1.2-release.md
│ │ │ └── 2020-06-12-5.2-release.md
│ │ └── tutorials
│ │ ├── aspnet4.md
│ │ └── aspnetcore.md
│ ├── nginx.conf
│ ├── public
│ │ ├── 2014
│ │ ├── 2015
│ │ ├── 2016
│ │ ├── assets
│ │ ├── blog
│ │ ├── css
│ │ ├── dev
│ │ ├── feed.xml
│ │ ├── getting-started
│ │ ├── guides
│ │ ├── img
│ │ ├── index.html
│ │ └── packages
│ └── README.md
├── src
│ ├── Cassette.React
│ │ ├── AssemblyRegistration.cs
│ │ ├── BabelBundleProcessor.cs
│ │ ├── BabelCompiler.cs
│ │ ├── CassetteMSBuildStartup.cs
│ │ ├── Cassette.React.csproj
│ │ ├── InsertIntoPipelineJsxBundleProcessor.cs
│ │ ├── JsxFileSearchModifier.cs
│ │ ├── MSBuildUtils.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── ReactContainerConfiguration.cs
│ ├── Key.snk
│ ├── React.AspNet
│ │ ├── HtmlHelperExtensions.cs
│ │ └── React.AspNet.csproj
│ ├── React.AspNet.Middleware
│ │ ├── AspNetFileSystem.cs
│ │ ├── AssemblyRegistration.cs
│ │ ├── BabelFileMiddleware.cs
│ │ ├── BabelFileOptions.cs
│ │ ├── BabelFileSystem.cs
│ │ ├── HttpContextLifetimeProvider.cs
│ │ ├── MemoryFileCacheCore.cs
│ │ ├── React.AspNet.Middleware.csproj
│ │ ├── ReactBuilderExtensions.cs
│ │ └── ReactServiceCollectionExtensions.cs
│ ├── React.Core
│ │ ├── AssemblyRegistration.cs
│ │ ├── BabelConfig.cs
│ │ ├── Babel.cs
│ │ ├── BabelVersions.cs
│ │ ├── Exceptions
│ │ │ ├── BabelException.cs
│ │ │ ├── BabelNotLoadedException.cs
│ │ │ ├── ReactConfigurationException.cs
│ │ │ ├── ReactEngineNotFoundException.cs
│ │ │ ├── ReactException.cs
│ │ │ ├── ReactInvalidComponentException.cs
│ │ │ ├── ReactNotInitialisedException.cs
│ │ │ ├── ReactScriptLoadException.cs
│ │ │ ├── ReactScriptPrecompilationNotAvailableException.cs
│ │ │ └── ReactServerRenderingException.cs
│ │ ├── FileCacheHash.cs
│ │ ├── FileSystemBase.cs
│ │ ├── FileSystemExtensions.cs
│ │ ├── IAssemblyRegistration.cs
│ │ ├── IBabel.cs
│ │ ├── ICache.cs
│ │ ├── IFileCacheHash.cs
│ │ ├── IFileSystem.cs
│ │ ├── IJavaScriptEngineFactory.cs
│ │ ├── Initializer.cs
│ │ ├── IReactComponent.cs
│ │ ├── IReactEnvironment.cs
│ │ ├── IReactIdGenerator.cs
│ │ ├── IReactSiteConfiguration.cs
│ │ ├── IRenderFunctions.cs
│ │ ├── JavaScriptEngineFactory.cs
│ │ ├── JavaScriptEnginePrecompilationUtils.cs
│ │ ├── JavaScriptEngineUtils.cs
│ │ ├── JavaScriptWithSourceMap.cs
│ │ ├── MemoryFileCache.cs
│ │ ├── NullCache.cs
│ │ ├── package.json
│ │ ├── package-lock.json
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── ReactAppAssetManifest.cs
│ │ ├── ReactComponent.cs
│ │ ├── React.Core.csproj
│ │ ├── ReactEnvironment.cs
│ │ ├── ReactIdGenerator.cs
│ │ ├── ReactSiteConfiguration.cs
│ │ ├── RenderFunctions
│ │ │ ├── ChainedRenderFunctions.cs
│ │ │ ├── EmotionFunctions.cs
│ │ │ ├── ReactHelmetFunctions.cs
│ │ │ ├── ReactJssFunctions.cs
│ │ │ └── StyledComponentsFunctions.cs
│ │ ├── RenderFunctionsBase.cs
│ │ ├── Resources
│ │ │ ├── babel.js
│ │ │ ├── babel-legacy
│ │ │ │ ├── babel.js
│ │ │ │ ├── package.json
│ │ │ │ ├── package-lock.json
│ │ │ │ └── webpack.config.js
│ │ │ ├── react.js
│ │ │ └── shims.js
│ │ ├── SimpleFileSystem.cs
│ │ ├── SourceMap.cs
│ │ ├── SystemEnvironmentUtils.cs
│ │ ├── TinyIoC
│ │ │ └── TinyIoC.cs
│ │ ├── TinyIoCExtensions.cs
│ │ └── webpack.config.js
│ ├── React.MSBuild
│ │ ├── AssemblyBindingRedirect.cs
│ │ ├── AssemblyRegistration.cs
│ │ ├── Content
│ │ │ └── TransformBabel.proj
│ │ ├── MSBuildHost.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── React.MSBuild.csproj
│ │ ├── tools
│ │ │ ├── install.ps1
│ │ │ └── uninstall.ps1
│ │ └── TransformBabel.cs
│ ├── React.Owin
│ │ ├── AssemblyRegistration.cs
│ │ ├── BabelFileExtensions.cs
│ │ ├── BabelFileMiddleware.cs
│ │ ├── EntryAssemblyFileSystem.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── React.Owin.csproj
│ ├── React.Router
│ │ ├── ExecutionResult.cs
│ │ ├── HtmlHelperExtensions.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── ReactEnvironmentExtensions.cs
│ │ ├── ReactRouterComponent.cs
│ │ ├── React.Router.csproj
│ │ ├── ReactRouterException.cs
│ │ ├── ReactRouterFunctions.cs
│ │ ├── RoutingContext.cs
│ │ └── SetServerResponse.cs
│ ├── React.Router.Mvc4
│ │ ├── Content
│ │ │ └── Views
│ │ │ └── web.config.transform
│ │ └── React.Router.Mvc4.csproj
│ ├── React.Sample.Cassette
│ │ ├── App_Start
│ │ │ └── ReactConfig.cs
│ │ ├── CassetteConfiguration.cs
│ │ ├── Cassette.targets
│ │ ├── Content
│ │ │ ├── Sample.css
│ │ │ └── Sample.jsx
│ │ ├── Global.asax
│ │ ├── Global.asax.cs
│ │ ├── packages.config
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── React.Sample.Cassette.csproj
│ │ ├── Views
│ │ │ ├── Home
│ │ │ │ └── Index.cshtml
│ │ │ └── Web.config
│ │ ├── Web.config
│ │ ├── Web.Debug.config
│ │ └── Web.Release.config
│ ├── React.Sample.ConsoleApp
│ │ ├── App.config
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── React.Sample.ConsoleApp.csproj
│ │ └── Sample.jsx
│ ├── React.Sample.Mvc4
│ │ ├── App_Start
│ │ │ ├── BundleConfig.cs
│ │ │ ├── FilterConfig.cs
│ │ │ ├── ReactConfig.cs
│ │ │ └── RouteConfig.cs
│ │ ├── Content
│ │ │ ├── lib
│ │ │ │ └── reactstrap.min.js
│ │ │ ├── Sample.css
│ │ │ └── Sample.tsx
│ │ ├── Controllers
│ │ │ └── HomeController.cs
│ │ ├── Global.asax
│ │ ├── Global.asax.cs
│ │ ├── package.json
│ │ ├── package-lock.json
│ │ ├── packages.config
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── React.Sample.Mvc4.csproj
│ │ ├── TransformBabel.proj
│ │ ├── tsconfig.json
│ │ ├── types
│ │ │ └── index.d.ts
│ │ ├── Views
│ │ │ ├── Home
│ │ │ │ └── Index.cshtml
│ │ │ └── Web.config
│ │ ├── Web.config
│ │ ├── Web.Debug.config
│ │ └── Web.Release.config
│ ├── React.Sample.Owin
│ │ ├── CommentsMiddleware.cs
│ │ ├── Content
│ │ │ ├── Index.html
│ │ │ ├── Sample.css
│ │ │ └── Sample.jsx
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── React.Sample.Owin.csproj
│ │ └── Startup.cs
│ ├── React.Sample.Webpack.CoreMvc
│ │ └── README.md
│ ├── React.sln
│ ├── React.Template
│ │ ├── reactnet-vanilla
│ │ │ ├── app.config
│ │ │ ├── appsettings.json
│ │ │ ├── Controllers
│ │ │ │ └── HomeController.cs
│ │ │ ├── Models
│ │ │ │ └── CommentModel.cs
│ │ │ ├── Program.cs
│ │ │ ├── Properties
│ │ │ │ └── launchSettings.json
│ │ │ ├── ReactDemo.sln
│ │ │ ├── README.md
│ │ │ ├── Startup.cs
│ │ │ ├── tutorial-code.csproj
│ │ │ ├── Views
│ │ │ │ ├── Home
│ │ │ │ │ └── Index.cshtml
│ │ │ │ └── _ViewImports.cshtml
│ │ │ ├── web.config
│ │ │ └── wwwroot
│ │ │ └── js
│ │ │ ├── remarkable.min.js
│ │ │ └── tutorial.jsx
│ │ ├── reactnet-webpack
│ │ │ ├── appsettings.Development.json
│ │ │ ├── appsettings.json
│ │ │ ├── Content
│ │ │ │ └── components
│ │ │ │ ├── comments
│ │ │ │ │ └── Sample.jsx
│ │ │ │ ├── emotion.jsx
│ │ │ │ ├── expose-components.js
│ │ │ │ ├── home.jsx
│ │ │ │ ├── lazy-load.jsx
│ │ │ │ ├── react-jss.jsx
│ │ │ │ └── styled-components.jsx
│ │ │ ├── Controllers
│ │ │ │ └── HomeController.cs
│ │ │ ├── package.json
│ │ │ ├── package-lock.json
│ │ │ ├── Program.cs
│ │ │ ├── Properties
│ │ │ │ └── launchSettings.json
│ │ │ ├── SampleApp.csproj
│ │ │ ├── Startup.cs
│ │ │ ├── Views
│ │ │ │ ├── Home
│ │ │ │ │ └── Index.cshtml
│ │ │ │ └── Shared
│ │ │ │ └── _Layout.cshtml
│ │ │ ├── webpack.config.js
│ │ │ └── wwwroot
│ │ │ └── Sample.css
│ │ └── React.Template.csproj
│ ├── React.Web
│ │ ├── AspNetCache.cs
│ │ ├── AspNetFileSystem.cs
│ │ ├── AssemblyRegistration.cs
│ │ ├── BabelHandler.cs
│ │ ├── BabelHandlerFactory.cs
│ │ ├── Content
│ │ │ ├── App_Start
│ │ │ │ └── ReactConfig.cs.pp
│ │ │ └── web.config.transform
│ │ ├── Exceptions
│ │ │ └── ReactAspNetException.cs
│ │ ├── IBabelHandler.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── React.Web.csproj
│ │ ├── TinyIoCAspNetExtensions.cs
│ │ └── WebInitializer.cs
│ ├── React.Web.Mvc4
│ │ ├── Content
│ │ │ └── Views
│ │ │ └── web.config.transform
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── React.Web.Mvc4.csproj
│ ├── release-build.bat
│ ├── SharedAssemblyInfo.cs
│ └── System.Web.Optimization.React
│ ├── BabelBundle.cs
│ ├── BabelTransform.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── readme.txt
│ └── System.Web.Optimization.React.csproj
├── tests
│ ├── React.Tests
│ │ ├── Core
│ │ │ ├── BabelTransformerTests.cs
│ │ │ ├── FileCacheHashTests.cs
│ │ │ ├── FileSystemBaseTests.cs
│ │ │ ├── FileSystemExtensionsTest.cs
│ │ │ ├── JavaScriptEngineFactoryTest.cs
│ │ │ ├── JavaScriptEngineUtilsTests.cs
│ │ │ ├── MiddlewareTests.cs
│ │ │ ├── ReactComponentTest.cs
│ │ │ ├── ReactEnvironmentTest.cs
│ │ │ └── ReactIdGeneratorTests.cs
│ │ ├── Mvc
│ │ │ ├── HtmlHelperExtensionsTests.cs
│ │ │ └── TestUtilities.cs
│ │ ├── Owin
│ │ │ └── EntryAssemblyFileSystemTests.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── React.Tests.csproj
│ │ └── Router
│ │ ├── HtmlHelperExtensionsTest.cs
│ │ ├── ReactEnvironmentExtensionsTest.cs
│ │ └── ReactRouterComponentTest.cs
│ ├── React.Tests.Benchmarks
│ │ ├── ComponentRenderBenchmarksBase.cs
│ │ ├── ComponentRenderWithBabelBenchmarks.cs
│ │ ├── ComponentRenderWithoutBabelBenchmarks.cs
│ │ ├── Program.cs
│ │ ├── React.Tests.Benchmarks.csproj
│ │ ├── Sample.js
│ │ ├── Sample.jsx
│ │ └── Utils.cs
│ ├── React.Tests.Common
│ │ ├── MemoryFileCacheCore.cs
│ │ ├── PhysicalFileSystem.cs
│ │ └── React.Tests.Common.csproj
│ └── React.Tests.Integration
│ ├── React.Tests.Integration.csproj
│ ├── Sample.js
│ ├── Sample.jsx
│ ├── Sample.tsx
│ └── ServerRenderTests.cs
├── tools
│ ├── MSBuildTasks
│ │ ├── MSBuild.Community.Tasks.dll
│ │ └── MSBuild.Community.Tasks.Targets
│ └── NuGet
│ └── nuget.exe
├── tutorial-code
│ └── README.md
└── webhooks
├── host.json
├── local.settings.json
├── NetlifyHookBody.cs
├── NetlifyHook.cs
├── React.Site.Hooks.csproj
└── React.Site.Hooks.sln
108 directories, 382 files
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论