Skip to content

remove hardcoded require#117

Merged
tsnobip merged 1 commit into
masterfrom
fix_require
Jul 2, 2024
Merged

remove hardcoded require#117
tsnobip merged 1 commit into
masterfrom
fix_require

Conversation

@tsnobip

@tsnobip tsnobip commented Jun 7, 2024

Copy link
Copy Markdown
Member

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

mununki commented Jun 9, 2024

Copy link
Copy Markdown
Member

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

@mununki mununki left a comment

Copy link
Copy Markdown
Member

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

tsnobip commented Jul 2, 2024

Copy link
Copy Markdown
Member Author

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

@tsnobip

tsnobip commented Jul 2, 2024

Copy link
Copy Markdown
Member Author

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

@tsnobip tsnobip merged commit 1b852bc into master Jul 2, 2024
@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