This repository has been archived by the owner on Jun 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 243
next -> redux opinionated #366
Merged
ctrlplusb
merged 113 commits into
ctrlplusb:feature/redux-opinionated
from
sergiokopplin:feature/redux-opinionated
Jun 21, 2017
Merged
Changes from 28 commits
Commits
Show all changes
113 commits
Select commit
Hold shift + click to select a range
e2d449f
Adds modernizr with illustrative example. closes #256
ctrlplusb c379c86
Linting now occurs on config, src and tools. closes #314
ctrlplusb 5665b31
Updates dependencies.
ctrlplusb c22814f
update broken feature/flow link in docs
markyfyi 28769d1
Merge pull request #324 from markshlick/patch-1
codepunkt 97b0468
Merge branch 'master' into next
ctrlplusb 4602df1
Updates dependencies.
ctrlplusb 2438517
Updated CSP to add backwards compatibility to nonce. (#344)
rlindskog c2bec1c
- Renamed environment variables:
ctrlplusb fd693c8
Merge branch 'master' into next
ctrlplusb 0b47de6
fix sw to exclude directory (#305)
diondirza 8f319b3
Merge branch 'master' into next
ctrlplusb ae7249c
Adds Dion Dirza as a contributor 🎉
ctrlplusb 2de7d2e
Fixes analyze.
ctrlplusb 6721603
Docs and cleaning up.
ctrlplusb d79d624
Updates docs and version.
ctrlplusb 8452f77
Removes code-split-component.
ctrlplusb eebd879
Updates deps and fixes config refs.
ctrlplusb dc24183
Huuuuuge refactor of project structure. The 'src/' was always unnece…
ctrlplusb 4593e9d
Fixes offline page.
ctrlplusb d0ba64e
Cleans up and centralises util functions.
ctrlplusb 66260b7
Minor fixes.
ctrlplusb ba2af33
Renames config/get to config/getConfig
ctrlplusb 2180d3f
fixes typo: laoder -> loader (#353)
tyler-dot-earth 22e6958
fixes typo: server -> serve (#354)
tyler-dot-earth db371ec
Huuuuuuuge update. Getting closer to v13.
ctrlplusb e3b99f6
Fixes incorrect import path in Menu.test.js (#360)
datoml e8f027e
Updates Error 404 component so that we can set 404 status on SSR rend…
diondirza f8e7fe5
Updates dependencies.
ctrlplusb dfd9426
Updates contributors and comments.
ctrlplusb 29c8971
Merge branch 'next' of https://github.com/ctrlplusb/react-universally…
ctrlplusb 18ff787
Restructures and fixes tests.
ctrlplusb f09a296
Cleaning up comments and docs.
ctrlplusb 9451cbe
Fixes deprecated fallbackLoader (#365)
3d5f310
Changes default host config to bind to all hosts (0.0.0.0) by default…
birkir 032abed
merge with next
sergiokopplin ccabc32
fix typo flag (#369)
diondirza 4bd221b
removing flow from branch
sergiokopplin f802485
Missing default polyfill.io features
birkir 3aae79f
Updated react-router-dom to beta 7 (#381)
datoml be004b8
Updates node version.
ctrlplusb 28d36e6
Merge branch 'next' of https://github.com/ctrlplusb/react-universally…
ctrlplusb 00479ef
Synchronises the react-router-dom dep into yarn.lock
ctrlplusb 3237343
Updates dependencies.
ctrlplusb 2e79a47
Removes onlyIf and replaces with ifElse helper. fixes #362
ctrlplusb cda183b
Update README.md
ctrlplusb 6e9553a
Update README.md
ctrlplusb deb41e5
Fixes breaking context changes in RR4
birkir 8a774bf
Rollback disableSSR. TODO: EnvVars this
birkir 26daddf
Changes polyfill.io into a features array specification.
ctrlplusb 98d968e
Upgrade react-router-dom@4.0.0 and other deps (#396)
diondirza 38e6495
Syncs yarn.lock with package.json
ctrlplusb e95fe97
Fix Error404 test
birkir 6e329f5
Upgrades to latest react-async-component.
ctrlplusb 179f8d5
Adds 'es6' features to polyfill.io config.
ctrlplusb 8b18f91
Removes aliasing of React libs and instead makes NODE_ENV get set to …
ctrlplusb 35256c7
Updates comments.
ctrlplusb c3d8846
Removes babel-preset-latest.
ctrlplusb c75f781
staticContext on 404 route not required.
ctrlplusb ae3fa8e
Refactors async components structure.
ctrlplusb 57367aa
Adds prettier 💄
ctrlplusb 3bec7c6
Updates nvm
ctrlplusb 0179f3c
Adds prepush hook to run jest.
ctrlplusb 0e77a71
Fixes prettier config to use prettier-eslint. Woops\!
ctrlplusb c15e8b6
Removes unused eslint-flowtype plugin.
ctrlplusb 579a57b
Updates dependencies.
ctrlplusb 5dc5bc1
Updates docs
ctrlplusb fbac4a4
Moves all html page elements to DemoApp component. closes #390
ctrlplusb 7c5338b
Removes 'host' from server start. closes #398
ctrlplusb e977ce2
Changes process.env build flags to be inline with expected string typ…
ctrlplusb 6cb1651
Merge branch 'master' of https://github.com/ctrlplusb/react-universally
ctrlplusb d71b1e4
Preps v13 release
ctrlplusb 9c4c902
Update README.md
ctrlplusb 71f7c4d
Update README.md
ctrlplusb a25a5d3
Updates dependencies.
ctrlplusb a97f6de
Merge branch 'master' of https://github.com/ctrlplusb/react-universally
ctrlplusb 0e6642d
Update breaking changes
ctrlplusb ebee892
Adds birkir to contributors list
ctrlplusb d1f6f5b
Adds @birkir to contributors on about us route.
ctrlplusb f4f3766
Changes over to all-contributors
ctrlplusb db284ea
Orders contributors by name
ctrlplusb dbb8d0e
fix the "collectCoverageFrom" config of jest
ChinW ab73cb3
Merge pull request #418 from ChinW/master
birkir 4cd7850
[merge next] solving conflicts
sergiokopplin c838107
updating asyncPosts
sergiokopplin 09c2d0f
Prepare React 15.5 (#413)
birkir 7ee3d42
Updates deps.
ctrlplusb 94a61ec
Another bug fixes, tweaks (#422)
diondirza ef35285
Add es6 back by default. (#429)
birkir 1f26e01
Windows (#415)
c991cad
dev server host always 0.0.0.0, not host config
kdavh cc28bb0
merge with universally/master
sergiokopplin 6d3bb1f
merge with universally/master - updating snapshots
sergiokopplin 01b2fb1
merge/next - adding async posts
sergiokopplin 9afd8b0
merge/next - updating dependencies + updating async components + remo…
sergiokopplin a6f6ec6
merge/next - updating server side state
sergiokopplin d173af3
merge/next - fixing server async functions
sergiokopplin a73f171
universally/merge - fixing async posts route
sergiokopplin 04b0d23
chore: add redux, react-redux, redux-thunk to vendorDLL
865a972
Merge pull request #1 from strues/feature/redux-opinionated
sergiokopplin 4335ac4
Fix configuration for extracted style hash (#438)
diondirza 19b749c
Fix broken link to Feature Branches docs. (#419)
threehams 550e809
Fix CORS host (#432)
diondirza dbb0d3a
Merge pull request #433 from kdavh/public-dev-server-fix
birkir e589803
Removes reference to deprecated react PropTypes import and replaces w…
912216e
update snapshot
c74fece
Merge pull request #2 from strues/feature/redux-opinionated
sergiokopplin 422f05a
Fix Router v2 Implementation
brianfeister 4bbcec6
Merge pull request #3 from brianfeister/patch-1
sergiokopplin bcdce08
Add color support for stdout (#443)
birkir 20ede0e
Merge remote-tracking branch 'upstream/master' into feature/redux-opi…
sergiokopplin 7d808de
master -> redux: fixing store problem
sergiokopplin cfa8da0
fixing stores
sergiokopplin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
flow-typed/ | ||
tools/flow/ | ||
node_modules/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"minify": true, | ||
"options": [], | ||
"feature-detects": [ | ||
"elem/picture" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v6.9.2 | ||
v6.9.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* eslint-disable global-require */ | ||
|
||
import React from 'react'; | ||
import { render } from 'react-dom'; | ||
import { Provider as ReduxProvider } from 'react-redux'; | ||
import { rehydrateJobs } from 'react-jobs/ssr'; | ||
import BrowserRouter from 'react-router-dom/BrowserRouter'; | ||
import { withAsyncComponents } from 'react-async-component'; | ||
import { configureStore } from '../shared/redux/configureStore'; | ||
|
||
import './polyfills'; | ||
|
||
import DemoApp from '../shared/components/DemoApp'; | ||
|
||
// Get the DOM Element that will host our React application. | ||
const container = document.querySelector('#app'); | ||
|
||
// Create our Redux store. | ||
const store = configureStore( | ||
// Server side rendering would have mounted our state on this global. | ||
window.__APP_STATE__, // eslint-disable-line no-underscore-dangle | ||
); | ||
|
||
/** | ||
* Renders the given React Application component. | ||
*/ | ||
function renderApp(TheApp) { | ||
// Firstly, define our full application component, wrapping the given | ||
// component app with a browser based version of react router. | ||
const app = ( | ||
<ReduxProvider store={store}> | ||
<BrowserRouter> | ||
<TheApp /> | ||
</BrowserRouter> | ||
</ReduxProvider> | ||
); | ||
|
||
// We use the react-async-component in order to support code splitting of | ||
// our bundle output. It's important to use this helper. | ||
// @see https://github.com/ctrlplusb/react-async-component | ||
withAsyncComponents(app).then(({ appWithAsyncComponents }) => | ||
render(appWithAsyncComponents, container), | ||
); | ||
|
||
rehydrateJobs(app).then(({ appWithJobs }) => | ||
render(appWithJobs, container), | ||
); | ||
} | ||
|
||
// Execute the first render of our app. | ||
renderApp(DemoApp); | ||
|
||
// This registers our service worker for asset caching and offline support. | ||
// Keep this as the last item, just in case the code execution failed (thanks | ||
// to react-boilerplate for that tip.) | ||
require('./registerServiceWorker'); | ||
|
||
// The following is needed so that we can support hot reloading our application. | ||
if (process.env.BUILD_FLAG_IS_DEV && module.hot) { | ||
// Accept changes to this file for hot reloading. | ||
module.hot.accept('./index.js'); | ||
// Any changes to our App will cause a hotload re-render. | ||
module.hot.accept( | ||
'../shared/components/DemoApp', | ||
() => renderApp(require('../shared/components/DemoApp').default), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* eslint-disable no-console */ | ||
|
||
import Modernizr from 'modernizr'; | ||
|
||
// This is just an illustrative example. Here you are testing the client's | ||
// support for the "picture" element, and if it isn't supported then you | ||
// load a polyfill. | ||
if (!Modernizr.picture) { | ||
console.log('Client does not support "picture", polyfilling it...'); | ||
// If you want to use the below do a `yarn add picturefill --exact` and then | ||
// uncomment the lines below: | ||
/* | ||
require('picturefill'); | ||
require('picturefill/dist/plugins/mutation/pf.mutation'); | ||
*/ | ||
} else { | ||
console.log('Client has support for "picture".'); | ||
} |
22 changes: 12 additions & 10 deletions
22
src/client/registerServiceWorker.js → client/registerServiceWorker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import serialize from 'serialize-javascript'; | ||
import filterWithRules from '../../shared/utils/objects/filterWithRules'; | ||
import values from '../values'; | ||
|
||
// Filter the config down to the properties that are allowed to be included | ||
// in the HTML response. | ||
const clientConfig = filterWithRules( | ||
// These are the rules used to filter the config. | ||
values.clientConfigFilter, | ||
// The config values to filter. | ||
values, | ||
); | ||
|
||
const serializedClientConfig = serialize(clientConfig); | ||
|
||
/** | ||
* A react component that generates a script tag that binds the allowed | ||
* values to the window so that config values can be read within the | ||
* browser. | ||
* | ||
* They get bound to window.__CLIENT_CONFIG__ | ||
*/ | ||
function ClientConfig({ nonce }) { | ||
return ( | ||
<script | ||
type="text/javascript" | ||
nonce={nonce} | ||
// eslint-disable-next-line react/no-danger | ||
dangerouslySetInnerHTML={{ | ||
__html: `window.__CLIENT_CONFIG__=${serializedClientConfig}`, | ||
}} | ||
/> | ||
); | ||
} | ||
|
||
ClientConfig.propTypes = { | ||
nonce: React.PropTypes.string.isRequired, | ||
}; | ||
|
||
export default ClientConfig; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoudn't configureStore be imported as a default import ?
import configureStore from '../shared/redux/configureStore';