replace buggy tinify with uglify-es

This commit is contained in:
or-else
2018-09-16 15:04:20 +03:00
parent 7228053261
commit 1e268b3eae
4 changed files with 28 additions and 32 deletions
+9 -12
View File
@@ -1,27 +1,25 @@
{ {
"name": "tinode-webapp", "name": "tinode-webapp",
"description": "Tinode Web Client", "description": "Tinode messenger for the web",
"version": "0.15.6-rc1", "version": "0.15.6-rc2",
"devDependencies": { "devDependencies": {
"babel-cli": "^6.26.0", "babel-cli": "^6.26.0",
"babel-minify": "^0.4.3",
"babel-preset-env": "^1.7.0", "babel-preset-env": "^1.7.0",
"babel-preset-minify": "^0.4.3",
"babel-preset-react": "^6.24.1", "babel-preset-react": "^6.24.1",
"cssnano": "^4.0.5" "cssnano": "^4.0.5",
"uglify-es": "^3.3.9"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/tinode/example-react-js.git" "url": "https://github.com/tinode/example-react-js.git"
}, },
"scripts": { "scripts": {
"build": "npm run build:babel && npm run build:js-prod && npm run build:css", "build": "npm run build:babel && npm run build:prod && npm run build:dev && npm run build:css",
"build:dev": "npm run build:babel && npm run build:js-dev", "build:prod": "browserify ./src/index.js --standalone Webapp | uglifyjs --compress --mangle > ./umd/index.prod.js",
"build:js-prod": "browserify ./src/index.js --standalone Webapp --plugin tinyify > ./umd/index.prod.js", "build:dev": "browserify ./src/index.js --standalone Webapp > ./umd/index.dev.js",
"build:js-dev": "browserify ./src/index.js --standalone Webapp > ./umd/index.dev.js",
"build:babel": "babel ./src/webapp.jsx --presets react --out-file ./src/webapp.js", "build:babel": "babel ./src/webapp.jsx --presets react --out-file ./src/webapp.js",
"build:css": "postcss css/base.css > css/base.min.css", "build:css": "postcss css/base.css > css/base.min.css",
"babel-version": "babel --version" "vers": "echo \"{\\\"version\\\": \\\"`node -p -e \"require('./package.json').version\"`\\\"}\" > version.json"
}, },
"files": [ "files": [
"src/index.js", "src/index.js",
@@ -67,7 +65,6 @@
"dependencies": { "dependencies": {
"react": "^16.5.1", "react": "^16.5.1",
"react-dom": "^16.4.2", "react-dom": "^16.4.2",
"tinode-sdk": "^0.15.6-rc1", "tinode-sdk": "^0.15.6-rc3"
"tinyify": "^2.4.3"
} }
} }
+8 -8
View File
@@ -1,3 +1,7 @@
// Babel JSX
'use strict';
if (typeof require == 'function') { if (typeof require == 'function') {
if (typeof React == 'undefined') { if (typeof React == 'undefined') {
var React = require('react'); var React = require('react');
@@ -8,8 +12,6 @@ if (typeof require == 'function') {
} }
} }
// Babel JSX
// Name of this application, used in the User-Agent. // Name of this application, used in the User-Agent.
const APP_NAME = "TinodeWeb/0.15"; const APP_NAME = "TinodeWeb/0.15";
@@ -1175,12 +1177,11 @@ class GroupSubs extends React.Component {
var usersOnline = []; var usersOnline = [];
this.state.onlineSubs.map((sub) => { this.state.onlineSubs.map((sub) => {
usersOnline.push( usersOnline.push(
<div className="avatar-box"> <div className="avatar-box" key={sub.user}>
<LetterTile <LetterTile
topic={sub.user} topic={sub.user}
avatar={makeImageUrl(sub.public ? sub.public.photo : null) || true} avatar={makeImageUrl(sub.public ? sub.public.photo : null) || true}
title={sub.public ? sub.public.fn : null} title={sub.public ? sub.public.fn : null} />
key={sub.user} />
</div> </div>
); );
}); });
@@ -4208,7 +4209,8 @@ class SendMessage extends React.PureComponent {
/* This is just a static page to display when no conversation is selected. */ /* This is just a static page to display when no conversation is selected. */
class LogoView extends React.PureComponent { class LogoView extends React.PureComponent {
render() { render() {
var version = Tinode.getVersion() + " build " + document.lastModified; var version = APP_NAME + " (" + Tinode.getLibrary() + "-" +
(new Date(document.lastModified)).toISOString() + ")";
return ( return (
<div id="dummy-view" className={this.props.hideSelf ? 'nodisplay' : null}> <div id="dummy-view" className={this.props.hideSelf ? 'nodisplay' : null}>
<div> <div>
@@ -4967,8 +4969,6 @@ class TinodeWeb extends React.Component {
// New topic was creted, here is the new topic name. // New topic was creted, here is the new topic name.
handleNewTopicCreated(oldName, newName) { handleNewTopicCreated(oldName, newName) {
console.log("handleNewTopicCreated", oldName, newName);
if (this.state.topicSelected == oldName && oldName != newName) { if (this.state.topicSelected == oldName && oldName != newName) {
// If the current URl contains the old topic name, replace it with new. // If the current URl contains the old topic name, replace it with new.
// Update the name of the selected topic first so the navigator doen't clear // Update the name of the selected topic first so the navigator doen't clear
+10 -11
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long