Skip to content

Replace matrix-js-sdk's MatrixEvent with our own representation - #34

Merged
Half-Shot merged 7 commits into
mainfrom
hs/modules-matrix-event
Jun 17, 2025
Merged

Half-Shot merged 7 commits into
mainfrom
hs/modules-matrix-event

Conversation

@Half-Shot

@Half-Shot Half-Shot commented Jun 17, 2025 •

Copy link
Copy Markdown
Member

Fixes the flaw in element-hq/element-web#30074 whereby due to differing imports of the matrix-js-sdk, it's not possible to (safely) pass the type from Element Web to a module. In line with us thinking about the future with Rust SDKs, this changes the module API to use it's own SDK neutral interface.

This is a backwards incompatible change. We are marking the Custom Message Components API as alpha stability due to the potential for further changes, and will adjust in the future.

Companion commit is element-hq/element-web@66e7381

@Half-Shot
Half-Shot requested a review from a team as a code owner June 17, 2025 12:36
@Half-Shot
Half-Shot requested review from MidhunSureshR and dbkr June 17, 2025 12:36
@Half-Shot
Half-Shot requested review from t3chguy and removed request for MidhunSureshR and dbkr June 17, 2025 12:38
@Half-Shot

Copy link
Copy Markdown
Member Author

(assigning @t3chguy as I think it's probably better to reduce context switching this one)

@t3chguy

t3chguy commented Jun 17, 2025

Copy link
Copy Markdown
Member

Might be worth consulting semver definitions for whether this needs to be a major version bump due to the breaking change

@Half-Shot

Half-Shot commented Jun 17, 2025 •

Copy link
Copy Markdown
Member Author

Based on https://semver.org/, it would be a major since this is backwards incompatible. We're removing a lot of properties, and even the ones that remain are effectively renamed (getId() -> eventId). That's fine, I'll do a 2.0.

@t3chguy

t3chguy commented Jun 17, 2025 •

Copy link
Copy Markdown
Member

Keep in mind that doing so will break all existing modules when being used with an updated Element Web, this is why we need to more careful. Is there anything in semver which says we can avoid this due to it being beta? I guess not because of the warning

// Warning: (ae-incompatible-release-tags) The symbol "registerMessageRenderer" is marked as @public, but its signature references "MatrixEvent" which is marked as @beta

So the API method was public

Comment thread packages/element-web-module-api/element-web-module-api.api.md Outdated
@Half-Shot
Half-Shot force-pushed the hs/modules-matrix-event branch from ef26071 to fc7fe00 Compare June 17, 2025 13:07
@Half-Shot
Half-Shot merged commit 43dce5e into main Jun 17, 2025
@Half-Shot
Half-Shot deleted the hs/modules-matrix-event branch June 17, 2025 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants