-
-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modernize window.crypto access constants #4169
Conversation
I believe the Element Web build error is failed (or lack of) branch matching to the react-sdk. |
Sorry for the spam here. As is hopefully obvious from the commit history, I tried to use My vote is to give up for now and put a help wanted label on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really know why we're indirecting via window
in the first place. crypto
is defined as a global property - ie, it should be available via globalThis
in all environments.
I suspect it's because this code predates the existence of globalThis
, so used to say crypto = window.crypto
, which then got (incorrectly, imho) turned into crypto = globalThis.window.crypto
.
Likewise TextEncoder.
I don't really understand. If you're not going to keep working on the PR, could you close it please? |
I'm not sure I understand the action requested here. Should the crypto indirection be removed? As for closing the PR: I'm saying we give up on trying to get types to work, but the PR is required to work. I cannot commit to debugging the entire type system much further, so a help wanted issue feels like the correct approach. |
I'm suggesting that, rather than doing anything special for service workers, you change lines 19-21 to be:
... and be done.
oh right. Well, that was far from obvious from your comment :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though needs an update to the PR title.
For element-hq/element-web#27326
Checklist
public
/exported
symbols have accurate TSDoc documentation.