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

remove hardcoded require #117

Merged
merged 1 commit into from
Jul 2, 2024
Merged

remove hardcoded require #117

merged 1 commit into from
Jul 2, 2024

Conversation

tsnobip
Copy link
Contributor

@tsnobip tsnobip commented Jun 7, 2024

The hardcoded require would sometimes not play well with bundling and the esmodule mode of rescript.

When using esmodule mode, it should now generate an import instead of a require:

import * as React from "react";

@tsnobip tsnobip requested a review from mununki June 7, 2024 14:28
@mununki
Copy link
Member

mununki commented Jun 9, 2024

Good catch! I'm just looking for any other way to avoid the removing the unused value by the compiler's optimization without making an unnecessary applying.

mununki
mununki previously approved these changes Jul 2, 2024
Copy link
Member

@mununki mununki left a comment

Choose a reason for hiding this comment

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

Unfortunately, I haven't found a way to avoid creating unnecessary values with a compiler feature. Sorry for the delayed review.

@tsnobip
Copy link
Contributor Author

tsnobip commented Jul 2, 2024

I tried many things too but couldn't come up with a better solution either!

@tsnobip
Copy link
Contributor Author

tsnobip commented Jul 2, 2024

@mununki sorry I forgot to update the changelog, can you approve the PR again?

@tsnobip tsnobip merged commit 1b852bc into master Jul 2, 2024
1 check passed
@cknitt cknitt deleted the fix_require branch July 23, 2024 15:51
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