Skip to content

chore: remove file extension from the errors export#1236

Closed
RangerMauve wants to merge 1 commit intomainfrom
chore/clean-errors-export
Closed

chore: remove file extension from the errors export#1236
RangerMauve wants to merge 1 commit intomainfrom
chore/clean-errors-export

Conversation

@RangerMauve
Copy link
Contributor

Should be a bit cleaner and more standard

e.g.

import { SomeError } from `@comapeo/core/errors`

instead of

import { SomeError } from `@comapeo/core/errors.js`

@RangerMauve RangerMauve requested a review from achou11 March 5, 2026 21:17
@RangerMauve RangerMauve self-assigned this Mar 5, 2026
Copy link
Member

@achou11 achou11 left a comment

Choose a reason for hiding this comment

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

Personally I prefer having the file extension included and it seems like we do that for some of our other more recently worked-on modules.

Also worth noting that there can be a technical benefit to including the file extension (at least in Node): https://nodejs.org/api/packages.html#extensions-in-subpaths

With import maps now providing a standard for package resolution in browsers and other JavaScript runtimes, using the extensionless style can result in bloated import map definitions. Explicit file extensions can avoid this issue by enabling the import map to utilize a packages folder mapping to map multiple subpaths where possible instead of a separate map entry per package subpath export. This also mirrors the requirement of using the full specifier path in relative and absolute import specifiers.

@RangerMauve
Copy link
Contributor Author

Fair enough!

@RangerMauve RangerMauve closed this Mar 9, 2026
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