1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-04-19 18:02:16 +03:00

30 Commits

Author SHA1 Message Date
Johannes Marbach
6f7c74f9ea
Add syntax & type check for Node.js example on CI (#4410)
* Add syntax & type check for Node.js example on CI

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>

* Fix quotes

---------

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
Co-authored-by: Florian Duros <florianduros@element.io>
2025-01-03 18:49:57 +00:00
Johannes Marbach
c8403f39aa
Fix build failure in node.js example (#4394)
* Fix node.js example

Relates to: element-hq/element-web#26922
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>

* Update examples/node/app.js

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Update examples/node/package.json

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Move imports to the top of the file

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2024-09-13 15:35:45 +00:00
Richard van der Hoff
d90292bff5
Use prebuilt js-sdk for node example (#4286)
This example seems to have been broken by the switch to Typescript. We can't
just symlink in `../..` because that gives us the typescript version of the
source, which, obviously, doesn't work in node.

Instead, make sure we use a prebuilt version of the js-sdk.

It's actually even more broken as of js-sdk 33.0.0, thanks to the switch to ES
modules (#4187), but we'll get to that later.
2024-06-27 16:58:26 +00:00
Andy Balaam
92342c07ed
Introduce Membership TS type (take 2) (#4107)
* Introduce Membership TS type

* Adapt the Membership TS type to be an enum

* Add docstrings for KnownMembership and Membership

* Move Membership types into a separate file, exported from types.ts

---------

Co-authored-by: Stanislav Demydiuk <s.demydiuk@gmail.com>
2024-03-18 12:47:23 +00:00
Michael Weimann
349c2c2587
Apply prettier formatting 2022-12-09 09:38:20 +01:00
CommanderRoot
cde935629d
Replace deprecated String.prototype.substr() (#2298)
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
2022-04-14 15:23:27 -06:00
Travis Ralston
1c9dbbbb19 [BREAKING] Convert RoomState's stored state map to a real map
Though the dictionary format works fine, it's slow. Access times are around the 1ms range for rooms like HQ, which doesn't seem like much, but when compared to the Map's access time of 0.05ms it's slow.

Converting things to a map means we lose index access and have to instead use `.keys()` and `.values()`, both of which return iterables and not arrays. Even doing the `Array.from()` conversion we see times in the 0.05ms range. This is also what makes this a breaking change.

Memory-wise there does not appear to be any measurable impact for a large account.
2020-07-08 22:28:14 -06:00
Travis Ralston
f952f6742f Remove ancient "use strict" annotations
We don't need these anymore. Theoretically this commit could go to develop, but for safety it's going to `travis/sourcemaps` first.
2019-12-17 15:43:02 -07:00
Michael Telatynski
4a47867e49 Down to two test failures 2019-12-04 19:17:58 +00:00
Bruno Windels
f55a2079bf replace getMember(myId).membership with getMyMembership
This works with rooms which haven't had their members
loaded yet.
2018-08-15 12:00:38 +02:00
Frédéric Wang
a5f0ec7c7d Fix examples. 2016-11-12 17:39:48 +01:00
David Baker
34086f48fa Separate impl for node and extend example node app to use it. 2015-07-08 16:13:10 +01:00
Kegan Dougal
62d7ff5ba9 Add colours to terminal. Sort room list by TS. 2015-06-23 17:46:52 +01:00
Kegan Dougal
07d3f43d8b Refactor terminal app; add /invite and /roominfo. 2015-06-23 15:22:57 +01:00
Kegan Dougal
57914969b8 Add MatrixClient.resendEvent to manually resend an event that was not sent.
Bundle txnId as MatrixEvent._txnId instead of exposing it to every place that
happens to need it (since it's so tightly coupled with MatrixEvent)
2015-06-23 14:08:02 +01:00
Kegan Dougal
7534f59af2 Hook up the callback fn for scrollback. Update CHANGELOG. 2015-06-23 12:04:43 +01:00
Kegan Dougal
553325d66f Improve UX on node terminal app.
Add auto-complete, history and a prompt prefix.
2015-06-23 11:50:17 +01:00
Kegan Dougal
6737388766 Implement pagination via the scrollback() function. Update CHANGELOG. 2015-06-23 11:36:30 +01:00
Kegan Dougal
ef77c6f989 Sync room state when another device joins a room. 2015-06-23 10:18:13 +01:00
Kegan Dougal
bc0e2ad504 Sync room state when joining via client.joinRoom
Does not currently sync state when another device joins.
Update node example app to refresh room list.
2015-06-22 17:50:49 +01:00
Kegan Dougal
d151ac49f2 Mark events which fail to send. 2015-06-18 09:32:04 +01:00
Kegan Dougal
8e6eb35dfe Implement local echo.
Mark events being sent via the status property. Update CHANGELOG.
2015-06-17 17:42:12 +01:00
Kegsay
3dc6bf3647 Update README with example output 2015-06-12 16:33:04 +01:00
Kegan Dougal
7a96637a1b Example app: Print timestamps and all state events. 2015-06-12 16:26:44 +01:00
Kegan Dougal
71dacb14b1 Add MatrixEvent.sender and .target to pull the right name per message. 2015-06-12 11:05:57 +01:00
Kegan Dougal
da7b31cb7e Add Room.getJoinedMembers helper. UX tweaks to example. 2015-06-12 10:49:13 +01:00
Kegan Dougal
8c5c7cc961 Make examples/node/app an actual app rather than the usage example. 2015-06-12 10:33:45 +01:00
Kegan Dougal
da531a95b8 Also remove request dep on examples/node, since the 'matrix-js-sdk' import automatically pulls in the 'request' module. 2015-06-03 16:25:19 +01:00
Kegan Dougal
9b4ba0afe8 Redo build process for browsers and node. Update examples.
We now rely on browserify for building browser-specific versions of the JS
SDK. This can be initiated by running 'npm run build-js'. Node versions are
unaffected.
2015-06-03 15:51:48 +01:00
Kegan Dougal
39fed87bb4 Add examples to show it working in node and browser 2015-03-04 17:24:20 +00:00