Skip to content

Commit 8543c7b

Browse files
committed
Merge branch 'release-v1.0.2'
2 parents f9be0bf + b693041 commit 8543c7b

29 files changed

Lines changed: 317 additions & 124 deletions

‎.travis.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ install:
2424
# commit.
2525
- npm install && scripts/fetch-develop.deps.sh --depth 1
2626
script:
27-
- npm run test
27+
- CHROME_BIN='/usr/bin/google-chrome-stable' npm run test
2828
- npm run lint

‎CHANGELOG.md‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
Changes in [1.0.2](https://github.com/vector-im/riot-web/releases/tag/v1.0.2) (2019-03-06)
2+
==========================================================================================
3+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.2-rc.3...v1.0.2)
4+
5+
* New react-sdk for minor hosting link fixes
6+
7+
Changes in [1.0.2-rc.3](https://github.com/vector-im/riot-web/releases/tag/v1.0.2-rc.3) (2019-03-05)
8+
====================================================================================================
9+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.2-rc.2...v1.0.2-rc.3)
10+
11+
* Add modular.im hosting link to electron app config
12+
[\#9051](https://github.com/vector-im/riot-web/pull/9051)
13+
14+
Changes in [1.0.2-rc.2](https://github.com/vector-im/riot-web/releases/tag/v1.0.2-rc.2) (2019-03-01)
15+
====================================================================================================
16+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.2-rc.1...v1.0.2-rc.2)
17+
18+
* Update to react-sdk rc.3
19+
20+
Changes in [1.0.2-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.0.2-rc.1) (2019-03-01)
21+
====================================================================================================
22+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.1...v1.0.2-rc.1)
23+
24+
* Set a require alias for the webapp directory
25+
[\#9014](https://github.com/vector-im/riot-web/pull/9014)
26+
* Update from Weblate.
27+
[\#8973](https://github.com/vector-im/riot-web/pull/8973)
28+
* set chrome path for travis CI explicitly
29+
[\#8987](https://github.com/vector-im/riot-web/pull/8987)
30+
* Updated install spinner
31+
[\#8984](https://github.com/vector-im/riot-web/pull/8984)
32+
* Allow disabling update mechanism
33+
[\#8911](https://github.com/vector-im/riot-web/pull/8911)
34+
* Allow configuration of whether closing window closes or minimizes to tray
35+
[\#8908](https://github.com/vector-im/riot-web/pull/8908)
36+
* Fix language file path for Jenkins
37+
[\#8854](https://github.com/vector-im/riot-web/pull/8854)
38+
* Document and recommend `default_server_name`
39+
[\#8832](https://github.com/vector-im/riot-web/pull/8832)
40+
* Cache busting for icons & language files
41+
[\#8710](https://github.com/vector-im/riot-web/pull/8710)
42+
* Remove redesign issue template
43+
[\#8722](https://github.com/vector-im/riot-web/pull/8722)
44+
* Make scripts/make-icons.sh work on linux
45+
[\#8550](https://github.com/vector-im/riot-web/pull/8550)
46+
147
Changes in [1.0.1](https://github.com/vector-im/riot-web/releases/tag/v1.0.1) (2019-02-15)
248
==========================================================================================
349
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.0...v1.0.1)

‎README.md‎

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,24 @@ config.json
116116
You can configure the app by copying `config.sample.json` to
117117
`config.json` and customising it:
118118

119-
For a good example, see https://riot.im/develop/config.json
120-
121-
1. `default_hs_url` is the default homeserver url.
122-
1. `default_is_url` is the default identity server url (this is the server used
123-
for verifying third party identifiers like email addresses). If this is blank,
124-
registering with an email address, adding an email address to your account,
125-
or inviting users via email address will not work. Matrix identity servers are
126-
very simple web services which map third party identifiers (currently only email
127-
addresses) to matrix IDs: see http://matrix.org/docs/spec/identity_service/unstable.html
128-
for more details. Currently the only public matrix identity servers are https://matrix.org
129-
and https://vector.im. In future identity servers will be decentralised.
119+
For a good example, see https://riot.im/develop/config.json.
120+
121+
1. `default_server_name` sets the default server name to use for authentication.
122+
This will trigger Riot to ask
123+
`https://<server_name>/.well-known/matrix/client` for the homeserver and
124+
identity server URLs to use. This is the recommended approach for setting a
125+
default server. However, it is also possible to use the following to directly
126+
configure each of the URLs:
127+
* `default_hs_url` sets the default homeserver URL.
128+
* `default_is_url` sets the default identity server URL (this is the server used
129+
for verifying third party identifiers like email addresses). If this is blank,
130+
registering with an email address, adding an email address to your account,
131+
or inviting users via email address will not work. Matrix identity servers are
132+
very simple web services which map third party identifiers (currently only email
133+
addresses) to matrix IDs: see http://matrix.org/docs/spec/identity_service/unstable.html
134+
for more details. Currently the only public matrix identity servers are https://matrix.org
135+
and https://vector.im. In the future, identity servers will be decentralised.
136+
* Riot will report an error if you accidentally configure both `default_server_name` _and_ `default_hs_url` since it's unclear which should take priority.
130137
1. `features`: Lookup of optional features that may be `enable`d, `disable`d, or exposed to the user
131138
in the `labs` section of settings. The available optional experimental features vary from
132139
release to release.
1.04 KB
Loading

‎electron_app/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
"name": "riot-web",
33
"productName": "Riot",
44
"main": "src/electron-main.js",
5-
"version": "1.0.1",
5+
"version": "1.0.2",
66
"description": "A feature-rich client for Matrix.org",
77
"author": "New Vector Ltd.",
88
"dependencies": {
99
"auto-launch": "^5.0.1",
10+
"electron-store": "^2.0.0",
1011
"electron-window-state": "^4.1.0",
1112
"minimist": "^1.2.0",
1213
"png-to-ico": "^1.0.2"

‎electron_app/riot.im/config.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"https://scalar-staging.riot.im/scalar/api",
1010
"https://scalar.vector.im/api"
1111
],
12+
"hosting_signup_link": "https://modular.im/?utm_source=riot-web&utm_medium=web",
1213
"bug_report_endpoint_url": "https://riot.im/bugreports/submit",
1314
"welcomeUserId": "@riot-bot:matrix.org",
1415
"roomDirectory": {

‎electron_app/src/electron-main.js‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const updater = require('./updater');
3535
const { migrateFromOldOrigin } = require('./originMigrator');
3636

3737
const windowStateKeeper = require('electron-window-state');
38+
const Store = require('electron-store');
3839

3940
// boolean flag set whilst we are doing one-time origin migration
4041
// We only serve the origin migration script while we're actually
@@ -55,8 +56,11 @@ try {
5556
// Continue with the defaults (ie. an empty config)
5657
}
5758

59+
const store = new Store();
60+
5861
let mainWindow = null;
5962
global.appQuitting = false;
63+
global.minimizeToTray = store.get('minimizeToTray', true);
6064

6165

6266
// handle uncaught errors otherwise it displays
@@ -136,6 +140,12 @@ ipcMain.on('ipcCall', async function(ev, payload) {
136140
launcher.disable();
137141
}
138142
break;
143+
case 'getMinimizeToTrayEnabled':
144+
ret = global.minimizeToTray;
145+
break;
146+
case 'setMinimizeToTrayEnabled':
147+
store.set('minimizeToTray', global.minimizeToTray = args[0]);
148+
break;
139149
case 'getAppVersion':
140150
ret = app.getVersion();
141151
break;
@@ -147,6 +157,7 @@ ipcMain.on('ipcCall', async function(ev, payload) {
147157
} else {
148158
mainWindow.focus();
149159
}
160+
break;
150161
case 'origin_migrate':
151162
migratingOrigin = true;
152163
await migrateFromOldOrigin();
@@ -262,10 +273,12 @@ app.on('ready', () => {
262273
path: absTarget,
263274
});
264275
}, (error) => {
265-
if (error) console.error('Failed to register protocol')
276+
if (error) console.error('Failed to register protocol');
266277
});
267278

268-
if (vectorConfig['update_base_url']) {
279+
if (argv['no-update']) {
280+
console.log('Auto update disabled via command line flag "--no-update"');
281+
} else if (vectorConfig['update_base_url']) {
269282
console.log(`Starting auto update with base URL: ${vectorConfig['update_base_url']}`);
270283
updater.start(vectorConfig['update_base_url']);
271284
} else {
@@ -331,7 +344,7 @@ app.on('ready', () => {
331344
mainWindow = global.mainWindow = null;
332345
});
333346
mainWindow.on('close', (e) => {
334-
if (!global.appQuitting && (tray.hasTray() || process.platform === 'darwin')) {
347+
if (global.minimizeToTray && !global.appQuitting && (tray.hasTray() || process.platform === 'darwin')) {
335348
// On Mac, closing the window just hides it
336349
// (this is generally how single-window Mac apps
337350
// behave, eg. Mail.app)

‎package-lock.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "riot-web",
33
"productName": "Riot",
44
"main": "electron_app/src/electron-main.js",
5-
"version": "1.0.1",
5+
"version": "1.0.2",
66
"description": "A feature-rich client for Matrix.org",
77
"author": "New Vector Ltd.",
88
"repository": {
@@ -70,8 +70,8 @@
7070
"gemini-scrollbar": "github:matrix-org/gemini-scrollbar#b302279",
7171
"gfm.css": "^1.1.2",
7272
"highlight.js": "^9.13.1",
73-
"matrix-js-sdk": "1.0.0",
74-
"matrix-react-sdk": "1.0.1",
73+
"matrix-js-sdk": "1.0.1",
74+
"matrix-react-sdk": "1.0.2",
7575
"modernizr": "^3.6.0",
7676
"prop-types": "^15.6.2",
7777
"react": "^15.6.0",
@@ -125,6 +125,7 @@
125125
"karma-spec-reporter": "0.0.31",
126126
"karma-summary-reporter": "^1.5.1",
127127
"karma-webpack": "4.0.0-beta.0",
128+
"loader-utils": "^1.2.3",
128129
"matrix-mock-request": "^1.2.2",
129130
"matrix-react-test-utils": "^0.2.0",
130131
"minimist": "^1.2.0",
@@ -151,7 +152,7 @@
151152
},
152153
"build": {
153154
"appId": "im.riot.app",
154-
"electronVersion": "4.0.4",
155+
"electronVersion": "4.0.6",
155156
"files": [
156157
"node_modules/**",
157158
"src/**",

‎scripts/copy-res.js‎

Lines changed: 62 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env node
22

3+
const loaderUtils = require("loader-utils");
4+
35
// copies the resources into the webapp directory.
46
//
57

@@ -61,12 +63,6 @@ const COPY_LIST = [
6163
["./config.json", "webapp", { directwatch: 1 }],
6264
];
6365

64-
INCLUDE_LANGS.forEach(function(l) {
65-
COPY_LIST.push([
66-
l.value, "webapp/i18n/", { lang: 1 },
67-
]);
68-
});
69-
7066
const parseArgs = require('minimist');
7167
const Cpx = require('cpx');
7268
const chokidar = require('chokidar');
@@ -77,8 +73,8 @@ const argv = parseArgs(
7773
process.argv.slice(2), {}
7874
);
7975

80-
var watch = argv.w;
81-
var verbose = argv.v;
76+
const watch = argv.w;
77+
const verbose = argv.v;
8278

8379
function errCheck(err) {
8480
if (err) {
@@ -136,39 +132,11 @@ function next(i, err) {
136132
.on('change', copy)
137133
.on('ready', cb)
138134
.on('error', errCheck);
139-
} else if (opts.lang) {
140-
const reactSdkFile = 'node_modules/matrix-react-sdk/src/i18n/strings/' + source + '.json';
141-
const riotWebFile = 'src/i18n/strings/' + source + '.json';
142-
143-
// XXX: Use a debounce because for some reason if we read the language
144-
// file immediately after the FS event is received, the file contents
145-
// appears empty. Possibly https://github.com/nodejs/node/issues/6112
146-
let makeLangDebouncer;
147-
const makeLang = () => {
148-
if (makeLangDebouncer) {
149-
clearTimeout(makeLangDebouncer);
150-
}
151-
makeLangDebouncer = setTimeout(() => {
152-
genLangFile(source, dest);
153-
}, 500);
154-
};
155-
156-
[reactSdkFile, riotWebFile].forEach(function(f) {
157-
chokidar.watch(f)
158-
.on('add', makeLang)
159-
.on('change', makeLang)
160-
//.on('ready', cb) We'd have to do this when both files are ready
161-
.on('error', errCheck);
162-
});
163-
next(i + 1, err);
164135
} else {
165136
cpx.on('watch-ready', cb);
166137
cpx.on("watch-error", cb);
167138
cpx.watch();
168139
}
169-
} else if (opts.lang) {
170-
genLangFile(source, dest);
171-
next(i + 1, err);
172140
} else {
173141
cpx.copy(cb);
174142
}
@@ -195,21 +163,28 @@ function genLangFile(lang, dest) {
195163

196164
translations = weblateToCounterpart(translations);
197165

198-
fs.writeFileSync(dest + lang + '.json', JSON.stringify(translations, null, 4));
166+
const json = JSON.stringify(translations, null, 4);
167+
const jsonBuffer = Buffer.from(json);
168+
const digest = loaderUtils.getHashDigest(jsonBuffer, null, null, 7);
169+
const filename = `${lang}.${digest}.json`;
170+
171+
fs.writeFileSync(dest + filename, json);
199172
if (verbose) {
200-
console.log("Generated language file: " + lang);
173+
console.log("Generated language file: " + filename);
201174
}
175+
176+
return filename;
202177
}
203178

204-
function genLangList() {
179+
function genLangList(langFileMap) {
205180
const languages = {};
206181
INCLUDE_LANGS.forEach(function(lang) {
207182
const normalizedLanguage = lang.value.toLowerCase().replace("_", "-");
208183
const languageParts = normalizedLanguage.split('-');
209184
if (languageParts.length == 2 && languageParts[0] == languageParts[1]) {
210-
languages[languageParts[0]] = {'fileName': lang.value + '.json', 'label': lang.label};
185+
languages[languageParts[0]] = {'fileName': langFileMap[lang.value], 'label': lang.label};
211186
} else {
212-
languages[normalizedLanguage] = {'fileName': lang.value + '.json', 'label': lang.label};
187+
languages[normalizedLanguage] = {'fileName': langFileMap[lang.value], 'label': lang.label};
213188
}
214189
});
215190
fs.writeFile('webapp/i18n/languages.json', JSON.stringify(languages, null, 4), function(err) {
@@ -257,5 +232,50 @@ function weblateToCounterpart(inTrs) {
257232
return outTrs;
258233
}
259234

260-
genLangList();
235+
/**
236+
watch the input files for a given language,
237+
regenerate the file, adding its content-hashed filename to langFileMap
238+
and regenerating languages.json with the new filename
239+
*/
240+
function watchLanguage(lang, dest, langFileMap) {
241+
const reactSdkFile = 'node_modules/matrix-react-sdk/src/i18n/strings/' + lang + '.json';
242+
const riotWebFile = 'src/i18n/strings/' + lang + '.json';
243+
244+
// XXX: Use a debounce because for some reason if we read the language
245+
// file immediately after the FS event is received, the file contents
246+
// appears empty. Possibly https://github.com/nodejs/node/issues/6112
247+
let makeLangDebouncer;
248+
const makeLang = () => {
249+
if (makeLangDebouncer) {
250+
clearTimeout(makeLangDebouncer);
251+
}
252+
makeLangDebouncer = setTimeout(() => {
253+
const filename = genLangFile(lang, dest);
254+
langFileMap[lang]=filename;
255+
genLangList(langFileMap);
256+
}, 500);
257+
};
258+
259+
[reactSdkFile, riotWebFile].forEach(function(f) {
260+
chokidar.watch(f)
261+
.on('add', makeLang)
262+
.on('change', makeLang)
263+
.on('error', errCheck);
264+
});
265+
}
266+
267+
// language resources
268+
const I18N_DEST = "webapp/i18n/";
269+
const I18N_FILENAME_MAP = INCLUDE_LANGS.reduce((m, l) => {
270+
const filename = genLangFile(l.value, I18N_DEST);
271+
m[l.value] = filename;
272+
return m;
273+
}, {});
274+
genLangList(I18N_FILENAME_MAP);
275+
276+
if (watch) {
277+
INCLUDE_LANGS.forEach(l => watchLanguage(l.value, I18N_DEST, I18N_FILENAME_MAP));
278+
}
279+
280+
// non-language resources
261281
next(0);

0 commit comments

Comments
 (0)