Skip to content

Commit f37ea95

Browse files
committed
update @ProtonMail web clients
1 parent ee40997 commit f37ea95

38 files changed

+2736
-2119
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# IDE Idea
1+
# IDEs
22
/.idea
33
*.iml
4+
/.vscode
45

56
# node modules stuff
67
.pnpm-debug.log

.vscode/settings.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
"editor.formatOnSave": true,
33
"editor.defaultFormatter": "dprint.dprint",
44
"files.exclude": {
5-
"/app-dev/": true,
6-
"/app/": true,
7-
"/dist/": true,
8-
"/output/": true
5+
"**/.git": true,
6+
"**/node_modules": true,
7+
"app": true,
8+
"app-dev": true,
9+
"dist": true,
10+
"output": true
911
}
1012
}
Lines changed: 70 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,78 @@
1-
diff --git a/applications/account/webpack.config.ts b/applications/account/webpack.config.ts
2-
index 47b1d60b28..34c4b88afd 100644
3-
--- a/applications/account/webpack.config.ts
4-
+++ b/applications/account/webpack.config.ts
5-
@@ -7,7 +7,7 @@ import 'webpack-dev-server';
6-
7-
import getConfig from '@proton/pack/webpack.config';
8-
import CopyIndexHtmlWebpackPlugin from '@proton/pack/webpack/copy-index-html-webpack-plugin';
9-
-import { addDevEntry, getIndexChunks, getSupportedEntry } from '@proton/pack/webpack/entries';
10-
+import { getIndexChunks, getSupportedEntry } from '@proton/pack/webpack/entries';
1+
diff --git a/package.json b/package.json
2+
index 0195dc8bea..949d07c41e 100644
3+
--- a/package.json
4+
+++ b/package.json
5+
@@ -3,7 +3,7 @@
6+
"private": true,
7+
"license": "GPL-3.0",
8+
"workspaces": [
9+
- "applications/*",
10+
+ "applications/account",
11+
"applications/pass-desktop/native",
12+
"packages/*",
13+
"packages/wasm/*",
14+
@@ -60,4 +60,4 @@
15+
"publishConfig": {
16+
"registry": "https://nexus.protontech.ch/repository/web-npm/"
17+
}
18+
-}
19+
+}
20+
\ No newline at end of file
21+
--
1122

12-
import type { HrefLang } from './pages/interface';
13-
import { getPages } from './pages/pages';
14-
@@ -59,7 +59,7 @@ const result = async (env: any): Promise<webpack.Configuration> => {
23+
diff --git a/applications/account/package.json b/applications/account/package.json
24+
index 75bede49fa..7ab7d02751 100644
25+
--- a/applications/account/package.json
26+
+++ b/applications/account/package.json
27+
@@ -6,7 +6,6 @@
28+
"author": "",
29+
"main": "index.js",
30+
"scripts": {
31+
- "build:web": "cross-env NODE_ENV=production TS_NODE_PROJECT=\"../../tsconfig.webpack.json\" proton-pack build --configV2 --webpackOnCaffeine --appMode=sso --logical",
32+
"check-types": "tsc",
33+
"i18n:extract:web": "proton-i18n extract",
34+
"i18n:upgrade": "proton-i18n extract --verbose && proton-i18n crowdin --verbose",
35+
@@ -77,4 +76,4 @@
36+
"prettier": "^3.6.2",
37+
"typescript": "^5.8.3"
38+
}
39+
-}
40+
+}
41+
\ No newline at end of file
42+
--
1543

16-
const { pre, unsupported } = config.entry as any;
44+
diff --git a/packages/recovery-kit/package.json b/packages/recovery-kit/package.json
45+
index 3130a8c561..9736133d88 100644
46+
--- a/packages/recovery-kit/package.json
47+
+++ b/packages/recovery-kit/package.json
48+
@@ -11,6 +11,7 @@
49+
"dependencies": {
50+
"@pdfme/common": "^5.3.1",
51+
"@pdfme/generator": "^5.3.1",
52+
+ "@pdfme/schemas": "^5.3.1",
53+
"@proton/utils": "workspace:^"
54+
},
55+
"devDependencies": {
56+
@@ -20,4 +21,4 @@
57+
"ts-jest": "^29.4.0",
58+
"typescript": "^5.8.3"
59+
}
60+
-}
61+
+}
62+
\ No newline at end of file
63+
--
1764

18-
- if (env.appMode === 'standalone') {
19-
+ if (env.appMode === 'bundle') {
20-
config.entry = {
21-
pre,
22-
['private-index']: [path.resolve('./src/app/private.tsx'), getSupportedEntry()],
23-
@@ -79,7 +79,7 @@ const result = async (env: any): Promise<webpack.Configuration> => {
65+
diff --git a/applications/account/webpack.config.ts b/applications/account/webpack.config.ts
66+
index 2582067a9e..890f8a6b93 100644
67+
--- a/applications/account/webpack.config.ts
68+
+++ b/applications/account/webpack.config.ts
69+
@@ -75,8 +75,6 @@ const result = async (env: any): Promise<webpack.Configuration> => {
2470
})
2571
);
26-
72+
2773
- addDevEntry(config);
28-
+ // addDevEntry(config);
29-
74+
-
3075
return config;
3176
}
32-
77+
78+
--

patches/protonmail/app-calendar.patch

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,46 @@
1+
diff --git a/package.json b/package.json
2+
index 0195dc8bea..949d07c41e 100644
3+
--- a/package.json
4+
+++ b/package.json
5+
@@ -3,7 +3,7 @@
6+
"private": true,
7+
"license": "GPL-3.0",
8+
"workspaces": [
9+
- "applications/*",
10+
+ "applications/calendar",
11+
"applications/pass-desktop/native",
12+
"packages/*",
13+
"packages/wasm/*",
14+
@@ -60,4 +60,4 @@
15+
"publishConfig": {
16+
"registry": "https://nexus.protontech.ch/repository/web-npm/"
17+
}
18+
-}
19+
+}
20+
\ No newline at end of file
21+
--
22+
123
diff --git a/applications/calendar/package.json b/applications/calendar/package.json
2-
index bd4a61a905..b018e3beb2 100644
24+
index 7853a4e574..ea6bda411b 100644
325
--- a/applications/calendar/package.json
426
+++ b/applications/calendar/package.json
527
@@ -6,7 +6,6 @@
628
"author": "",
729
"main": "index.js",
830
"scripts": {
9-
- "build:web": "cross-env NODE_ENV=production TS_NODE_PROJECT=\"../../tsconfig.webpack.json\" proton-pack build --webpackOnCaffeine --appMode=sso --logical",
31+
- "build:web": "cross-env NODE_ENV=production TS_NODE_PROJECT=\"../../tsconfig.webpack.json\" proton-pack build --configV2 --webpackOnCaffeine --appMode=sso --logical",
1032
"check-types": "tsc",
1133
"i18n:extract:web": "proton-i18n extract",
1234
"i18n:upgrade": "proton-i18n extract --verbose && proton-i18n crowdin --verbose",
35+
@@ -74,4 +73,4 @@
36+
"prettier": "^3.6.2",
37+
"typescript": "^5.8.3"
38+
}
39+
-}
40+
+}
41+
\ No newline at end of file
42+
--
43+
1344
diff --git a/applications/calendar/src/app/index.tsx b/applications/calendar/src/app/index.tsx
1445
index b4d841c7cd..00ce66f767 100644
1546
--- a/applications/calendar/src/app/index.tsx

patches/protonmail/app-drive.patch

Lines changed: 105 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,59 @@
1+
diff --git a/package.json b/package.json
2+
index 0195dc8bea..949d07c41e 100644
3+
--- a/package.json
4+
+++ b/package.json
5+
@@ -3,7 +3,7 @@
6+
"private": true,
7+
"license": "GPL-3.0",
8+
"workspaces": [
9+
- "applications/*",
10+
+ "applications/drive",
11+
"applications/pass-desktop/native",
12+
"packages/*",
13+
"packages/wasm/*",
14+
@@ -60,4 +60,4 @@
15+
"publishConfig": {
16+
"registry": "https://nexus.protontech.ch/repository/web-npm/"
17+
}
18+
-}
19+
+}
20+
\ No newline at end of file
21+
--
22+
123
diff --git a/applications/drive/package.json b/applications/drive/package.json
2-
index c037e3ce53..e1655f0a06 100644
24+
index 0d537c5dda..976305cc4a 100644
325
--- a/applications/drive/package.json
426
+++ b/applications/drive/package.json
527
@@ -7,7 +7,6 @@
628
"main": "index.ts",
729
"scripts": {
830
"analyze": "yarn build:web --analyze",
9-
- "build:web": "cross-env NODE_ENV=production TS_NODE_PROJECT=\"../../tsconfig.webpack.json\" proton-pack build --webpackOnCaffeine --appMode=sso",
31+
- "build:web": "cross-env NODE_ENV=production TS_NODE_PROJECT=\"../../tsconfig.webpack.json\" proton-pack build --configV2 --webpackOnCaffeine --appMode=sso --handleSupportAndErrors --optimizeAssets",
1032
"check-types": "tsc",
1133
"i18n:extract:local": "yarn workspace @proton/i18n build && yarn build:web && proton-i18n extract",
1234
"i18n:extract:web": "proton-i18n extract",
35+
@@ -96,4 +95,4 @@
36+
"peerDependencies": {
37+
"@openpgp/web-stream-tools": "^0.1.0"
38+
}
39+
-}
40+
+}
41+
\ No newline at end of file
42+
--
1343

1444
diff --git a/applications/drive/src/app/index.tsx b/applications/drive/src/app/index.tsx
15-
index 7ca2da66f3..2a99b061bb 100644
45+
index 4d03c64db1..0e5766fcfe 100644
1646
--- a/applications/drive/src/app/index.tsx
1747
+++ b/applications/drive/src/app/index.tsx
18-
@@ -9,6 +9,8 @@ import { initializePerformanceMetrics } from './utils/performance';
19-
20-
const isPublicUrl = window.location.pathname.startsWith('/urls');
21-
48+
@@ -9,6 +9,8 @@ import App from './App';
49+
import './style';
50+
import { initializePerformanceMetrics } from './utils/performance';
51+
2252
+window.sessionStorage.setItem("electron_mail:proton_app_name", "proton-drive");
2353
+
24-
initializePerformanceMetrics(isPublicUrl);
25-
26-
ReactDOM.render(isPublicUrl ? <UrlsApp /> : <App />, document.querySelector('.app-root'));
54+
initializePerformanceMetrics(false);
55+
56+
ReactDOM.render(<App />, document.querySelector('.app-root'));
2757

2858
diff --git a/applications/drive/src/.htaccess b/applications/drive/src/.htaccess
2959
index b0b25a5fae..11d4e4af0f 100644
@@ -44,60 +74,82 @@ index b0b25a5fae..11d4e4af0f 100644
4474
AddOutputFilter INCLUDES;DEFLATE svg
4575

4676
diff --git a/applications/drive/src/app/store/_downloads/fileSaver/download.ts b/applications/drive/src/app/store/_downloads/fileSaver/download.ts
47-
index e3a5bd4889..da2217e2f3 100644
77+
index 1db1b7ca29..a7e6e460fd 100644
4878
--- a/applications/drive/src/app/store/_downloads/fileSaver/download.ts
4979
+++ b/applications/drive/src/app/store/_downloads/fileSaver/download.ts
50-
@@ -1,6 +1,5 @@
51-
import { WritableStream } from 'web-streams-polyfill';
52-
53-
-import { isIos, isSafari } from '@proton/shared/lib/helpers/browser';
54-
import { stripLeadingAndTrailingSlash } from '@proton/shared/lib/helpers/string';
55-
import { PUBLIC_PATH } from '@proton/shared/lib/webpack.constants';
56-
57-
@@ -15,17 +14,7 @@ let workerWakeupInterval: ReturnType<typeof setInterval>;
58-
* IOS - forces all browsers to use webkit, so same problems as safari in all browsers.
59-
* For them download is done in-memory using blob response.
60-
*/
61-
-export const isUnsupported = () => {
62-
- /* TODO: To be removed after test DRVWEB-4375 */
63-
- if (typeof window !== 'undefined') {
64-
- const isSWForSafariEnabled = 'isSWForSafariEnabled' in window && window.isSWForSafariEnabled;
65-
- if (isSWForSafariEnabled) {
66-
- return !('serviceWorker' in navigator);
67-
- }
68-
- }
69-
- // Original
70-
- return !('serviceWorker' in navigator) || isSafari() || isIos();
71-
-};
72-
+export const isUnsupported = () => !('serviceWorker' in navigator);
73-
80+
@@ -5,9 +5,11 @@ import type { TransferMeta } from '../../../components/TransferManager/transfer'
81+
82+
let workerWakeupInterval: ReturnType<typeof setInterval>;
83+
84+
+// <electron-mail-mark>
85+
export const isServiceWorkersUnsupported = () => {
86+
return !('serviceWorker' in navigator);
87+
};
88+
+// </electron-mail-mark>
89+
7490
// createDownloadIframe opens download URL created in service worker to
7591
// initialize the download in the browser. The response has headers to
76-
@@ -73,6 +62,7 @@ function serviceWorkerKeepAlive() {
92+
@@ -55,11 +57,12 @@ function serviceWorkerKeepAlive() {
7793
}, 10000);
7894
}
79-
80-
+/* <electron-mail-mark> */
95+
96+
+// <electron-mail-mark>
8197
export async function initDownloadSW() {
82-
if (isUnsupported()) {
83-
throw new Error('Saving file via download is unsupported by this browser');
84-
@@ -81,7 +71,7 @@ export async function initDownloadSW() {
85-
await navigator.serviceWorker
86-
.register(
87-
/* webpackChunkName: "downloadSW" */
88-
- new URL('./downloadSW', import.meta.url),
89-
+ new URL('./downloadSW', import.meta.url), // electron-mail-mark
90-
{
91-
scope: `/${stripLeadingAndTrailingSlash(PUBLIC_PATH)}`,
92-
}
93-
@@ -107,6 +97,7 @@ export async function initDownloadSW() {
94-
98+
// wait Service Worker is registered
99+
await navigator.serviceWorker.register(
100+
/* webpackChunkName: "downloadSW" */
101+
- new URL('./downloadSW', import.meta.url),
102+
+ new URL('./downloadSW', import.meta.url), // electron-mail-mark
103+
{
104+
scope: `/${stripLeadingAndTrailingSlash(PUBLIC_PATH)}`,
105+
}
106+
@@ -77,6 +80,7 @@ export async function initDownloadSW() {
107+
95108
serviceWorkerKeepAlive();
96109
}
97-
+/* </electron-mail-mark> */
98-
110+
+// </electron-mail-mark>
111+
112+
/**
113+
* Opens download stream into service worker. Use abort signal when pipeTo can't close the download stream.
114+
diff --git a/packages/drive-store/store/_downloads/fileSaver/download.ts b/packages/drive-store/store/_downloads/fileSaver/download.ts
115+
index 1db1b7ca29..a7e6e460fd 100644
116+
--- a/packages/drive-store/store/_downloads/fileSaver/download.ts
117+
+++ b/packages/drive-store/store/_downloads/fileSaver/download.ts
118+
@@ -5,9 +5,11 @@ import type { TransferMeta } from '../../../components/TransferManager/transfer'
119+
120+
let workerWakeupInterval: ReturnType<typeof setInterval>;
121+
122+
+// <electron-mail-mark>
123+
export const isServiceWorkersUnsupported = () => {
124+
return !('serviceWorker' in navigator);
125+
};
126+
+// </electron-mail-mark>
127+
128+
// createDownloadIframe opens download URL created in service worker to
129+
// initialize the download in the browser. The response has headers to
130+
@@ -55,11 +57,12 @@ function serviceWorkerKeepAlive() {
131+
}, 10000);
132+
}
133+
134+
+// <electron-mail-mark>
135+
export async function initDownloadSW() {
136+
// wait Service Worker is registered
137+
await navigator.serviceWorker.register(
138+
/* webpackChunkName: "downloadSW" */
139+
- new URL('./downloadSW', import.meta.url),
140+
+ new URL('./downloadSW', import.meta.url), // electron-mail-mark
141+
{
142+
scope: `/${stripLeadingAndTrailingSlash(PUBLIC_PATH)}`,
143+
}
144+
@@ -77,6 +80,7 @@ export async function initDownloadSW() {
145+
146+
serviceWorkerKeepAlive();
147+
}
148+
+// </electron-mail-mark>
149+
99150
/**
100151
* Opens download stream into service worker. Use abort signal when pipeTo can't close the download stream.
152+
--
101153

102154
diff --git a/applications/drive/src/app/store/_shares/shareUrl.ts b/applications/drive/src/app/store/_shares/shareUrl.ts
103155
index 1b76b8ea81..748ede869b 100644

0 commit comments

Comments
 (0)