Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Fix ambiguous default export #113

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

brawaru
Copy link
Contributor

@brawaru brawaru commented Oct 22, 2023

Currently Omorphia's index file has both the default and named exports. While this is totally supported by native ESM, it's pretty hard for transpilers to process and may lead to situations where named exports cannot be imported directly, requiring destructuring on the default import. For this and just consistency reasons, you'd usually avoid mixing default and named exports.

This PR removes the default export, making it just an another named export called plugin.

BREAKING CHANGE: plugin is now exported using plugin export, rather than the default export.

@triphora
Copy link
Contributor

What's the reasoning behind this PR?

@brawaru
Copy link
Contributor Author

brawaru commented Nov 11, 2023

Updated the PR description to include reason for this change, will resolve the conflict later.

@Geometrically
Copy link
Member

merge conflict pls fix

Currently Omorphia's index file has both the default and named exports.
While this is totally supported by native ESM, it's pretty hard for
transpilers to process and may lead to situations where named exports
cannot be imported directly, requiring destructuring on the default
import. For this and just consistency reasons, you'd usually avoid
mixing default and named exports.

This commit removes the default export, making it just an another named
export called `plugin`.

BREAKING CHANGE: plugin is now exported using `plugin` export, rather
than the default export.
@brawaru
Copy link
Contributor Author

brawaru commented Nov 13, 2023

Rebased 👍🏻

@Geometrically Geometrically merged commit 5051ad9 into modrinth:master Nov 13, 2023
1 check passed
@brawaru brawaru deleted the fix/bad-default-export-bad branch November 20, 2023 22:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

3 participants