Skip to content

Default exports per folder #34

Description

@mdroidian

What was the reasoning behind throwing an error in queries/index.ts and components/index.ts?

throw new Error(
`Do not import from roamjs-components/queries directly. Instead import the *query* you need directly. For example:
import getTextByBlockUid from "roamjs-components/queries/getTextByBlockUid;"`
);

vs

export * from "./constants";
export { default as addBlockCommand } from "./addBlockCommand";
export { default as addOldRoamJSDependency } from "./addOldRoamJSDependency";
export { default as addRoamJSDependency } from "./addRoamJSDependency";
export { default as addScriptAsDependency } from "./addScriptAsDependency";

export { default as parseNlpDate } from "./parseNlpDate";
export { default as parseRoamDateUid } from "./parseRoamDateUid";
export * from "./constants";

Bundle size? or something else?

Going forward, should the following be kept up to date with the default exports?

dom/index.ts
date/index.ts
util/index.ts
writes/index.ts

While queries/index.ts and components/index.ts remain as granular imports?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions