Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRACKING: master → feature/react-intl #1136

Closed
wants to merge 313 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
313 commits
Select commit Hold shift + click to select a range
173f9e1
Merge pull request #776 from langpavel/isomorphic-redirect
langpavel Jul 31, 2016
1dd8893
Merge branch 'feature/redux' into react-intl-merge-redux
langpavel Aug 2, 2016
bbc2f08
Merge pull request #787 from langpavel/react-intl-merge-redux
langpavel Aug 2, 2016
3c0cdd5
Better code in setLocale action
langpavel Aug 4, 2016
ee5d7e4
Merge pull request #792 from langpavel/intl-better-action
langpavel Aug 4, 2016
b16bc90
Exclude `navigate` from <a> in Link component [closes #788]
langpavel Aug 4, 2016
9195ea1
Merge pull request #791 from langpavel/fix-788
langpavel Aug 4, 2016
d24baa8
Merge branch 'feature/redux' into feature/react-intl
langpavel Aug 4, 2016
d75f2fa
Merge branch 'master' into feature/redux
langpavel Aug 4, 2016
79304bd
Merge branch 'feature/redux' into feature/react-intl
langpavel Aug 4, 2016
f6bc091
Merge branch 'master' into feature/redux
langpavel Aug 7, 2016
b72965b
Merge branch 'feature/redux' into feature/react-intl
langpavel Aug 7, 2016
e63fa3f
[feature/react-intl] Convert backslashes in messages files to slashes
langpavel Aug 10, 2016
5746145
Merge pull request #798 from langpavel/react-intl-fix-win-paths
langpavel Aug 10, 2016
9534fd4
Merge branch 'master' into feature/redux
langpavel Sep 2, 2016
01f0914
Fix lint errors
langpavel Sep 2, 2016
1cae602
Merge branch 'feature/redux' into feature/react-intl
langpavel Sep 2, 2016
4a10ea6
Merge branch 'master' into feature/redux
langpavel Sep 4, 2016
04df6cf
Merge branch 'feature/redux' into feature/react-intl
langpavel Sep 4, 2016
14c616c
[feature/react-intl] Sort paths in messages
langpavel Sep 4, 2016
d808316
Merge pull request #836 from langpavel/react-intl-sort-file-names
langpavel Sep 6, 2016
453c5a9
Merge branch 'master' into feature/redux
langpavel Sep 6, 2016
2c9e069
Merge branch 'feature/redux' into feature/react-intl
langpavel Sep 6, 2016
7889588
Merge branch 'master' into feature/redux
langpavel Sep 12, 2016
2fa2f8f
Merge branch 'feature/redux' into feature/react-intl
langpavel Sep 12, 2016
f6b8c59
eslint
langpavel Sep 12, 2016
13e3397
A bare minimum Redux integration
koistya Sep 27, 2016
7d577ed
Merge remote-tracking branch 'koistya/redux' into new-redux
langpavel Oct 3, 2016
b9d6aa7
Merge branch 'feature/redux' into new-redux
langpavel Oct 3, 2016
b211835
Allow load critical but optional polyfills
langpavel Oct 3, 2016
36efa57
Merge branch 'new-redux' into feature/redux
langpavel Oct 3, 2016
9b136da
Merge branch 'client-loader' into new-react-intl
langpavel Oct 3, 2016
76cb841
Merge pull request #894 from langpavel/new-redux
langpavel Oct 3, 2016
a5d62a0
Merge branch 'feature/react-intl' into new-react-intl
langpavel Oct 3, 2016
0903b13
Merge pull request #895 from langpavel/new-react-intl
langpavel Oct 3, 2016
11beb27
[feature/react-intl] Better Language Switcher
langpavel Oct 4, 2016
30e2b32
Merge pull request #897 from langpavel/better-language-switcher
langpavel Oct 4, 2016
2d39a31
Fix: Error page rendering
langpavel Oct 5, 2016
f0dd23e
[feature/redux] Pass context to router
langpavel Oct 5, 2016
f5c9a0e
Merge branch 'feature/redux' into feature/react-intl
langpavel Oct 5, 2016
44f6176
Merge branch 'master' into feature/redux
langpavel Oct 9, 2016
bcf1d6e
Merge branch 'feature/redux' into feature/react-intl
langpavel Oct 9, 2016
d1e2b33
Add empty user reducer and clean import react.children (#899)
keremciu Oct 12, 2016
ba46426
Add empty user reducer and clean import react.children (cherry-picked)
keremciu Oct 12, 2016
600ce7a
Merge branch 'feature/redux' into feature/react-intl
langpavel Oct 12, 2016
2517a86
Add static content intl(locale) support
awesomejerry Oct 13, 2016
deb0e72
Update intl(locale) content support
awesomejerry Oct 14, 2016
222ef57
Update intl(locale) content support
awesomejerry Oct 16, 2016
4c9b1e6
[redux] content - do not throw away old content in store on error
langpavel Oct 16, 2016
1c5210e
Content refactoring
langpavel Oct 17, 2016
c3252aa
Merge branch 'awesomejerry-react-intl/content' into feature/react-intl
langpavel Oct 17, 2016
785b44e
Merge branch 'master' into feature/redux
langpavel Oct 17, 2016
bd48dc3
Merge branch 'feature/redux' into feature/react-intl
langpavel Oct 17, 2016
51aed5f
fixed test for required store props in App Layout
granda Oct 17, 2016
188bafb
fixed eslint errors about semicolon and absolute import priority
granda Oct 17, 2016
3f8a98d
Merge branch 'master' into feature/redux
langpavel Oct 21, 2016
e6c7df7
Merge branch 'feature/redux' into feature/react-intl
langpavel Oct 21, 2016
79feb17
Fix test
langpavel Oct 21, 2016
7f347c4
Merge branch 'master' into feature/redux
langpavel Oct 21, 2016
ad990f3
Merge branch 'feature/redux' into feature/react-intl
langpavel Oct 21, 2016
c4809b1
Merge branch 'fix/redux-test' of https://github.com/granda/react-star…
langpavel Oct 22, 2016
7bd938e
Merge branch 'granda-fix/redux-test' into feature/redux
langpavel Oct 22, 2016
8a1ca98
Merge branch 'feature/redux' into feature/react-intl
langpavel Oct 22, 2016
3250501
Better test code
langpavel Oct 22, 2016
9a93f56
Merge branch 'feature/redux' into feature/react-intl
langpavel Oct 22, 2016
eb1011a
Merge branch 'master' into feature/redux
langpavel Oct 25, 2016
d65beba
Pin redux packages versions
langpavel Oct 25, 2016
549dda0
Merge branch 'feature/redux' into feature/react-intl
langpavel Oct 25, 2016
f15b19a
Merge branch 'master' into feature/redux
langpavel Nov 2, 2016
f1304cf
fix lint
langpavel Nov 2, 2016
c8a2003
Merge branch 'feature/redux' into feature/react-intl
langpavel Nov 2, 2016
b7bd543
Merge branch 'master' into feature/redux
langpavel Nov 10, 2016
91546e5
Merge branch 'master' into feature/redux
langpavel Nov 11, 2016
beb4290
Merge branch 'feature/redux' into feature/react-intl
langpavel Nov 11, 2016
d4c1693
Merge branch 'master' into feature/redux
langpavel Dec 1, 2016
ebed51b
Merge branch 'feature/redux' into feature/react-intl
langpavel Dec 1, 2016
2589743
Merge master to feature-redux
langpavel Dec 10, 2016
23fa725
Merge feature/redux into feature/react-intl
langpavel Dec 10, 2016
835b7ca
Merge branch 'master' into feature/redux
langpavel Dec 15, 2016
8e4bd64
Merge branch 'feature/redux' into feature/react-intl
langpavel Dec 15, 2016
94b00cf
Removed gaze dependency from extractMessages
pdeszynski Dec 16, 2016
93a0bd6
Merge pull request #1034 from piteer1/feature/react-intl
langpavel Dec 16, 2016
111fbdd
Merge pull request #1040 from kriasoft/master
langpavel Dec 20, 2016
7f1d692
Merge branch 'feature/redux'
langpavel Dec 20, 2016
a2db319
Add css class for content route loading
langpavel Dec 20, 2016
8b14ce9
Merge branch 'master' into feature/redux
awesomejerry Jan 11, 2017
e44f751
Merge branch 'feature/redux' into feature/react-intl
awesomejerry Jan 11, 2017
f5f829e
Merge pull request #1078 from awesomejerry/feature/react-intl
langpavel Jan 12, 2017
be51d42
Merge pull request #1077 from awesomejerry/feature/redux
langpavel Jan 12, 2017
0aa8848
fixed news feed query (#1045)
smshuja Jan 29, 2017
caead88
updated date field name.
smshuja Jan 29, 2017
448bc52
Merge pull request #1103 from smshuja/news-feed-query-fix
langpavel Feb 1, 2017
0269d46
Merge branch 'master' into feature/redux
langpavel Feb 1, 2017
667a387
Merge branch 'feature/redux' into feature/react-intl
langpavel Feb 1, 2017
43671da
No await on return
langpavel Feb 1, 2017
7a6f74e
Merge branch 'feature/redux' into feature/react-intl
langpavel Feb 1, 2017
2db64df
Merge branch 'master' into feature/redux
langpavel Feb 11, 2017
f61b39b
Merge branch 'feature/redux' into feature/react-intl
langpavel Feb 11, 2017
4455ecb
Merge branch 'master' into feature/redux
langpavel Feb 13, 2017
930f53d
Merge branch 'feature/redux' into feature/react-intl
langpavel Feb 13, 2017
1a7599a
Merge branch 'master' into feature/redux
langpavel Feb 14, 2017
dba0dd3
Merge branch 'feature/redux' into feature/react-intl
langpavel Feb 14, 2017
6fcb193
Merge branch 'master' into feature/redux
langpavel Feb 16, 2017
9514ff8
Merge branch 'feature/redux' into feature/react-intl
langpavel Feb 16, 2017
011337e
packages: apollo-client, react-apollo and graphql-tag dependencies
langpavel Feb 24, 2017
22dc950
Initial Apollo integration
langpavel Feb 24, 2017
03791e9
News now using `graphql` from react-apollo
langpavel Feb 24, 2017
c3782d8
Merge branch 'feature/apollo' into feature/react-intl
langpavel Feb 24, 2017
b4df966
seamless transition from fetch to apollo in redux helpers
langpavel Feb 24, 2017
558eb4e
Use prepared query for intl action
langpavel Feb 24, 2017
623f3a4
test: ignore .graphql and .gql imports
langpavel Feb 24, 2017
e432077
Merge branch 'master' into feature/redux
langpavel Feb 27, 2017
48231cf
Merge branch 'feature/redux' into feature/apollo
langpavel Feb 27, 2017
0895c21
seamless transition from fetch to apollo in redux helpers
langpavel Feb 24, 2017
d6ecb1c
Avoid using gql template tag at runtime, write handy warning if so
langpavel Feb 27, 2017
cc8c5f9
Merge branch 'feature/apollo' into feature/react-intl
langpavel Feb 27, 2017
e968732
Skip cache for intl action
langpavel Feb 28, 2017
bb36158
Merge branch 'master' into feature/redux
langpavel Mar 12, 2017
cf42f90
Merge branch 'feature/redux' into feature/apollo
langpavel Mar 12, 2017
e48fec9
Merge branch 'feature/apollo' into feature/react-intl
langpavel Mar 13, 2017
8c3189e
Use react-deep-force-update when locale changes
langpavel Mar 13, 2017
1a7e45b
Include credentials with Apollo request
langpavel Mar 15, 2017
85b3367
Include credentials with Apollo request
langpavel Mar 15, 2017
08be6ff
Fix issue with mutations, deprecate `graphqlRequest`
langpavel Mar 16, 2017
734919a
Upgrade Apollo
langpavel Mar 16, 2017
cdb874f
Merge branch 'master' into feature/redux
langpavel Mar 16, 2017
37f1b80
Merge branch 'feature/redux' into feature/apollo
langpavel Mar 16, 2017
42a8ff0
Merge branch 'feature/apollo' into feature/react-intl
langpavel Mar 16, 2017
fd46817
Custom Redux logger on server
langpavel Mar 25, 2017
963ae2a
Merge branch 'feature/redux' into feature/apollo
langpavel Mar 25, 2017
77acb76
Merge branch 'feature/apollo' into feature/react-intl
langpavel Mar 25, 2017
a38aa6b
Do not log intl messages on server
langpavel Mar 25, 2017
8c856ef
Ase Apollo network layer directly to fetch messages, skipping cache
langpavel Mar 25, 2017
86132ac
change name and unify format of package.json for createApolloClient
zirho Mar 29, 2017
04fd6b0
Upgrade redux-logger, update packages
langpavel Mar 31, 2017
5a19805
Merge branch 'feature/redux' into feature/apollo
langpavel Mar 31, 2017
f48ceff
Upgrade packages
langpavel Mar 31, 2017
707dc0b
Merge branch 'feature/apollo' into feature/react-intl
langpavel Mar 31, 2017
0a2782a
fix(store/configureStore): fix hot reloader
Stupidism Apr 5, 2017
9aa7619
Merge branch 'master' into feature/redux
langpavel Apr 10, 2017
9770f63
Merge branch 'feature/redux' into feature/apollo
langpavel Apr 10, 2017
588b42a
Merge branch 'feature/apollo' into feature/react-intl
langpavel Apr 10, 2017
2156f8d
Re-route application when locale changed.
langpavel Apr 10, 2017
b62314c
Don't listen to intellisense, you will make mistake like this..
langpavel Apr 11, 2017
db6abb5
Merge branch 'feature/apollo' into feature/react-intl
langpavel Apr 11, 2017
8185c13
Merge branch 'master' into feature/redux
langpavel Apr 16, 2017
705a39e
Merge branch 'feature/redux' into feature/apollo
langpavel Apr 16, 2017
1faa972
Merge branch 'feature/apollo' into feature/react-intl
langpavel Apr 16, 2017
f448fbe
Merge branch 'master' into feature/redux
langpavel Apr 29, 2017
fe90e5e
Merge branch 'master' into feature/redux
langpavel May 23, 2017
54efedc
Merge branch 'feature/redux' into feature/apollo
langpavel May 23, 2017
e393804
Merge branch 'feature/apollo' into feature/react-intl
langpavel May 24, 2017
8182af7
Remove no longer used Provide component
langpavel May 25, 2017
cc4bd69
Merge branch 'master' into feature/redux
langpavel May 25, 2017
ba4894a
Merge branch 'feature/redux' into feature/apollo
langpavel May 25, 2017
a2de349
Merge branch 'feature/apollo' into feature/react-intl
langpavel May 25, 2017
0b88fdf
Merge branch 'master' into feature/redux
langpavel Jun 28, 2017
1f4f7ef
Merge branch 'feature/redux' into feature/apollo
langpavel Jun 30, 2017
59ae7af
Merge branch 'master' into feature/redux
langpavel Jun 30, 2017
da4f71f
Merge branch 'feature/redux' into feature/apollo
langpavel Jun 30, 2017
8e93b63
Merge branch 'feature/apollo' into feature/react-intl
langpavel Jul 1, 2017
3f5eadd
Merge branch 'master' into feature/redux
langpavel Jul 1, 2017
101e158
Merge branch 'feature/redux' into feature/apollo
langpavel Jul 1, 2017
36dce68
Merge branch 'feature/apollo' into feature/react-intl
langpavel Jul 1, 2017
eace0e3
Update yarn.lock
langpavel Jul 1, 2017
6fa569e
At first, go back to idea of babel-plugin-reac-intl
langpavel Jul 2, 2017
645b7a4
Mark code which needs attention if you changing locale
langpavel Jul 2, 2017
8cb5ca5
Allow use of intl in router
langpavel Jul 2, 2017
1e21de3
Example: how to use intl in router
langpavel Jul 2, 2017
d4a9583
Re-enable build of messages
langpavel Jul 2, 2017
65b1142
Merge branch 'master' into feature/redux
langpavel Jul 10, 2017
58a9aa5
Merge branch 'feature/redux' into feature/apollo
langpavel Jul 10, 2017
1affa66
yarn: fix react-dom issue caused by reac-apollo
langpavel Jul 10, 2017
136a3b7
Merge branch 'feature/apollo' into feature/react-intl
langpavel Jul 10, 2017
988bbd5
tests: jest-transform-graphql
langpavel Jul 10, 2017
39d30b2
tests: jest-transform-graphql
langpavel Jul 10, 2017
28b41d4
Merge branch 'feature/apollo' into feature/react-intl
langpavel Jul 10, 2017
38b9f67
test: update snapshot
langpavel Jul 10, 2017
eb73d72
Merge branch 'master' into feature/redux
langpavel Jul 14, 2017
2bcb7e1
Merge branch 'feature/redux' into feature/apollo
langpavel Jul 14, 2017
f86d69b
Merge branch 'feature/apollo' into feature/react-intl
langpavel Jul 14, 2017
2fe5f87
Merge branch 'master' into feature/redux
langpavel Aug 11, 2017
b429d3b
Merge branch 'feature/redux' into feature/apollo
langpavel Aug 11, 2017
e9335da
Merge branch 'feature/apollo' into feature/react-intl
langpavel Aug 11, 2017
e065640
Merge branch 'master' into feature/redux
langpavel Aug 22, 2017
87271da
Merge branch 'master' into feature/redux
langpavel Aug 22, 2017
4f7a1f5
WIP: Merge branch 'feature/redux' into feature/apollo
langpavel Aug 22, 2017
61bdcae
FIX: react-apollo now needs wider context, so delegate responsibility…
langpavel Aug 22, 2017
2d3c105
Merge branch 'feature/apollo' into feature/react-intl
langpavel Aug 22, 2017
73e7705
Fix Layout test
Oct 6, 2017
f5c85f1
Use news.graphql content as fetch body query in home route
Oct 6, 2017
1a66055
Convert function into ES6 class and add default stylesheet
colorfield Dec 11, 2017
a65988a
[feature/Apollo] Upgrade to Apollo Client 2.0 (#1492)
tim-soft Jan 5, 2018
e18f7d9
Merge branch 'master' into feature/redux
langpavel Jan 5, 2018
4ce25fc
Merge branch 'feature/redux' into feature/apollo
langpavel Jan 5, 2018
bcb056b
Downgrade graphql (0.12.3 -> 0.11.7)
langpavel Jan 5, 2018
73e1b1c
Merge branch 'feature/apollo' into feature/react-intl
langpavel Jan 6, 2018
eeac362
fix Apollo state (re)hydration
langpavel Jan 6, 2018
abe3ed2
Merge branch 'feature/apollo' into feature/react-intl
langpavel Jan 6, 2018
37ea09b
workaround Apollo cache for intl messages
langpavel Jan 6, 2018
2f63ce9
Better way to fetch intl messages with Apollo
langpavel Jan 6, 2018
4d351f4
typos
langpavel Jan 7, 2018
26173d3
Minimize differences between master and feature/redux
langpavel Jan 7, 2018
8effc49
Merge branch 'feature/redux' into feature/apollo
langpavel Jan 7, 2018
0aa0a82
Merge branch 'feature/apollo' into feature/react-intl
langpavel Jan 7, 2018
c956344
:sparkles: Log Apollo ops in development (#1496)
tim-soft Jan 8, 2018
fc81b65
Merge branch 'feature/react-intl' of https://github.com/r-daneeloliva…
langpavel Jan 8, 2018
9cb1b30
Merge branch 'r-daneelolivaw/feature/react-intl' into feature/react-intl
langpavel Jan 8, 2018
712b80a
Merge branch 'feature-apollo-single-source-of-graphql-query' of git:/…
langpavel Jan 8, 2018
ea5111e
Use apollo client in router instead of fetch
langpavel Jan 8, 2018
c8f7165
Merge branch 'KrzysztofKarol-feature-apollo-single-source-of-graphql-…
langpavel Jan 8, 2018
703472f
Merge branch 'master' into feature/redux
langpavel Jan 8, 2018
8764b24
Merge branch 'feature/redux' into feature/apollo
langpavel Jan 8, 2018
5c8bb28
Merge branch 'feature/apollo' into feature/react-intl
langpavel Jan 8, 2018
9382aa2
:recycle: Implement GraphQL-Tools based Schema (#1498)
tim-soft Jan 13, 2018
a857017
Merge branch 'master' into feature/redux
langpavel Jan 14, 2018
d7d4187
Merge branch 'feature/redux' into feature/apollo
langpavel Jan 14, 2018
e1d5f69
Partial merge of 'feature/apollo' into feature/react-intl
langpavel Jan 14, 2018
c893015
Add intl query by new graphql-tools way
langpavel Jan 14, 2018
7373ec4
Fix errors in graphql-tools implementation (#1503)
langpavel Jan 14, 2018
b672957
Merge branch 'feature/apollo' into feature/react-intl
langpavel Jan 14, 2018
ccd18a3
Merge branch 'master' into feature/redux
langpavel Jan 23, 2018
4fb56bc
Merge branch 'feature/redux' into feature/apollo
langpavel Jan 23, 2018
ca3e9ac
Merge branch 'feature/apollo' into feature/react-intl
langpavel Jan 23, 2018
74c989c
Change a reference url for redux store fix (#1202)
zirho Jan 31, 2018
ebdd710
Merge branch 'master' into feature/redux
langpavel Jan 31, 2018
80cac88
Merge branch 'feature/redux' into feature/apollo
langpavel Jan 31, 2018
39a8ce6
Merge branch 'feature/apollo' into feature/react-intl
langpavel Jan 31, 2018
6910350
fix: Hot module reloading
langpavel Feb 6, 2018
d61a501
Merge branch 'master' into feature/redux
langpavel Feb 8, 2018
c51416c
chore(redux): use redux-devtools-extension package
langpavel Feb 8, 2018
cd6d4bb
fix babel core usage
dreisel Feb 23, 2018
efea26d
Merge branch 'master' into feature/redux
langpavel Mar 24, 2018
10fa71b
chore: yarn upgrade
langpavel Mar 24, 2018
d8df5bd
chore: pick docs from master branch - decrease diversity
langpavel Mar 24, 2018
9309fc7
Merge branch 'master' into feature/redux
langpavel Mar 24, 2018
5787cec
docs: Redux Actions
langpavel Mar 24, 2018
3042323
Merge branch 'feature/redux' into feature/apollo
langpavel Mar 24, 2018
d4c8bf6
chore: yarn upgrade --latest
langpavel Mar 24, 2018
6c851d3
fix(redux): createRootReducer → rootReducer
langpavel Mar 24, 2018
699f84d
Merge branch 'feature/apollo' into feature/react-intl
langpavel Mar 24, 2018
71b4412
chore: update messages
langpavel Mar 24, 2018
6dedc85
test: fix rootReducer test
langpavel Mar 24, 2018
020e25b
Merge branch 'master' into feature/redux
langpavel Mar 25, 2018
d5cf707
Merge branch 'feature/redux' into feature/apollo
langpavel Mar 25, 2018
890839c
Merge branch 'feature/apollo' into feature/react-intl
langpavel Mar 25, 2018
f54d6f4
chore: yarn upgrade
langpavel Mar 25, 2018
4aff38b
Merge 'patch-1' of git://github.com/reisel/react-starter-kit into fea…
langpavel Mar 25, 2018
8f0fdc6
chore,style: do not process json via prettier
langpavel Mar 25, 2018
fc3bc29
bug(polyfill) - fix polyfill loading. (#1583)
dreisel Jun 19, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ module.exports = {
},
],

// Allow only special identifiers
// https://eslint.org/docs/rules/no-underscore-dangle
'no-underscore-dangle': [
'error',
{
allow: ['__typename'],
},
],

// Prefer destructuring from arrays and objects
// http://eslint.org/docs/rules/prefer-destructuring
'prefer-destructuring': [
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.formatOnPaste": true,
"editor.minimap.enabled": true,
"editor.snippetSuggestions": "top"
}
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ module.exports = {

transform: {
'\\.(js|jsx)$': '<rootDir>/node_modules/babel-jest',
'\\.(gql|graphql)$': '<rootDir>/node_modules/jest-transform-graphql',
'^(?!.*\\.(js|jsx|json|css|less|styl|scss|sass|sss)$)':
'<rootDir>/tools/lib/fileTransformer.js',
},
Expand Down
28 changes: 27 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
"browserslist": [">1%", "last 4 versions", "Firefox ESR", "not ie < 9"],
"dependencies": {
"@babel/polyfill": "^7.0.0-beta.42",
"apollo-cache-inmemory": "^1.1.4",
"apollo-client": "^2.0.4",
"apollo-link": "^1.0.7",
"apollo-link-error": "^1.0.3",
"apollo-link-http": "^1.3.2",
"apollo-link-logger": "^1.1.0",
"apollo-link-schema": "^1.0.1",
"bluebird": "^3.5.1",
"body-parser": "^1.18.2",
"classnames": "^2.2.5",
Expand All @@ -17,10 +24,16 @@
"express": "^4.16.3",
"express-graphql": "^0.6.12",
"express-jwt": "^5.3.1",
"express-request-language": "^1.1.12",
"graphql": "^0.13.2",
"graphql-tag": "^2.6.1",
"graphql-tools": "^2.16.0",
"history": "^4.7.2",
"intl": "^1.2.5",
"intl-locales-supported": "^1.0.0",
"isomorphic-style-loader": "^4.0.0",
"jsonwebtoken": "^8.2.0",
"lodash": "^4.17.5",
"node-fetch": "^2.1.1",
"normalize.css": "^8.0.0",
"passport": "^0.4.0",
Expand All @@ -29,7 +42,14 @@
"prop-types": "^15.6.1",
"query-string": "^6.0.0",
"react": "^16.2.0",
"react-apollo": "^2.0.4",
"react-dom": "^16.2.0",
"react-intl": "^2.4.0",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-devtools-extension": "^2.13.2",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0",
"sequelize": "^4.37.3",
"serialize-javascript": "^1.4.0",
"source-map-support": "^0.5.4",
Expand All @@ -51,6 +71,7 @@
"babel-eslint": "^8.2.2",
"babel-jest": "^22.4.3",
"babel-loader": "^8.0.0-beta.2",
"babel-plugin-react-intl": "^2.3.1",
"babel-plugin-transform-react-remove-prop-types": "^0.4.13",
"browser-sync": "^2.23.6",
"chokidar": "^2.0.2",
Expand All @@ -74,6 +95,9 @@
"husky": "^0.14.3",
"identity-obj-proxy": "^3.0.0",
"jest": "^22.4.3",
"jest-codemods": "^0.13.9",
"jest-transform-graphql": "^2.1.0",
"jscodeshift": "^0.5.0",
"lint-staged": "^7.0.0",
"markdown-it": "^8.4.1",
"mkdirp": "^0.5.1",
Expand Down Expand Up @@ -102,6 +126,7 @@
"react-dev-utils": "^5.0.0",
"react-error-overlay": "^4.0.0",
"react-test-renderer": "^16.2.0",
"redux-mock-store": "^1.4.0",
"rimraf": "^2.6.2",
"stylelint": "^9.1.3",
"stylelint-config-standard": "^18.2.0",
Expand All @@ -117,7 +142,7 @@
},
"lint-staged": {
"*.{js,jsx}": ["eslint --no-ignore --fix", "git add --force"],
"*.{json,md,graphql}": ["prettier --write", "git add --force"],
"*.{md,graphql}": ["prettier --write", "git add --force"],
"*.{css,less,styl,scss,sass,sss}": ["stylelint --fix", "git add --force"]
},
"scripts": {
Expand All @@ -136,6 +161,7 @@
"coverage": "yarn run test-cover && opn coverage/lcov-report/index.html",
"clean": "babel-node tools/run clean",
"copy": "babel-node tools/run copy",
"messages": "babel-node tools/run messages",
"bundle": "babel-node tools/run bundle",
"build": "babel-node tools/run build",
"build-stats": "yarn run build --release --analyse",
Expand Down
67 changes: 67 additions & 0 deletions src/actions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Redux Actions and Action Creators

### Action Types

Should go to `src/constants/…`

```js
export const ADD_TODO = 'ADD_TODO';
```

### Action Creators

Should go to `src/actions/…`

```js
export function addTodo({ text }) {
return {
type: ADD_TODO,
payload: {
text,
// ...
},
};
}
```

## Flux Standard Action

An action _MUST_

* be a plain JavaScript object.
* have a `type` property. (_string_)

An action _MAY_

* have an `error` property. (`true` → `payload` _should be instance of `Error`_)
If `error` has any other value besides `true`, the action _MUST NOT_ be interpreted as an error.
* have a `payload` property. (_any, object is reccomended_)
* have a `meta` property. (_any_)
It is intended for any extra information that is not part of the payload

An action _MUST NOT_ include properties other than `type`, `payload`, `error`, and `meta`.

[**Read more about FSA**](https://github.com/redux-utilities/flux-standard-action#flux-standard-action)

### Examples

```js
// Action example:
{
type: ADD_TODO,
payload: {
text: 'Contribute to React Starter Kit.',
},
}
// Error action example:
{
type: 'ADD_TODO',
error: true,
payload: new Error('Database Error'),
}
```

# Other Resources

* [Actions on redux.js.org](https://redux.js.org/basics/actions)
* [Flux Standard Action](https://github.com/redux-utilities/flux-standard-action#flux-standard-action)
6 changes: 6 additions & 0 deletions src/actions/intl.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
query intl ($locale:String!) {
intl (locale:$locale) {
id
message
}
}
79 changes: 79 additions & 0 deletions src/actions/intl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/* eslint-disable import/prefer-default-export */

import { IntlProvider } from 'react-intl';

import {
SET_LOCALE_START,
SET_LOCALE_SUCCESS,
SET_LOCALE_ERROR,
} from '../constants';

import queryIntl from './intl.graphql';

function getIntlFromState(state) {
const intl = (state && state.intl) || {};
const { initialNow, locale, messages } = intl;
const localeMessages = (messages && messages[locale]) || {};
const provider = new IntlProvider({
initialNow,
locale,
messages: localeMessages,
defaultLocale: 'en-US',
});
return provider.getChildContext().intl;
}

export function getIntl() {
return (dispatch, getState) => getIntlFromState(getState());
}

export function setLocale({ locale }) {
return async (dispatch, getState, { client, history }) => {
dispatch({
type: SET_LOCALE_START,
payload: {
locale,
},
});

try {
// WARNING !!
// do not use client.networkInterface except you want skip Apollo store
// use client.query if you want benefit from Apollo caching mechanisms
const { data } = await client.query({
query: queryIntl,
variables: { locale },
});
const messages = data.intl.reduce((msgs, msg) => {
msgs[msg.id] = msg.message; // eslint-disable-line no-param-reassign
return msgs;
}, {});
dispatch({
type: SET_LOCALE_SUCCESS,
payload: {
locale,
messages,
},
});

// remember locale for every new request
if (process.env.BROWSER) {
const maxAge = 3650 * 24 * 3600; // 10 years in seconds
document.cookie = `lang=${locale};path=/;max-age=${maxAge}`;
history.push(`?lang=${locale}`);
}

// return bound intl instance at the end
return getIntlFromState(getState());
} catch (error) {
dispatch({
type: SET_LOCALE_ERROR,
payload: {
locale,
error,
},
});
return null;
}
};
}
13 changes: 13 additions & 0 deletions src/actions/runtime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* eslint-disable import/prefer-default-export */

import { SET_RUNTIME_VARIABLE } from '../constants';

export function setRuntimeVariable({ name, value }) {
return {
type: SET_RUNTIME_VARIABLE,
payload: {
name,
value,
},
};
}
62 changes: 54 additions & 8 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,40 @@ import ReactDOM from 'react-dom';
import deepForceUpdate from 'react-deep-force-update';
import queryString from 'query-string';
import { createPath } from 'history/PathUtils';
import { addLocaleData } from 'react-intl';
// This is so bad: requiring all locale if they are not needed?
/* @intl-code-template import ${lang} from 'react-intl/locale-data/${lang}'; */
import en from 'react-intl/locale-data/en';
import cs from 'react-intl/locale-data/cs';
/* @intl-code-template-end */
import App from './components/App';
import createFetch from './createFetch';
import history from './history';
import configureStore from './store/configureStore';
import { updateMeta } from './DOMUtils';
import history from './history';
import createApolloClient from './core/createApolloClient';
import router from './router';
import { getIntl } from './actions/intl';

/* @intl-code-template addLocaleData(${lang}); */
addLocaleData(en);
addLocaleData(cs);
/* @intl-code-template-end */

// Universal HTTP client
const fetch = createFetch(window.fetch, {
baseUrl: window.App.apiUrl,
});

const apolloClient = createApolloClient();

// Initialize a new Redux store
// http://redux.js.org/docs/basics/UsageWithReact.html
const store = configureStore(window.App.state, {
apolloClient,
fetch,
history,
});

// Global (context) variables that can be easily accessed from any React component
// https://facebook.github.io/react/docs/context.html
Expand All @@ -31,10 +60,14 @@ const context = {
removeCss.forEach(f => f());
};
},
// For react-apollo
client: apolloClient,
store,
storeSubscription: null,
// Universal HTTP client
fetch: createFetch(fetch, {
baseUrl: window.App.apiUrl,
}),
fetch,
// intl instance as it can be get with injectIntl
intl: store.dispatch(getIntl()),
};

const container = document.getElementById('app');
Expand All @@ -56,10 +89,13 @@ async function onLocationChange(location, action) {
}
currentLocation = location;

context.intl = store.dispatch(getIntl());

const isInitialRender = !action;
try {
context.pathname = location.pathname;
context.query = queryString.parse(location.search);
context.locale = store.getState().intl.locale;

// Traverses the list of routes in the order they are defined until
// it finds the first route that matches provided URL path string
Expand Down Expand Up @@ -146,10 +182,20 @@ async function onLocationChange(location, action) {
}
}

// Handle client-side navigation by using HTML5 History API
// For more information visit https://github.com/mjackson/history#readme
history.listen(onLocationChange);
onLocationChange(currentLocation);
let isHistoryObserved = false;
export default function main() {
// Handle client-side navigation by using HTML5 History API
// For more information visit https://github.com/mjackson/history#readme
currentLocation = history.location;
if (!isHistoryObserved) {
isHistoryObserved = true;
history.listen(onLocationChange);
}
onLocationChange(currentLocation);
}

// globally accesible entry point
window.RSK_ENTRY = main;

// Enable Hot Module Replacement (HMR)
if (module.hot) {
Expand Down
Loading