Skip to content

Use named exports for all packages with a default export #1951

@marcalexiei

Description

@marcalexiei

Follow up to Default exports vs named ones Discord thread

We should move into using named exports across the whole codebase.

To avoid breaking consumers, we’ll keep the existing default exports for now but mark them as deprecated.
These default exports will be removed in the next major release (v4).

Note

CJS compatibility should not be a problem as changeless is a cli tool and usually is not bundled

Adding ESM module log from a require() call for reference:

export { foo } -> logs { foo: [Function: foo] }
export default foo -> logs { __esModule: true, default: [Function: foo] }
export { foo }; export default foo -> logs { __esModule: true, default: [Function: foo], foo: [Function: foo] }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions