Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit ff048b0

Browse files
author
Dariusz Niemczyk
committed
Merge remote-tracking branch 'origin/develop' into palid/fix/layers-overwhelming
* origin/develop: Fix import breaking types in release mode Fix resizer for detaching Add CI script to switch the js-sdk into 'release mode'
2 parents a62717e + dbc69fb commit ff048b0

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

scripts/ci/js-sdk-to-release.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
3+
# This changes the js-sdk into 'release mode', that is:
4+
# * The entry point for the library is the babel-compiled lib/index.js rather than src/index.ts
5+
# * There's a 'typings' entry referencing the types output by tsc
6+
# We do this so we can test that each PR still builds / type checks correctly when built
7+
# against the released js-sdk, because if you do things like `import { User } from 'matrix-js-sdk';`
8+
# rather than `import { User } from 'matrix-js-sdk/src/models/user';` it will work fine with the
9+
# js-sdk in development mode but then break at release time.
10+
# We can't use the last release of the js-sdk though: it might not be up to date enough.
11+
12+
cd node_modules/matrix-js-sdk
13+
for i in main typings
14+
do
15+
lib_value=$(jq -r ".matrix_lib_$i" package.json)
16+
if [ "$lib_value" != "null" ]; then
17+
jq ".$i = .matrix_lib_$i" package.json > package.json.new && mv package.json.new package.json
18+
fi
19+
done
20+
yarn run build:compile
21+
yarn run build:types

src/resizer/resizer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export default class Resizer<C extends IConfig = IConfig> {
8484
}
8585

8686
public detach() {
87-
const attachment = this?.config?.handler.parentElement ?? this.container;
87+
const attachment = this?.config?.handler?.parentElement ?? this.container;
8888
attachment.removeEventListener("mousedown", this.onMouseDown, false);
8989
window.removeEventListener("resize", this.onResize);
9090
}

src/sentry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import PlatformPeg from "./PlatformPeg";
1919
import SdkConfig from "./SdkConfig";
2020
import { MatrixClientPeg } from "./MatrixClientPeg";
2121
import SettingsStore from "./settings/SettingsStore";
22-
import { MatrixClient } from "matrix-js-sdk";
22+
import { MatrixClient } from "matrix-js-sdk/src/client";
2323

2424
/* eslint-disable camelcase */
2525

0 commit comments

Comments
 (0)