Skip to content

Commit 1b06f08

Browse files
authored
Merge pull request #1524 from session-foundation/feat/animated_profile_pictures
feat: animated profile pictures
2 parents e73c363 + f5d71d4 commit 1b06f08

File tree

99 files changed

+2927
-1442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2927
-1442
lines changed

.eslintignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ ts/localization/locales.ts
2020

2121
about_preload.js
2222
commitlint.config.js
23-
libsession.worker.config.js
2423
password_preload.js
2524
sass.config.js
26-
utils.worker.config.js
25+
*.worker.config.js
26+
27+
# Not too sure why we can't have eslint on those files atm
28+
ts/webworker/workers/node/util/util.worker.ts
29+
ts/webworker/workers/node/libsession/libsession.worker.ts
30+
ts/webworker/workers/node/image_processor/image_processor.worker.ts

.github/workflows/build-binaries.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ jobs:
150150
artifacts: 'dist/latest-linux.yml'
151151
allowUpdates: true
152152
omitNameDuringUpdate: true
153+
omitBodyDuringUpdate: true
153154
replacesArtifacts: true
154155
updateOnlyUnreleased: true
155156

@@ -294,8 +295,9 @@ jobs:
294295
uses: ncipollo/release-action@v1
295296
with:
296297
tag: v${{ steps.get_version.outputs.VERSION_TAG }}
298+
name: 'Session ${{ steps.get_version.outputs.VERSION_TAG }}'
297299
draft: true
298-
name: 'Draft'
300+
bodyFile: ${{ env.SHOULD_PUBLISH_ALPHA == 'true' && 'build/release-notes-alpha.md' || 'build/release-notes.md' }}
299301
artifacts: 'dist/latest-mac.yml'
300302
allowUpdates: true
301303
omitBodyDuringUpdate: true

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ git clone https://github.com/session-foundation/session-desktop.git
257257
cd session-desktop
258258
npm install --global yarn # (only if you don’t already have `yarn`)
259259
yarn install --frozen-lockfile # Install and build dependencies (this will take a while)
260-
yarn build-everything
260+
yarn build
261261
yarn test # A good idea to make sure tests run first
262262
yarn start-prod # Start Session!
263263
```
@@ -312,12 +312,12 @@ You can keep the developer tools open (`View > Toggle Developer Tools`) and pres
312312
# `yarn build:workers` to fix the "exports undefined" error on start.
313313

314314
# Terminal A
315-
yarn build-everything:watch # this process will keep running until you stop it
315+
yarn watch # this process will keep running until you stop it
316316

317317
# Terminal B
318318
yarn build:workers
319319

320-
# If you change any SASS files while running "yarn build-everything:watch" it won't be detected.
320+
# If you change any SASS files while running "yarn watch" it won't be detected.
321321
# You will need to run the sass build command.
322322

323323
# Terminal B
@@ -429,7 +429,7 @@ see how they did things.
429429
You can build a production binary by running the following:
430430

431431
```sh
432-
yarn build-everything
432+
yarn build
433433
yarn build-release
434434
```
435435

INTERNALBUILDS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Once your development environment is set up, here are the steps to build the app
8787
8888
```sh
8989
yarn install --frozen-lockfile # install all dependencies of this project
90-
yarn build-everything # transpile and assemble files
90+
yarn build # transpile and assemble files
9191
yarn build-release
9292
```
9393

actions/setup_and_build/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ runs:
4646

4747
- name: Generate and concat files
4848
shell: bash
49-
run: yarn build-everything
49+
run: yarn build

image_processor.worker.config.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// eslint-disable-next-line @typescript-eslint/no-var-requires
2+
const path = require('path');
3+
4+
module.exports = {
5+
entry: './ts/webworker/workers/node/image_processor/image_processor.worker.ts',
6+
module: {
7+
rules: [
8+
{
9+
test: /\.tsx?$/,
10+
use: 'ts-loader',
11+
exclude: /node_modules/,
12+
},
13+
],
14+
},
15+
resolve: {
16+
extensions: ['.ts', '.js'],
17+
fallback: {
18+
crypto: false,
19+
path: false,
20+
fs: false,
21+
stream: false,
22+
},
23+
},
24+
output: {
25+
filename: 'image_processor.worker.compiled.js',
26+
path: path.resolve(__dirname, 'ts', 'webworker', 'workers', 'node', 'image_processor'),
27+
},
28+
target: 'node',
29+
externals: {
30+
sharp: 'commonjs sharp',
31+
},
32+
optimization: {
33+
minimize: process.env.NODE_ENV === 'production',
34+
},
35+
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
36+
watch: false, // false by default but can be overridden by the command line
37+
watchOptions: {
38+
aggregateTimeout: 200,
39+
poll: 1000,
40+
},
41+
};
287 KB
Loading
462 KB
Loading

libsession.worker.config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ module.exports = {
3636
},
3737
target: 'node',
3838
optimization: {
39-
minimize: isProd,
39+
minimize: process.env.NODE_ENV === 'production',
40+
},
41+
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
42+
watch: false, // false by default but can be overridden by the command line
43+
watchOptions: {
44+
aggregateTimeout: 200,
45+
poll: 1000,
4046
},
4147
};

package.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,11 @@
2424
"start-prod": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod$MULTI electron .",
2525
"start-prod:pretty": "yarn start-prod | npx pino-pretty",
2626
"start-dev": "cross-env NODE_ENV=development NODE_APP_INSTANCE=devprod$MULTI electron .",
27-
"build-everything": "yarn print-deps && yarn clean && yarn protobuf && yarn update-git-info && yarn sass && yarn build:locales-soft && tsc && yarn build:workers",
28-
"build-everything:soft": "yarn print-deps && yarn clean && yarn protobuf && yarn update-git-info && yarn sass && yarn build:locales-soft && tsc && yarn build:workers",
29-
"build-everything:watch": "yarn clean && yarn protobuf && yarn update-git-info && yarn sass && yarn build:locales-soft && yarn build:workers && yarn tsc -w",
27+
"build": "yarn print-deps && yarn clean && yarn protobuf && yarn update-git-info && yarn sass && yarn build:locales-soft && tsc && yarn build:workers",
3028
"start-dev:pretty": "yarn start-dev | npx pino-pretty",
31-
"build:workers": "yarn worker:utils && yarn worker:libsession",
29+
"build:workers": "yarn worker:utils && yarn worker:libsession && yarn worker:image_processor",
3230
"build:locales": "python3 ./tools/localization/generateLocales.py --generate-types --print-problems --error-on-problems --error-old-dynamic-variables",
3331
"build:locales-soft": "python3 ./tools/localization/generateLocales.py --generate-types --print-problems --print-problem-strings",
34-
"watch": "yarn clean && yarn protobuf && yarn update-git-info && yarn build-everything:watch",
3532
"protobuf": "pbjs --target static-module --wrap commonjs --out ts/protobuf/compiled.js protos/*.proto && pbts --out ts/protobuf/compiled.d.ts ts/protobuf/compiled.js --force-long",
3633
"sass": "rimraf --glob 'stylesheets/dist/' && webpack --config=./sass.config.js",
3734
"clean": "rimraf --glob 'ts/**/*.js' 'ts/*.js' 'ts/*.js.map' 'ts/**/*.js.map tsconfig.tsbuildinfo'",
@@ -47,9 +44,12 @@
4744
"update-git-info": "node ./build/updateLocalConfig.js",
4845
"worker:utils": "webpack --config=./utils.worker.config.js",
4946
"worker:libsession": "rimraf --glob 'ts/webworker/workers/node/libsession/*.node' && webpack --config=./libsession.worker.config.js",
47+
"worker:image_processor": "webpack --config=./image_processor.worker.config.js",
5048
"dedup": "npx --yes yarn-deduplicate yarn.lock",
5149
"prepare": "husky",
52-
"print-deps": "node -v && python3 --version"
50+
"print-deps": "node -v && python3 --version",
51+
"watch": "yarn clean && yarn update-git-info && concurrently -n PBJS,SASS,LOCALES,UTIL,LIBSESSION,IMAGE,TS -c yellow,green,red,blue,blue,blue,green \"yarn protobuf\" \"yarn sass --watch\" \"yarn build:locales-soft\" \"yarn worker:utils --watch\" \"yarn worker:libsession --watch\" \"yarn worker:image_processor --watch\" \"yarn tsc --watch\""
52+
5353
},
5454
"dependencies": {
5555
"@emoji-mart/data": "^1.2.1",
@@ -60,7 +60,6 @@
6060
"abort-controller": "3.0.0",
6161
"auto-bind": "^4.0.0",
6262
"blob-util": "2.0.2",
63-
"blueimp-load-image": "^5.16.0",
6463
"buffer-crc32": "1.0.0",
6564
"bytebuffer": "^5.0.1",
6665
"clsx": "^2.1.1",
@@ -113,6 +112,7 @@
113112
"rimraf": "6.0.1",
114113
"sanitize.css": "^12.0.1",
115114
"semver": "^7.7.1",
115+
"sharp": "^0.34.3",
116116
"styled-components": "^6.1.15",
117117
"uuid": "11.1.0",
118118
"viem": "^2.26.0",
@@ -125,7 +125,6 @@
125125
"@testing-library/jest-dom": "^6.4.6",
126126
"@testing-library/react": "^15.0.7",
127127
"@testing-library/user-event": "^14.6.1",
128-
"@types/blueimp-load-image": "^5.16.6",
129128
"@types/buffer-crc32": "^0.2.4",
130129
"@types/bytebuffer": "^5.0.49",
131130
"@types/chai": "4.3.20",
@@ -155,6 +154,7 @@
155154
"chai": "^4.5.0",
156155
"chai-as-promised": "^7.1.2",
157156
"chai-bytes": "^0.1.2",
157+
"concurrently": "^9.2.0",
158158
"cross-env": "^7.0.3",
159159
"css-loader": "^7.1.2",
160160
"electron": "34.2.0",
@@ -253,7 +253,9 @@
253253
"node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node",
254254
"node_modules/libsession_util_nodejs/build/Release/libsession_util_nodejs.node",
255255
"ts/webworker/workers/node/libsession/*.node",
256-
"ts/mains/main_node.js"
256+
"ts/mains/main_node.js",
257+
"**/node_modules/sharp/**/*",
258+
"**/node_modules/@img/**/*"
257259
],
258260
"deb": {
259261
"depends": [

0 commit comments

Comments
 (0)