From d491f1b3819bd028fc06775542b503ace3c9e152 Mon Sep 17 00:00:00 2001 From: Charalampos Karypidis Date: Tue, 7 Jun 2016 22:03:20 +0200 Subject: [PATCH] Add React Redux template in ES6 syntax #117 --- JavaScriptServices.sln | 9 +- templates/ReactReduxSpaES6/.babelrc | 3 + templates/ReactReduxSpaES6/.gitignore | 237 ++++++++++++++++++ .../ReactReduxSpaES6/ClientApp/.editorconfig | 17 ++ .../ReactReduxSpaES6/ClientApp/boot-client.js | 23 ++ .../ReactReduxSpaES6/ClientApp/boot-server.js | 37 +++ .../ClientApp/components/Counter.jsx | 36 +++ .../ClientApp/components/FetchData.jsx | 85 +++++++ .../ClientApp/components/Home.jsx | 28 +++ .../ClientApp/components/Layout.jsx | 25 ++ .../ClientApp/components/NavMenu.jsx | 44 ++++ .../ClientApp/configureStore.js | 22 ++ .../ReactReduxSpaES6/ClientApp/css/site.css | 66 +++++ .../ClientApp/reducers/counter.js | 18 ++ .../ClientApp/reducers/index.js | 11 + .../ClientApp/reducers/weatherForecasts.js | 46 ++++ .../ReactReduxSpaES6/ClientApp/routes.js | 15 ++ .../Controllers/HomeController.cs | 21 ++ .../Controllers/SampleDataController.cs | 44 ++++ templates/ReactReduxSpaES6/Dockerfile | 11 + templates/ReactReduxSpaES6/README.md | 40 +++ .../ReactReduxSpaES6/ReactReduxSpaES6.xproj | 21 ++ templates/ReactReduxSpaES6/Startup.cs | 63 +++++ .../ReactReduxSpaES6/Views/Home/Index.cshtml | 10 + .../Views/Shared/Error.cshtml | 6 + .../Views/Shared/_Layout.cshtml | 17 ++ .../Views/_ViewImports.cshtml | 3 + .../ReactReduxSpaES6/Views/_ViewStart.cshtml | 3 + templates/ReactReduxSpaES6/appsettings.json | 10 + templates/ReactReduxSpaES6/jsconfig.json | 16 ++ templates/ReactReduxSpaES6/package.json | 34 +++ templates/ReactReduxSpaES6/project.json | 53 ++++ .../ReactReduxSpaES6/webpack.config.dev.js | 3 + templates/ReactReduxSpaES6/webpack.config.js | 35 +++ .../ReactReduxSpaES6/webpack.config.prod.js | 9 + .../ReactReduxSpaES6/webpack.config.vendor.js | 37 +++ .../ReactReduxSpaES6/wwwroot/favicon.ico | Bin 0 -> 32038 bytes 37 files changed, 1157 insertions(+), 1 deletion(-) create mode 100644 templates/ReactReduxSpaES6/.babelrc create mode 100644 templates/ReactReduxSpaES6/.gitignore create mode 100644 templates/ReactReduxSpaES6/ClientApp/.editorconfig create mode 100644 templates/ReactReduxSpaES6/ClientApp/boot-client.js create mode 100644 templates/ReactReduxSpaES6/ClientApp/boot-server.js create mode 100644 templates/ReactReduxSpaES6/ClientApp/components/Counter.jsx create mode 100644 templates/ReactReduxSpaES6/ClientApp/components/FetchData.jsx create mode 100644 templates/ReactReduxSpaES6/ClientApp/components/Home.jsx create mode 100644 templates/ReactReduxSpaES6/ClientApp/components/Layout.jsx create mode 100644 templates/ReactReduxSpaES6/ClientApp/components/NavMenu.jsx create mode 100644 templates/ReactReduxSpaES6/ClientApp/configureStore.js create mode 100644 templates/ReactReduxSpaES6/ClientApp/css/site.css create mode 100644 templates/ReactReduxSpaES6/ClientApp/reducers/counter.js create mode 100644 templates/ReactReduxSpaES6/ClientApp/reducers/index.js create mode 100644 templates/ReactReduxSpaES6/ClientApp/reducers/weatherForecasts.js create mode 100644 templates/ReactReduxSpaES6/ClientApp/routes.js create mode 100644 templates/ReactReduxSpaES6/Controllers/HomeController.cs create mode 100644 templates/ReactReduxSpaES6/Controllers/SampleDataController.cs create mode 100644 templates/ReactReduxSpaES6/Dockerfile create mode 100644 templates/ReactReduxSpaES6/README.md create mode 100644 templates/ReactReduxSpaES6/ReactReduxSpaES6.xproj create mode 100644 templates/ReactReduxSpaES6/Startup.cs create mode 100644 templates/ReactReduxSpaES6/Views/Home/Index.cshtml create mode 100644 templates/ReactReduxSpaES6/Views/Shared/Error.cshtml create mode 100644 templates/ReactReduxSpaES6/Views/Shared/_Layout.cshtml create mode 100644 templates/ReactReduxSpaES6/Views/_ViewImports.cshtml create mode 100644 templates/ReactReduxSpaES6/Views/_ViewStart.cshtml create mode 100644 templates/ReactReduxSpaES6/appsettings.json create mode 100644 templates/ReactReduxSpaES6/jsconfig.json create mode 100644 templates/ReactReduxSpaES6/package.json create mode 100644 templates/ReactReduxSpaES6/project.json create mode 100644 templates/ReactReduxSpaES6/webpack.config.dev.js create mode 100644 templates/ReactReduxSpaES6/webpack.config.js create mode 100644 templates/ReactReduxSpaES6/webpack.config.prod.js create mode 100644 templates/ReactReduxSpaES6/webpack.config.vendor.js create mode 100644 templates/ReactReduxSpaES6/wwwroot/favicon.ico diff --git a/JavaScriptServices.sln b/JavaScriptServices.sln index 9b150601..a0bc41dd 100644 --- a/JavaScriptServices.sln +++ b/JavaScriptServices.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 +VisualStudioVersion = 14.0.25123.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{E6E88944-4800-40BA-8AF5-069EA3ADFEB8}" EndProject @@ -34,6 +34,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ReactSpa", "templates\React EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApplicationBasic", "templates\WebApplicationBasic\WebApplicationBasic.xproj", "{CB4398D6-B7F1-449A-AE02-828769679232}" EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ReactReduxSpaES6", "templates\ReactReduxSpaES6\ReactReduxSpaES6.xproj", "{26BFA8EE-1E46-4870-90A3-9E946C569284}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -84,6 +86,10 @@ Global {CB4398D6-B7F1-449A-AE02-828769679232}.Debug|Any CPU.Build.0 = Debug|Any CPU {CB4398D6-B7F1-449A-AE02-828769679232}.Release|Any CPU.ActiveCfg = Release|Any CPU {CB4398D6-B7F1-449A-AE02-828769679232}.Release|Any CPU.Build.0 = Release|Any CPU + {26BFA8EE-1E46-4870-90A3-9E946C569284}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {26BFA8EE-1E46-4870-90A3-9E946C569284}.Debug|Any CPU.Build.0 = Debug|Any CPU + {26BFA8EE-1E46-4870-90A3-9E946C569284}.Release|Any CPU.ActiveCfg = Release|Any CPU + {26BFA8EE-1E46-4870-90A3-9E946C569284}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -96,5 +102,6 @@ Global {DBFC6DB0-A6D1-4694-A108-1C604B988DA3} = {727E6D58-6830-4792-96C6-E138A33959FB} {E9D1A695-F0E6-46F2-B5E3-72F4AF805387} = {727E6D58-6830-4792-96C6-E138A33959FB} {CB4398D6-B7F1-449A-AE02-828769679232} = {727E6D58-6830-4792-96C6-E138A33959FB} + {26BFA8EE-1E46-4870-90A3-9E946C569284} = {727E6D58-6830-4792-96C6-E138A33959FB} EndGlobalSection EndGlobal diff --git a/templates/ReactReduxSpaES6/.babelrc b/templates/ReactReduxSpaES6/.babelrc new file mode 100644 index 00000000..86c445f5 --- /dev/null +++ b/templates/ReactReduxSpaES6/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015", "react"] +} diff --git a/templates/ReactReduxSpaES6/.gitignore b/templates/ReactReduxSpaES6/.gitignore new file mode 100644 index 00000000..d410b8bb --- /dev/null +++ b/templates/ReactReduxSpaES6/.gitignore @@ -0,0 +1,237 @@ +/Properties/launchSettings.json + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +bin/ +Bin/ +obj/ +Obj/ + +# Visual Studio 2015 cache/options directory +.vs/ +/wwwroot/dist/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Microsoft Azure ApplicationInsights config file +ApplicationInsights.config + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ diff --git a/templates/ReactReduxSpaES6/ClientApp/.editorconfig b/templates/ReactReduxSpaES6/ClientApp/.editorconfig new file mode 100644 index 00000000..a082ad7a --- /dev/null +++ b/templates/ReactReduxSpaES6/ClientApp/.editorconfig @@ -0,0 +1,17 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# http://editorconfig.org + +root = true + +[*] + +# Change these settings to your own preference +indent_style = space +indent_size = 2 + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/templates/ReactReduxSpaES6/ClientApp/boot-client.js b/templates/ReactReduxSpaES6/ClientApp/boot-client.js new file mode 100644 index 00000000..3a4d49cb --- /dev/null +++ b/templates/ReactReduxSpaES6/ClientApp/boot-client.js @@ -0,0 +1,23 @@ +import './css/site.css'; +import 'bootstrap'; +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; +import { Provider } from 'react-redux'; +import { browserHistory, Router } from 'react-router'; +import { syncHistoryWithStore } from 'react-router-redux'; +import configureStore from './configureStore'; +import routes from './routes'; + +// Get the application-wide store instance, prepopulating with state from the server where available. +const initialState = window.initialReduxState; +const store = configureStore(initialState); +const history = syncHistoryWithStore(browserHistory, store); + +// This code starts up the React app when it runs in a browser. It sets up the routing configuration +// and injects the app into a DOM element. +ReactDOM.render( + + + , + document.getElementById('react-app') +); diff --git a/templates/ReactReduxSpaES6/ClientApp/boot-server.js b/templates/ReactReduxSpaES6/ClientApp/boot-server.js new file mode 100644 index 00000000..86397979 --- /dev/null +++ b/templates/ReactReduxSpaES6/ClientApp/boot-server.js @@ -0,0 +1,37 @@ +import * as React from 'react'; +import { renderToString } from 'react-dom/server'; +import { Provider } from 'react-redux'; +import { match, RouterContext } from 'react-router'; + +import routes from './routes'; +import configureStore from './configureStore'; + +export default (params) => { + return new Promise((resolve, reject) => { + match({routes, location: params.location}, (error, redirectLocation, renderProps) => { + if (error) { + throw error; + } + // At this point if we want to initialize the store we need to pass an object with shape + // {counter: {count: 10}} + const store = configureStore(); + const app = ( + + + + ); + + // Perform an initial render that will cause any async tasks (e.g., data access) to begin + renderToString(app); + + // Once the tasks are done, we can perform the final render + // We also send the redux store state, so the client can continue execution where the server left off + params.domainTasks.then(() => { + resolve({ + html: renderToString(app), + globals: { initialReduxState: store.getState() } + }); + }, reject); // Also propagate any errors back into the host application + }); + }); +}; diff --git a/templates/ReactReduxSpaES6/ClientApp/components/Counter.jsx b/templates/ReactReduxSpaES6/ClientApp/components/Counter.jsx new file mode 100644 index 00000000..bf7928c2 --- /dev/null +++ b/templates/ReactReduxSpaES6/ClientApp/components/Counter.jsx @@ -0,0 +1,36 @@ +import React, {Component, PropTypes} from 'react'; +import { connect } from 'react-redux'; +import { incrementCount } from '../reducers/counter'; + +class Counter extends Component { + render() { + return ( +
+

Counter

+

This is a simple example of a React component.

+

Current count: { this.props.count }

+ +
+ ); + } +} + +Counter.propTypes = { + count: PropTypes.number.isRequired, + increment: PropTypes.func.isRequired, +}; + +const mapStateToProps = (state) => ({ + count: state.counter.count +}); + +const mapDispatchToProps = (dispatch) => ({ + increment: () => { + dispatch(incrementCount()); + } +}); + +export default connect( + mapStateToProps, + mapDispatchToProps +)(Counter); diff --git a/templates/ReactReduxSpaES6/ClientApp/components/FetchData.jsx b/templates/ReactReduxSpaES6/ClientApp/components/FetchData.jsx new file mode 100644 index 00000000..c8977d48 --- /dev/null +++ b/templates/ReactReduxSpaES6/ClientApp/components/FetchData.jsx @@ -0,0 +1,85 @@ +import React, {Component, PropTypes} from 'react'; +import { connect } from 'react-redux'; +import { Link } from 'react-router'; +import { requestWeatherForecasts } from '../reducers/weatherForecasts' + +class FetchData extends Component { + componentWillMount() { + // This method runs when the component is first added to the page + let startDateIndex = parseInt(this.props.params.startDateIndex) || 0; + this.props.requestWeatherForecasts(startDateIndex); + } + + componentWillReceiveProps(nextProps) { + // This method runs when incoming props (e.g., route params) change + let startDateIndex = parseInt(nextProps.params.startDateIndex) || 0; + this.props.requestWeatherForecasts(startDateIndex); + } + + render() { + const table = ( + + + + + + + + + + + {this.props.forecasts.map(forecast => + + + + + + + )} + +
DateTemp. (C)Temp. (F)Summary
{ forecast.dateFormatted }{ forecast.temperatureC }{ forecast.temperatureF }{ forecast.summary }
+ ); + + let prevStartDateIndex = this.props.startDateIndex - 5; + let nextStartDateIndex = this.props.startDateIndex + 5; + const pagination = ( +

+ Previous + Next + { this.props.isLoading ? Loading... : [] } +

+ ); + + return ( +
+

Weather forecast

+

This component demonstrates fetching data from the server and working with URL parameters.

+ { table } + { pagination } +
+ ); + } +} + +FetchData.propTypes = { + startDateIndex: PropTypes.number, + isLoading: PropTypes.bool, + requestWeatherForecasts: PropTypes.func.isRequired +}; + +const mapStateToProps = (state) => ({ + startDateIndex: state.weatherForecasts.startDateIndex, + forecasts: state.weatherForecasts.forecasts, + isLoading: state.weatherForecasts.isLoading +}); + +const mapDispatchToProps = (dispatch) => ({ + requestWeatherForecasts: (startDateIndex) => { + dispatch(requestWeatherForecasts(startDateIndex)); + } +}); + +export default connect( + mapStateToProps, + mapDispatchToProps +)(FetchData); diff --git a/templates/ReactReduxSpaES6/ClientApp/components/Home.jsx b/templates/ReactReduxSpaES6/ClientApp/components/Home.jsx new file mode 100644 index 00000000..71bb2656 --- /dev/null +++ b/templates/ReactReduxSpaES6/ClientApp/components/Home.jsx @@ -0,0 +1,28 @@ +import React, {Component} from 'react'; + +class Home extends Component { + render() { + return ( +
+

Hello, world!

+

Welcome to your new single-page application, built with:

+ +

To help you get started, we've also set up:

+ +
+ ); + } +} + +export default Home; diff --git a/templates/ReactReduxSpaES6/ClientApp/components/Layout.jsx b/templates/ReactReduxSpaES6/ClientApp/components/Layout.jsx new file mode 100644 index 00000000..94ba4dc6 --- /dev/null +++ b/templates/ReactReduxSpaES6/ClientApp/components/Layout.jsx @@ -0,0 +1,25 @@ +import React, {Component, PropTypes} from 'react'; +import NavMenu from './NavMenu'; + +class Layout extends Component { + render() { + return ( +
+
+
+ +
+
+ {this.props.body} +
+
+
+ ); + } +} + +Layout.propTypes = { + body: PropTypes.element, +}; + +export default Layout; diff --git a/templates/ReactReduxSpaES6/ClientApp/components/NavMenu.jsx b/templates/ReactReduxSpaES6/ClientApp/components/NavMenu.jsx new file mode 100644 index 00000000..c0aac791 --- /dev/null +++ b/templates/ReactReduxSpaES6/ClientApp/components/NavMenu.jsx @@ -0,0 +1,44 @@ +import React, {Component} from 'react'; +import { Link } from 'react-router'; + +class NavMenu extends Component { + render() { + return ( +
+
+
+ + WebApplicationBasic +
+
+
+
    +
  • + + Home + +
  • +
  • + + Counter + +
  • +
  • + + Fetch data + +
  • +
+
+
+
+ ); + } +} + +export default NavMenu; diff --git a/templates/ReactReduxSpaES6/ClientApp/configureStore.js b/templates/ReactReduxSpaES6/ClientApp/configureStore.js new file mode 100644 index 00000000..62978659 --- /dev/null +++ b/templates/ReactReduxSpaES6/ClientApp/configureStore.js @@ -0,0 +1,22 @@ +import { createStore, compose, applyMiddleware } from 'redux'; +import thunkMiddleware from 'redux-thunk'; +import rootReducer from './reducers' + +export default (initialState) => { + const windowIfDefined = typeof window === 'undefined' ? null : window; + const devToolsExtension = windowIfDefined && windowIfDefined.devToolsExtension; // If devTools is installed, connect to it + const createStoreWithMiddleware = compose( + applyMiddleware(thunkMiddleware), + devToolsExtension ? devToolsExtension() : f => f + )(createStore); + + const store = createStoreWithMiddleware(rootReducer, initialState); + // Enable Webpack hot module replacement for reducers + if (module.hot) { + module.hot.accept('./reducers', () => { + store.replaceReducer(require('./reducers')); + }); + } + + return store; +}; diff --git a/templates/ReactReduxSpaES6/ClientApp/css/site.css b/templates/ReactReduxSpaES6/ClientApp/css/site.css new file mode 100644 index 00000000..3058af68 --- /dev/null +++ b/templates/ReactReduxSpaES6/ClientApp/css/site.css @@ -0,0 +1,66 @@ +.main-nav li .glyphicon { + margin-right: 10px; +} + +/* Highlighting rules for nav menu items */ +.main-nav li a.active, +.main-nav li a.active:hover, +.main-nav li a.active:focus { + background-color: #4189C7; + color: white; +} + +/* Keep the nav menu independent of scrolling and on top of other items */ +.main-nav { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 1; +} + +@media (max-width: 767px) { + /* On small screens, the nav menu spans the full width of the screen. Leave a space for it. */ + body { + padding-top: 50px; + } +} + +@media (min-width: 768px) { + /* On small screens, convert the nav menu to a vertical sidebar */ + .main-nav { + height: 100%; + width: calc(25% - 20px); + } + .main-nav .navbar { + border-radius: 0px; + border-width: 0px; + height: 100%; + } + .main-nav .navbar-header { + float: none; + } + .main-nav .navbar-collapse { + border-top: 1px solid #444; + padding: 0px; + } + .main-nav .navbar ul { + float: none; + } + .main-nav .navbar li { + float: none; + font-size: 15px; + margin: 6px; + } + .main-nav .navbar li a { + padding: 10px 16px; + border-radius: 4px; + } + .main-nav .navbar a { + /* If a menu item's text is too long, truncate it */ + width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } +} diff --git a/templates/ReactReduxSpaES6/ClientApp/reducers/counter.js b/templates/ReactReduxSpaES6/ClientApp/reducers/counter.js new file mode 100644 index 00000000..bea24bd1 --- /dev/null +++ b/templates/ReactReduxSpaES6/ClientApp/reducers/counter.js @@ -0,0 +1,18 @@ +// Constant defining the action type +const INCREMENT_COUNT = 'INCREMENT_COUNT'; + +// Action creator +export const incrementCount = () => ({type: INCREMENT_COUNT}); + +const initialState = { + count: 0 +}; + +// The reducer that changes the state based on the action type +export default (state = initialState, action) => { + if (action.type === INCREMENT_COUNT) { + return { count: state.count +1 }; + } + + return state; +} diff --git a/templates/ReactReduxSpaES6/ClientApp/reducers/index.js b/templates/ReactReduxSpaES6/ClientApp/reducers/index.js new file mode 100644 index 00000000..92da6c9f --- /dev/null +++ b/templates/ReactReduxSpaES6/ClientApp/reducers/index.js @@ -0,0 +1,11 @@ +import { combineReducers } from 'redux'; +import { routerReducer } from 'react-router-redux' + +import counter from './counter'; +import weatherForecasts from './weatherForecasts'; + +export default combineReducers({ + routing: routerReducer, + counter, + weatherForecasts +}); diff --git a/templates/ReactReduxSpaES6/ClientApp/reducers/weatherForecasts.js b/templates/ReactReduxSpaES6/ClientApp/reducers/weatherForecasts.js new file mode 100644 index 00000000..f4156bb1 --- /dev/null +++ b/templates/ReactReduxSpaES6/ClientApp/reducers/weatherForecasts.js @@ -0,0 +1,46 @@ +import { fetch } from 'domain-task/fetch'; + +// Constant defining the action type +const REQUEST_WEATHER_FORECASTS = 'REQUEST_WEATHER_FORECASTS'; +const RECEIVE_WEATHER_FORECASTS = 'RECEIVE_WEATHER_FORECASTS'; + +// Action creators +export const requestWeatherForecasts = (startDateIndex) => { + return (dispatch, getState) => { + if (startDateIndex !== getState().weatherForecasts.startDateIndex) { + dispatch({type: REQUEST_WEATHER_FORECASTS, payload: startDateIndex}); + return fetch(`/api/SampleData/WeatherForecasts?startDateIndex=${ startDateIndex }`) + .then(response => response.json()) + .then((data) => { + dispatch(receiveWeatherForecasts(startDateIndex, data)); + }); + } + }; +}; + +export const receiveWeatherForecasts = (startDateIndex, forecasts) => ({ + type: RECEIVE_WEATHER_FORECASTS, + payload: {startDateIndex, forecasts}, +}); + +const initialState = { + startDateIndex: null, + forecasts: [], + isLoading: false +}; + +// The reducer that changes the state based on the action type +export default (state = initialState, action) => { + + if (action.type === REQUEST_WEATHER_FORECASTS) { + return { startDateIndex: action.payload, isLoading: true, forecasts: state.forecasts }; + } else if (action.type === RECEIVE_WEATHER_FORECASTS) { + // Only accept the incoming data if it matches the most recent request. This ensures we correctly + // handle out-of-order responses. + if (action.payload.startDateIndex === state.startDateIndex) { + return { startDateIndex: action.payload.startDateIndex, forecasts: action.payload.forecasts, isLoading: false }; + } + } + + return state; +} diff --git a/templates/ReactReduxSpaES6/ClientApp/routes.js b/templates/ReactReduxSpaES6/ClientApp/routes.js new file mode 100644 index 00000000..38a16423 --- /dev/null +++ b/templates/ReactReduxSpaES6/ClientApp/routes.js @@ -0,0 +1,15 @@ +import React from 'React'; +import {Router, Route, HistoryBase} from 'react-router'; +import Layout from './components/layout'; +import Home from './components/home'; +import FetchData from './components/fetchData'; +import Counter from './components/counter'; + +export default + + + + + { /* Optional route segment that does not affect NavMenu highlighting */ } + + ; diff --git a/templates/ReactReduxSpaES6/Controllers/HomeController.cs b/templates/ReactReduxSpaES6/Controllers/HomeController.cs new file mode 100644 index 00000000..51f01f45 --- /dev/null +++ b/templates/ReactReduxSpaES6/Controllers/HomeController.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace ReactReduxSpaES6.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() + { + return View(); + } + + public IActionResult Error() + { + return View(); + } + } +} diff --git a/templates/ReactReduxSpaES6/Controllers/SampleDataController.cs b/templates/ReactReduxSpaES6/Controllers/SampleDataController.cs new file mode 100644 index 00000000..9f240570 --- /dev/null +++ b/templates/ReactReduxSpaES6/Controllers/SampleDataController.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace WebApplicationBasic.Controllers +{ + [Route("api/[controller]")] + public class SampleDataController : Controller + { + private static string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + [HttpGet("[action]")] + public IEnumerable WeatherForecasts(int startDateIndex) + { + var rng = new Random(); + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + DateFormatted = DateTime.Now.AddDays(index + startDateIndex).ToString("d"), + TemperatureC = rng.Next(-20, 55), + Summary = Summaries[rng.Next(Summaries.Length)] + }); + } + + public class WeatherForecast + { + public string DateFormatted { get; set; } + public int TemperatureC { get; set; } + public string Summary { get; set; } + + public int TemperatureF + { + get + { + return 32 + (int)(this.TemperatureC / 0.5556); + } + } + } + } +} diff --git a/templates/ReactReduxSpaES6/Dockerfile b/templates/ReactReduxSpaES6/Dockerfile new file mode 100644 index 00000000..63d7c456 --- /dev/null +++ b/templates/ReactReduxSpaES6/Dockerfile @@ -0,0 +1,11 @@ +FROM microsoft/aspnet:1.0.0-rc1-update1 + +RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list +RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/* + +COPY . /app +WORKDIR /app +RUN ["dnu", "restore"] + +EXPOSE 5000/tcp +ENTRYPOINT ["dnx", "-p", "project.json", "web"] diff --git a/templates/ReactReduxSpaES6/README.md b/templates/ReactReduxSpaES6/README.md new file mode 100644 index 00000000..4e494c9a --- /dev/null +++ b/templates/ReactReduxSpaES6/README.md @@ -0,0 +1,40 @@ +# Welcome to ASP.NET 5 + +We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. + +You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) + +## This application consists of: + +* Sample pages using ASP.NET MVC 6 +* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side libraries +* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) + +## How to + +* [Add a Controller and View](http://go.microsoft.com/fwlink/?LinkID=398600) +* [Add an appsetting in config and access it in app.](http://go.microsoft.com/fwlink/?LinkID=699562) +* [Manage User Secrets using Secret Manager.](http://go.microsoft.com/fwlink/?LinkId=699315) +* [Use logging to log a message.](http://go.microsoft.com/fwlink/?LinkId=699316) +* [Add packages using NuGet.](http://go.microsoft.com/fwlink/?LinkId=699317) +* [Add client packages using Bower.](http://go.microsoft.com/fwlink/?LinkId=699318) +* [Target development, staging or production environment.](http://go.microsoft.com/fwlink/?LinkId=699319) + +## Overview + +* [Conceptual overview of what is ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518008) +* [Fundamentals of ASP.NET 5 such as Startup and middleware.](http://go.microsoft.com/fwlink/?LinkId=699320) +* [Working with Data](http://go.microsoft.com/fwlink/?LinkId=398602) +* [Security](http://go.microsoft.com/fwlink/?LinkId=398603) +* [Client side development](http://go.microsoft.com/fwlink/?LinkID=699321) +* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=699322) +* [Read more on the documentation site](http://go.microsoft.com/fwlink/?LinkID=699323) + +## Run & Deploy + +* [Run your app](http://go.microsoft.com/fwlink/?LinkID=517851) +* [Run your app on .NET Core](http://go.microsoft.com/fwlink/?LinkID=517852) +* [Run commands in your project.json](http://go.microsoft.com/fwlink/?LinkID=517853) +* [Publish to Microsoft Azure Web Apps](http://go.microsoft.com/fwlink/?LinkID=398609) + +We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/templates/ReactReduxSpaES6/ReactReduxSpaES6.xproj b/templates/ReactReduxSpaES6/ReactReduxSpaES6.xproj new file mode 100644 index 00000000..af9d5a0a --- /dev/null +++ b/templates/ReactReduxSpaES6/ReactReduxSpaES6.xproj @@ -0,0 +1,21 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 26bfa8ee-1e46-4870-90a3-9e946c569284 + ReactReduxSpaES6 + .\obj + .\bin\ + v4.6.1 + + + 2.0 + + + + + diff --git a/templates/ReactReduxSpaES6/Startup.cs b/templates/ReactReduxSpaES6/Startup.cs new file mode 100644 index 00000000..f7f2e471 --- /dev/null +++ b/templates/ReactReduxSpaES6/Startup.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json.Serialization; +using System.IO; +using Microsoft.AspNetCore.SpaServices.Webpack; + +namespace ReactReduxSpaES6 +{ + public class Startup + { + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + // Add framework services. + services.AddMvc().AddJsonOptions(options => { + options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + }); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + app.UseDeveloperExceptionPage(); + if (env.IsDevelopment()) + { + app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { + HotModuleReplacement = true, + ReactHotModuleReplacement = true + }); + } + + app.UseStaticFiles(); + loggerFactory.AddConsole(); + app.UseMvc(routes => + { + routes.MapRoute( + name: "default", + template: "{controller=Home}/{action=Index}/{id?}"); + routes.MapSpaFallbackRoute( + name: "spa-fallback", + defaults: new { controller = "Home", action = "Index" }); + }); + } + + public static void Main(string[] args) { + var host = new WebHostBuilder() + .UseContentRoot(Directory.GetCurrentDirectory()) + .UseIISIntegration() + .UseKestrel() + .UseStartup() + .Build(); + + host.Run(); + } + } +} diff --git a/templates/ReactReduxSpaES6/Views/Home/Index.cshtml b/templates/ReactReduxSpaES6/Views/Home/Index.cshtml new file mode 100644 index 00000000..72bc9587 --- /dev/null +++ b/templates/ReactReduxSpaES6/Views/Home/Index.cshtml @@ -0,0 +1,10 @@ +@{ + ViewData["Title"] = "Home Page"; +} + +
Loading...
+ +@section scripts { + +} \ No newline at end of file diff --git a/templates/ReactReduxSpaES6/Views/Shared/Error.cshtml b/templates/ReactReduxSpaES6/Views/Shared/Error.cshtml new file mode 100644 index 00000000..48524426 --- /dev/null +++ b/templates/ReactReduxSpaES6/Views/Shared/Error.cshtml @@ -0,0 +1,6 @@ +@{ + ViewData["Title"] = "Error"; +} + +

Error.

+

An error occurred while processing your request.

diff --git a/templates/ReactReduxSpaES6/Views/Shared/_Layout.cshtml b/templates/ReactReduxSpaES6/Views/Shared/_Layout.cshtml new file mode 100644 index 00000000..556285c9 --- /dev/null +++ b/templates/ReactReduxSpaES6/Views/Shared/_Layout.cshtml @@ -0,0 +1,17 @@ + + + + + + @ViewData["Title"] - WebApplicationBasic + + + + + + @RenderBody() + + + @RenderSection("scripts", required: false) + + diff --git a/templates/ReactReduxSpaES6/Views/_ViewImports.cshtml b/templates/ReactReduxSpaES6/Views/_ViewImports.cshtml new file mode 100644 index 00000000..4fac71f2 --- /dev/null +++ b/templates/ReactReduxSpaES6/Views/_ViewImports.cshtml @@ -0,0 +1,3 @@ +@using ReactReduxSpaES6 +@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" +@addTagHelper "*, Microsoft.AspNetCore.SpaServices" diff --git a/templates/ReactReduxSpaES6/Views/_ViewStart.cshtml b/templates/ReactReduxSpaES6/Views/_ViewStart.cshtml new file mode 100644 index 00000000..a5f10045 --- /dev/null +++ b/templates/ReactReduxSpaES6/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} diff --git a/templates/ReactReduxSpaES6/appsettings.json b/templates/ReactReduxSpaES6/appsettings.json new file mode 100644 index 00000000..fa8ce71a --- /dev/null +++ b/templates/ReactReduxSpaES6/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/templates/ReactReduxSpaES6/jsconfig.json b/templates/ReactReduxSpaES6/jsconfig.json new file mode 100644 index 00000000..efe87af8 --- /dev/null +++ b/templates/ReactReduxSpaES6/jsconfig.json @@ -0,0 +1,16 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=759670 + // for the documentation about the jsconfig.json format + "compilerOptions": { + "target": "es6", + "module": "es6", + "allowSyntheticDefaultImports": true + }, + "exclude": [ + "node_modules", + "bower_components", + "jspm_packages", + "tmp", + "temp" + ] +} diff --git a/templates/ReactReduxSpaES6/package.json b/templates/ReactReduxSpaES6/package.json new file mode 100644 index 00000000..92f87c3a --- /dev/null +++ b/templates/ReactReduxSpaES6/package.json @@ -0,0 +1,34 @@ +{ + "name": "asp.net", + "version": "0.0.0", + "dependencies": { + "aspnet-prerendering": "^1.0.0", + "aspnet-webpack": "^1.0.2", + "babel-core": "^6.5.2", + "domain-task": "^1.0.0", + "react": "^15.0.1", + "react-dom": "^15.0.1", + "react-redux": "^4.4.4", + "react-router": "^2.1.1", + "react-router-redux": "^4.0.2", + "redux": "^3.4.0", + "redux-thunk": "^2.0.1", + "webpack-externals-plugin": "^1.0.0" + }, + "devDependencies": { + "aspnet-webpack-react": "^1.0.1", + "babel-loader": "^6.2.3", + "babel-preset-es2015": "^6.5.0", + "babel-preset-react": "^6.5.0", + "bootstrap": "^3.3.6", + "css-loader": "^0.23.1", + "extendify": "^1.0.0", + "extract-text-webpack-plugin": "^1.0.1", + "file-loader": "^0.8.5", + "jquery": "^2.2.1", + "style-loader": "^0.13.0", + "url-loader": "^0.5.7", + "webpack": "^1.12.14", + "webpack-hot-middleware": "^2.10.0" + } +} diff --git a/templates/ReactReduxSpaES6/project.json b/templates/ReactReduxSpaES6/project.json new file mode 100644 index 00000000..ac703192 --- /dev/null +++ b/templates/ReactReduxSpaES6/project.json @@ -0,0 +1,53 @@ +{ + "version": "1.0.0-*", + "buildOptions": { + "emitEntryPoint": true, + "preserveCompilationContext": true + }, + "runtimeOptions": { + "gcServer": true + }, + + "dependencies": { + "Microsoft.NETCore.App": { + "version": "1.0.0-rc2-*", + "type": "platform" + }, + "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final", + "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final", + "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", + "Microsoft.NETCore.Platforms": "1.0.1-*", + "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final", + "Microsoft.AspNetCore.ReactServices": "1.0.0-*" + }, + "frameworks": { + "netcoreapp1.0": { + "imports": [ + "dotnet5.6", + "dnxcore50", + "portable-net45+win8" + ] + } + }, + "publishOptions": { + "exclude": [ + "node_modules", + "**.xproj", + "**.user", + "**.vspscc" + ] + }, + + "scripts": { + "prepare": [ + "npm install", + "webpack --config webpack.config.vendor.js" + ], + "prepublish": [ "webpack" ], + "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] + } +} diff --git a/templates/ReactReduxSpaES6/webpack.config.dev.js b/templates/ReactReduxSpaES6/webpack.config.dev.js new file mode 100644 index 00000000..88f6a54d --- /dev/null +++ b/templates/ReactReduxSpaES6/webpack.config.dev.js @@ -0,0 +1,3 @@ +module.exports = { + devtool: 'inline-source-map' +}; diff --git a/templates/ReactReduxSpaES6/webpack.config.js b/templates/ReactReduxSpaES6/webpack.config.js new file mode 100644 index 00000000..0cc94052 --- /dev/null +++ b/templates/ReactReduxSpaES6/webpack.config.js @@ -0,0 +1,35 @@ +var path = require('path'); +var webpack = require('webpack'); +var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var merge = require('extendify')({ isDeep: true, arrays: 'concat' }); +var devConfig = require('./webpack.config.dev'); +var prodConfig = require('./webpack.config.prod'); +var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development'; +var extractCSS = new ExtractTextPlugin('site.css'); + +module.exports = merge({ + resolve: { + extensions: [ '', '.js', '.jsx' ] + }, + module: { + loaders: [ + { test: /\.jsx?$/, include: /ClientApp/, loader: 'babel-loader' }, + { test: /\.css/, loader: extractCSS.extract(['css']) } + ] + }, + entry: { + main: ['./ClientApp/boot-client.js'], + }, + output: { + path: path.join(__dirname, 'wwwroot', 'dist'), + filename: '[name].js', + publicPath: '/dist/' + }, + plugins: [ + extractCSS, + new webpack.DllReferencePlugin({ + context: __dirname, + manifest: require('./wwwroot/dist/vendor-manifest.json') + }) + ] +}, isDevelopment ? devConfig : prodConfig); diff --git a/templates/ReactReduxSpaES6/webpack.config.prod.js b/templates/ReactReduxSpaES6/webpack.config.prod.js new file mode 100644 index 00000000..46f9225f --- /dev/null +++ b/templates/ReactReduxSpaES6/webpack.config.prod.js @@ -0,0 +1,9 @@ +var webpack = require('webpack'); + +module.exports = { + plugins: [ + new webpack.optimize.OccurenceOrderPlugin(), + new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }), + new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"production"' }) + ] +}; diff --git a/templates/ReactReduxSpaES6/webpack.config.vendor.js b/templates/ReactReduxSpaES6/webpack.config.vendor.js new file mode 100644 index 00000000..8e04124c --- /dev/null +++ b/templates/ReactReduxSpaES6/webpack.config.vendor.js @@ -0,0 +1,37 @@ +var path = require('path'); +var webpack = require('webpack'); +var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var extractCSS = new ExtractTextPlugin('vendor.css'); +var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development'; + +module.exports = { + resolve: { + extensions: [ '', '.js' ] + }, + module: { + loaders: [ + { test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }, + { test: /\.css/, loader: extractCSS.extract(['css']) } + ] + }, + entry: { + vendor: ['bootstrap', 'bootstrap/dist/css/bootstrap.css', 'react', 'react-dom', 'react-router', 'style-loader', 'jquery'], + }, + output: { + path: path.join(__dirname, 'wwwroot', 'dist'), + filename: '[name].js', + library: '[name]_[hash]', + }, + plugins: [ + extractCSS, + new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable) + new webpack.optimize.OccurenceOrderPlugin(), + new webpack.DllPlugin({ + path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'), + name: '[name]_[hash]' + }) + ].concat(isDevelopment ? [] : [ + new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }), + new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"production"' }) + ]) +}; diff --git a/templates/ReactReduxSpaES6/wwwroot/favicon.ico b/templates/ReactReduxSpaES6/wwwroot/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..a3a799985c43bc7309d701b2cad129023377dc71 GIT binary patch literal 32038 zcmeHwX>eTEbtY7aYbrGrkNjgie?1jXjZ#zP%3n{}GObKv$BxI7Sl;Bwl5E+Qtj&t8 z*p|m4DO#HoJC-FyvNnp8NP<{Na0LMnTtO21(rBP}?EAiNjWgeO?z`{3ZoURUQlV2d zY1Pqv{m|X_oO91|?^z!6@@~od!@OH>&BN;>c@O+yUfy5w>LccTKJJ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