Skip to content
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

Fix the rust crypto import in esm environments. #4445

Merged
merged 4 commits into from
Oct 8, 2024

Conversation

saul-jb
Copy link
Contributor

@saul-jb saul-jb commented Oct 8, 2024

Rust crypto is broken in ESM environments like nodejs and webpack, this PR simply uses babel to rewrite the import to fix it.

Fixes #4392

See also:

Signed-off-by: Saul Boyd saul@organicdesign.co.nz

@saul-jb saul-jb requested review from a team as code owners October 8, 2024 03:03
@saul-jb saul-jb requested review from langleyd and dbkr October 8, 2024 03:03
@github-actions github-actions bot added the Z-Community-PR Issue is solved by a community member's PR label Oct 8, 2024
babel.config.cjs Outdated Show resolved Hide resolved
babel.config.cjs Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
@dbkr dbkr requested review from a team, andybalaam and uhoreg October 8, 2024 08:30
@dbkr
Copy link
Member

dbkr commented Oct 8, 2024

Requested review from crypto too in case they have any input (although I suspect it's mostly a js-level issue)

@saul-jb
Copy link
Contributor Author

saul-jb commented Oct 8, 2024

I've just updated it to use the full path with the .ts extension and removed the eslint exception, since we are replacing it anyway. The 'blocked' comment has been removed in favor of having the documentation in the babel config.

@andybalaam andybalaam removed their request for review October 8, 2024 10:15
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@saul-jb please could you add a sign-off to your PR, per https://github.com/element-hq/element-web/blob/develop/CONTRIBUTING.md#sign-off

@richvdh
Copy link
Member

richvdh commented Oct 8, 2024

(Also: many thanks for doing battle with typescript, babel, jest and nodejs to fix this!)

@richvdh richvdh enabled auto-merge October 8, 2024 10:31
@MidhunSureshR MidhunSureshR self-requested a review October 8, 2024 10:33
@richvdh richvdh added this pull request to the merge queue Oct 8, 2024
Merged via the queue into matrix-org:develop with commit 860161b Oct 8, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't resolve './rust-crypto' in '<project dir>/node_modules/matrix-js-sdk/lib' with webpack
5 participants