Skip to content

Commit

Permalink
Fix flow for release verification (#176)
Browse files Browse the repository at this point in the history
* Fix flow for release verification

* Upgrade fusion-plugin-rpc-redux-react
  • Loading branch information
KevinGrandon authored Jan 3, 2019
1 parent bde6030 commit ebab530
Show file tree
Hide file tree
Showing 6 changed files with 850 additions and 590 deletions.
76 changes: 38 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,58 +23,58 @@
},
"dependencies": {
"fast-async": "^6.3.8",
"fusion-cli": "1.13.0",
"fusion-core": "^1.7.0",
"fusion-plugin-browser-performance-emitter": "^1.6.1",
"fusion-plugin-csrf-protection-react": "^1.0.3",
"fusion-plugin-error-handling": "^1.0.6",
"fusion-plugin-font-loader-react": "^1.0.7",
"fusion-plugin-i18n-react": "^1.1.0",
"fusion-plugin-jwt": "^1.0.6",
"fusion-plugin-node-performance-emitter": "^1.0.6",
"fusion-plugin-react-redux": "^1.0.9",
"fusion-plugin-react-router": "^1.4.0",
"fusion-plugin-redux-action-emitter-enhancer": "^2.0.0",
"fusion-plugin-rpc-redux-react": "^2.0.1",
"fusion-plugin-styletron-react": "^2.5.3",
"fusion-plugin-universal-events": "^1.2.0",
"fusion-plugin-universal-events-react": "^1.0.2",
"fusion-plugin-universal-logger": "^1.0.4",
"fusion-react": "^1.3.0",
"fusion-tokens": "^1.1.0",
"fusion-cli": "1.13.1",
"fusion-core": "^1.10.1",
"fusion-plugin-browser-performance-emitter": "^1.8.0",
"fusion-plugin-csrf-protection": "^2.0.0",
"fusion-plugin-error-handling": "^1.0.7",
"fusion-plugin-font-loader-react": "^1.1.1",
"fusion-plugin-i18n-react": "^1.2.2-0",
"fusion-plugin-jwt": "^1.0.7",
"fusion-plugin-node-performance-emitter": "^1.0.8",
"fusion-plugin-react-redux": "^1.1.0",
"fusion-plugin-react-router": "^1.4.2",
"fusion-plugin-redux-action-emitter-enhancer": "^2.0.1",
"fusion-plugin-rpc-redux-react": "2.0.3-0",
"fusion-plugin-styletron-react": "^2.5.4",
"fusion-plugin-universal-events": "^1.3.0",
"fusion-plugin-universal-events-react": "^1.0.4",
"fusion-plugin-universal-logger": "^1.0.5",
"fusion-react": "^1.3.5",
"fusion-tokens": "^1.1.1",
"jest-environment-jsdom": "^23.4.0",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-redux": "^5.0.7",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-redux": "^6.0.0",
"recompose": "^0.30.0",
"redux": "^4.0.0",
"styletron-react": "^4.3.5",
"redux": "^4.0.1",
"styletron-react": "^4.4.4",
"unfetch": "^4.0.1"
},
"devDependencies": {
"@babel/core": "^7.1.2",
"@babel/preset-env": "^7.1.0",
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.2.3",
"@babel/preset-flow": "^7.0.0",
"@babel/register": "^7.0.0",
"babel-eslint": "^10.0.1",
"enzyme": "^3.7.0",
"eslint": "^5.6.1",
"enzyme": "^3.8.0",
"eslint": "^5.11.1",
"eslint-config-fusion": "^4.0.0",
"eslint-plugin-cup": "^2.0.0",
"eslint-plugin-flowtype": "^3.0.0",
"eslint-plugin-flowtype": "^3.2.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^21.24.1",
"eslint-plugin-prettier": "^3.0.0",
"eslint-plugin-react": "^7.11.1",
"flow-bin": "^0.83.0",
"eslint-plugin-jest": "^22.1.2",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.1",
"flow-bin": "^0.89.0",
"nightmare": "^3.0.1",
"nightwatch": "^0.9.21",
"node-fetch": "^2.2.0",
"prettier": "1.14.3",
"react-test-renderer": "^16.5.2",
"nightwatch": "^1.0.18",
"node-fetch": "^2.3.0",
"prettier": "1.15.3",
"react-test-renderer": "^16.7.0",
"request": "^2.88.0",
"selenium-download": "^2.0.13",
"tape": "^4.9.1"
"tape": "^4.9.2"
},
"resolutions": {
"fusion-plugin-i18n": "1.1.5-0"
Expand Down
5 changes: 3 additions & 2 deletions src/components/csrf-protection-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
*/

import React from 'react';
import {withFetch} from 'fusion-plugin-csrf-protection-react';
import {withServices} from 'fusion-react';
import {FetchToken} from 'fusion-tokens';

type Props = {
fetch: (a: string, ops: {}) => Promise<*>,
Expand Down Expand Up @@ -44,4 +45,4 @@ class FetchingComponent extends React.Component<Props, State> {
}
}

export default withFetch(FetchingComponent);
export default withServices({fetch: FetchToken})(FetchingComponent);
8 changes: 3 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import JWTSession, {
SessionCookieNameToken,
SessionSecretToken,
} from 'fusion-plugin-jwt';
import CsrfProtection, {
FetchForCsrfToken,
} from 'fusion-plugin-csrf-protection-react';
import CsrfProtection from 'fusion-plugin-csrf-protection';
import Router from 'fusion-plugin-react-router';
import I18n, {I18nToken, I18nLoaderToken} from 'fusion-plugin-i18n-react';
import UniversalEvents, {
Expand Down Expand Up @@ -72,10 +70,10 @@ export default function start() {
app.register(RPCHandlersToken, rpcExample());
app.register(RPCToken, RPC);
} else if (__BROWSER__) {
app.register(FetchForCsrfToken, unfetch);
app.register(FetchToken, unfetch);
app.register(RPCToken, RPC);
}
app.register(FetchToken, CsrfProtection);
app.enhance(FetchToken, CsrfProtection);
app.register(UniversalEventsToken, UniversalEvents);
app.register(Router);
app.register(Styletron);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/favicon.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ this plugin will be completely removed in favor of a better interface
import {assetUrl, dangerouslySetHTML, createPlugin} from 'fusion-core';
import type {Context} from 'fusion-core';

export default createPlugin({
export default createPlugin<empty, void>({
middleware: () => {
const iconUrl = assetUrl('../static/favicon.ico');
const escaped = dangerouslySetHTML(
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/csrf-protection-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import {createPlugin} from 'fusion-core';

export default createPlugin({
export default createPlugin<empty, void>({
middleware: () => {
return (ctx, next) => {
if (ctx.path === ctx.prefix + '/test-fetch' && ctx.method === 'POST') {
Expand Down
Loading

0 comments on commit ebab530

Please sign in to comment.