Skip to content

Commit d912e27

Browse files
authored
Merge branch 'master' into include-link-style-guide
2 parents cbb6504 + 3a47f57 commit d912e27

File tree

19 files changed

+1782
-2244
lines changed

19 files changed

+1782
-2244
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ mkdir tmp
4949

5050
Install at least Node v7.5 if you don't already have it. We recommend using `nvm` to do this as it's both the simplest way to install and manage installed version(s) of node. If you need `nvm`, you can get it at [https://github.com/creationix/nvm](https://github.com/creationix/nvm).
5151

52+
Condenser is known to successfully build using node 7.5, npm 4.1.2, and yarn 1.1.0.
53+
5254
Using nvm, you would install like this:
5355
```bash
5456
nvm install v7.5

package.json

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"description": "steemit.com is the koa web server & middleware and react.js in-browser code for the world's first blockchain content + social media monetization platform!",
99
"main": "index.js",
1010
"scripts": {
11-
"build": "NODE_ENV=production ./node_modules/babel-cli/bin/babel-node.js ./node_modules/.bin/webpack --stats --config ./webpack/prod.config.js; rm -rf ./lib; babel src --out-dir lib -Dq",
11+
"build": "NODE_ENV=production ./node_modules/babel-cli/bin/babel-node.js ./node_modules/.bin/webpack --config ./webpack/prod.config.js; rm -rf ./lib; babel src --out-dir lib -Dq",
1212
"mocha": "NODE_ENV=test mocha ./mocha.setup.js",
1313
"test": "npm run mocha -- src/app/**/*.test.js",
1414
"test:watch:all": "npm test -- --watch --watch-extensions jsx",
@@ -28,7 +28,7 @@
2828
"babel-cli": "^6.22.2",
2929
"babel-core": "^6.20.0",
3030
"babel-eslint": "^6.0.4",
31-
"babel-loader": "^6.2.9",
31+
"babel-loader": "^7.1.2",
3232
"babel-plugin-react-intl": "^2.2.0",
3333
"babel-plugin-transform-decorators-legacy": "^1.3.4",
3434
"babel-plugin-transform-runtime": "^6.15.0",
@@ -46,23 +46,22 @@
4646
"config": "^1.25.1",
4747
"counterpart": "^0.17.6",
4848
"cpu-stat": "^2.0.1",
49-
"css-loader": "^0.23.1",
49+
"css-loader": "^0.28.5",
5050
"currency-symbol-map": "^3.1.0",
5151
"diff-match-patch": "^1.0.0",
5252
"disk-stat": "^1.0.4",
5353
"ecurve": "^1.0.2",
5454
"estraverse-fb": "^1.3.1",
55-
"extract-text-webpack-plugin": "^1.0.1",
56-
"file-loader": "^0.8.5",
55+
"file-loader": "^0.11.2",
5756
"foundation-sites": "git+https://github.com/steemit/foundation-sites.git#e8e32c715bbc4c822b80b555345f61337269ca78",
58-
"git-rev-sync": "^1.6.0",
57+
"git-rev-sync": "^1.9.1",
5958
"grant-koa": "^3.6.0",
6059
"highcharts": "^4.2.5",
6160
"humanize-number": "0.0.2",
62-
"imports-loader": "^0.6.5",
61+
"imports-loader": "^0.7.1",
6362
"intl": "^1.2.5",
6463
"iso": "^5.1.0",
65-
"json-loader": "^0.5.4",
64+
"json-loader": "^0.5.7",
6665
"koa": "^1.1.2",
6766
"koa-body": "^1.4.0",
6867
"koa-compressor": "^1.0.3",
@@ -87,7 +86,7 @@
8786
"mixpanel": "^0.5.0",
8887
"mysql": "^2.10.2",
8988
"net": "^1.0.2",
90-
"node-sass": "^3.4.2",
89+
"node-sass": "^4.5.3",
9190
"os": "^0.1.1",
9291
"purest": "^2.0.1",
9392
"raw-loader": "^0.5.1",
@@ -107,7 +106,7 @@
107106
"react-prop-types": "^0.3.0",
108107
"react-qr": "0.0.2",
109108
"react-rangeslider": "1.0.3",
110-
"react-redux": "^4.4.0",
109+
"react-redux": "^5.0.6",
111110
"react-router": "^3.0.5",
112111
"react-router-redux": "^4.0.0",
113112
"react-router-scroll": "^0.4.2",
@@ -117,28 +116,29 @@
117116
"redux-form": "5.3.4",
118117
"redux-modules": "0.0.5",
119118
"redux-saga": "^0.9.5",
120-
"remarkable": "1.6.2",
119+
"remarkable": "^1.7.1",
121120
"sanitize-html": "^1.11.4",
122-
"sass-loader": "^3.1.2",
121+
"sass-loader": "^6.0.6",
123122
"secure-random": "^1.1.1",
124123
"sendgrid": "^4.0.1",
125124
"sequelize": "^3.21.0",
126125
"sequelize-cli": "^2.3.1",
127126
"speakingurl": "^9.0.0",
128127
"sqlite3": "^3.1.8",
129-
"steem": "github:steemit/steem-js#5f50ad5",
128+
"steem": "github:steemit/steem-js#ec4439c",
130129
"store": "^1.3.20",
131-
"style-loader": "^0.13.0",
132-
"svg-inline-loader": "^0.4.0",
130+
"style-loader": "^0.18.2",
131+
"svg-inline-loader": "^0.8.0",
133132
"svg-inline-react": "^1.0.2",
134-
"svgo-loader": "^1.1.0",
133+
"svgo-loader": "^1.2.1",
135134
"tarantool-driver": "^2.0.1",
136135
"twilio": "^2.11.1",
137136
"uncontrollable": "^3.2.1",
138137
"underscore.string": "^3.2.3",
139-
"url-loader": "^0.5.7",
138+
"url-loader": "^0.5.9",
140139
"web-push": "^3.2.1",
141-
"webpack": "^1.13.2",
140+
"webpack": "^3.5.5",
141+
"webpack-dev-middleware": "^1.12.0",
142142
"webpack-isomorphic-tools": "^3.0.3",
143143
"websocket": "^1.0.22",
144144
"whatwg-fetch": "^0.11.1",
@@ -160,7 +160,7 @@
160160
"eslint-plugin-import": "^2.7.0",
161161
"eslint-plugin-jsx-a11y": "^6.0.2",
162162
"eslint-plugin-react": "^7.4.0",
163-
"extract-text-webpack-plugin": "^1.0.1",
163+
"extract-text-webpack-plugin": "^3.0.0",
164164
"jsdom": "^9.8.0",
165165
"koa-webpack-dev-middleware": "^1.1.0",
166166
"koa-webpack-hot-middleware": "^1.0.3",
@@ -173,13 +173,15 @@
173173
"react-transform-hmr": "^1.0.4",
174174
"sinon": "^1.17.3",
175175
"sinon-chai": "^2.8.0",
176-
"supertest": "^1.2.0"
176+
"supertest": "^1.2.0",
177+
"webpack-bundle-analyzer": "^2.9.0"
177178
},
178179
"optionalDependencies": {
179180
"fsevents": "*"
180181
},
181182
"engines": {
182-
"node": ">=7.0.0"
183+
"node": ">=7.0.0",
184+
"npm": ">=5.4.2"
183185
},
184186
"pre-commit": [
185187
"eslint",

src/app/RootRoute.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// polyfill webpack require.ensure
2-
//if (typeof require.ensure !== 'function') require.ensure = (d, c) => c(require);
3-
41
import App from 'app/components/App';
52
import PostsIndex from 'app/components/pages/PostsIndex';
63
import resolveRoute from './ResolveRoute';
74

5+
// polyfill webpack require.ensure
6+
if (typeof require.ensure !== 'function') require.ensure = (d, c) => c(require);
7+
88
export default {
99
path: '/',
1010
component: App,
@@ -79,19 +79,21 @@ export default {
7979
cb(null, [require('app/components/pages/Witnesses')]);
8080
//});
8181
} else if (route.page === 'SubmitPost') {
82-
//require.ensure([], (require) => {
83-
if (process.env.BROWSER)
84-
cb(null, [require('app/components/pages/SubmitPost')]);
85-
else
82+
if (process.env.BROWSER) {
83+
// require.ensure([], (require) => {
84+
cb(null, [require('app/components/pages/SubmitPost')]);
85+
// });
86+
} else {
8687
cb(null, [require('app/components/pages/SubmitPostServerRender')]);
88+
}
8789
} else if (route.page === 'UserProfile') {
8890
//require.ensure([], (require) => {
8991
cb(null, [require('app/components/pages/UserProfile')]);
9092
//});
9193
} else if (route.page === 'Market') {
92-
//require.ensure([], (require) => {
93-
cb(null, [require('app/components/pages/Market')]);
94-
//});
94+
require.ensure([], (require) => {
95+
cb(null, [require('app/components/pages/Market')]);
96+
});
9597
} else if (route.page === 'Post') {
9698
//require.ensure([], (require) => {
9799
cb(null, [require('app/components/pages/PostPage')]);

src/app/assets/images/500.jpg

109 KB
Loading

src/app/assets/images/500.svg

Lines changed: 0 additions & 1033 deletions
This file was deleted.

src/app/components/elements/PageViewsCounter.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export default class PageViewsCounter extends React.Component {
2121

2222
pageView() {
2323
let ref = document.referrer || '';
24-
if (ref.match('://' + window.location.hostname)) ref = '';
2524
recordPageView(window.location.pathname, ref).then(views => this.setState({views}));
2625
this.last_page = window.location.pathname;
2726
}

src/app/components/elements/ReplyEditor.jsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ import Dropzone from 'react-dropzone'
1717
import tt from 'counterpart'
1818

1919
const remarkable = new Remarkable({ html: true, linkify: false, breaks: true })
20-
const RichTextEditor = process.env.BROWSER ? require('react-rte-image').default : null;
20+
2121
const RTE_DEFAULT = false
22-
//var htmlclean = require('htmlclean');
2322

2423
class ReplyEditor extends React.Component {
2524

@@ -39,6 +38,7 @@ class ReplyEditor extends React.Component {
3938
category: React.PropTypes.string, // initial value
4039
title: React.PropTypes.string, // initial value
4140
body: React.PropTypes.string, // initial value
41+
richTextEditor: React.PropTypes.func,
4242
}
4343

4444
static defaultProps = {
@@ -89,7 +89,7 @@ class ReplyEditor extends React.Component {
8989
body.props.onChange(raw)
9090
this.setState({
9191
rte,
92-
rte_value: rte ? stateFromHtml(raw) : null
92+
rte_value: rte ? stateFromHtml(this.props.richTextEditor, raw) : null
9393
})
9494
this.setAutoVote()
9595
this.setState({payoutType: this.props.isStory ? (localStorage.getItem('defaultPayoutType') || '50%') : '50%'})
@@ -179,7 +179,7 @@ class ReplyEditor extends React.Component {
179179
if(!body.value || confirm(tt('reply_editor.are_you_sure_you_want_to_clear_this_form'))) {
180180
replyForm.resetForm()
181181
this.setAutoVote()
182-
this.setState({rte_value: stateFromHtml()})
182+
this.setState({rte_value: stateFromHtml(this.props.richTextEditor)})
183183
this.setState({progress: {}})
184184
if(onCancel) onCancel(e)
185185
}
@@ -214,7 +214,7 @@ class ReplyEditor extends React.Component {
214214
const state = {rte: !this.state.rte};
215215
if (state.rte) {
216216
const {body} = this.state
217-
state.rte_value = isHtmlTest(body.value) ? stateFromHtml(body.value) : stateFromMarkdown(body.value)
217+
state.rte_value = isHtmlTest(body.value) ? stateFromHtml(this.props.richTextEditor, body.value) : stateFromMarkdown(this.props.richTextEditor, body.value)
218218
}
219219
this.setState(state);
220220
localStorage.setItem('replyEditorData-rte', !this.state.rte)
@@ -335,6 +335,7 @@ class ReplyEditor extends React.Component {
335335
const vframe_class = isStory ? 'vframe' : '';
336336
const vframe_section_class = isStory ? 'vframe__section' : '';
337337
const vframe_section_shrink_class = isStory ? 'vframe__section--shrink' : '';
338+
const RichTextEditor = this.props.richTextEditor;
338339

339340
return (
340341
<div className="ReplyEditor row">
@@ -474,28 +475,29 @@ function stateToHtml(state) {
474475
return `<html>\n${html}\n</html>`;
475476
}
476477

477-
function stateFromHtml(html = null) {
478+
function stateFromHtml(RichTextEditor, html = null) {
478479
if(!RichTextEditor) return null;
479480
if(html) html = stripHtmlWrapper(html)
480481
if(html && html.trim() == '') html = null
481482
return html ? RichTextEditor.createValueFromString(html, 'html')
482483
: RichTextEditor.createEmptyValue()
483484
}
484485

485-
function stateFromMarkdown(markdown) {
486+
function stateFromMarkdown(RichTextEditor, markdown) {
486487
let html
487488
if(markdown && markdown.trim() !== '') {
488489
html = remarkable.render(markdown)
489490
html = HtmlReady(html).html // TODO: option to disable youtube conversion, @-links, img proxy
490491
//html = htmlclean(html) // normalize whitespace
491492
console.log("markdown converted to:", html)
492493
}
493-
return stateFromHtml(html)
494+
return stateFromHtml(RichTextEditor, html)
494495
}
495496

496-
import {connect} from 'react-redux'
497+
import {connect} from 'react-redux';
498+
const richTextEditor = process.env.BROWSER ? require('react-rte-image').default : null;
497499

498-
export default formId => connect(
500+
export default (formId) => connect(
499501
// mapStateToProps
500502
(state, ownProps) => {
501503
const username = state.user.getIn(['current', 'username'])
@@ -517,7 +519,7 @@ export default formId => connect(
517519
...ownProps,
518520
fields, isStory, username,
519521
initialValues: {title, body, category}, state,
520-
formId,
522+
formId, richTextEditor,
521523
}
522524
return ret
523525
},

src/app/components/pages/Market.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class Market extends React.Component {
247247
const rows = open_orders && normalizeOpenOrders(open_orders).map( o =>
248248
<tr key={o.orderid}>
249249
<td>{o.created.replace('T', ' ')}</td>
250-
<td>{o.type == 'g.ask' ? tt('g.sell') : tt('g.buy')}</td>
250+
<td>{o.type == 'ask' ? tt('g.sell') : tt('g.buy')}</td>
251251
<td>{CURRENCY_SIGN}{o.price.toFixed(6)}</td>
252252
<td>{o.steem}</td>
253253
<td>{o.sbd.replace('SBD', DEBT_TOKEN_SHORT)}</td>

src/app/components/pages/SubmitPost.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React from 'react';
2-
// import {connect} from 'react-redux';
32
import { browserHistory } from 'react-router';
43
import ReplyEditor from 'app/components/elements/ReplyEditor'
54

6-
const formId = 'submitStory'
7-
const SubmitReplyEditor = ReplyEditor(formId)
5+
const formId = 'submitStory';
6+
// const richTextEditor = process.env.BROWSER ? require('react-rte-image').default : null;
7+
// const SubmitReplyEditor = ReplyEditor(formId, richTextEditor);
8+
const SubmitReplyEditor = ReplyEditor(formId);
89

910
class SubmitPost extends React.Component {
1011
// static propTypes = {

src/app/components/pages/Welcome.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ class Welcome extends React.Component {
88
<div className="column large-8 medium-10 small-12">
99
<div className="Welcome__banner">
1010
<div className="Welcome__welcome">Welcome to</div>
11-
<img src={require(`app/assets/images/welcome.jpg`)} />
11+
<img src={require('app/assets/images/welcome.jpg')} />
1212
<div className="Welcome__caption">Come for the rewards. Stay for the community.</div>
1313
</div>
1414
<hr />
15-
<HelpContent path="welcome"/>
15+
<HelpContent path="welcome" />
1616
</div>
1717
</div>
1818
);

0 commit comments

Comments
 (0)