Skip to content

Reduce the number of packages #154

@NullVoxPopuli

Description

@NullVoxPopuli

There are a lot of core packages right now.

We don't want users to have to know what to install, so we've talked about bundling them all in to one published package that users would install.

It is useful to have separate boundaries for conceptual reasons, and hard package boundaries enforce that -- at the cost of build complexity.

Perhaps we can combine all the core packages (leaving out renderers, collections), and keep boundary enforcement via this lint: https://eslint.org/docs/latest/rules/no-restricted-imports

example:

given:

@starbeam/core: 
  src/
    core/
    core-utils/ # does this need to be separate? (move to utils?)
    debug/ 
    reactive-core/
    resource/
    runtime/ 
    lifetime/
    interfaces/ # would probably no longer need to exist, interfaces can be inlined where needed

@starbeam/renderer:
  unchanged

this would greatly improve our dead-code-elimination as well.
#149

an example of configuring the lint rule:

{
  files: ['**/debug'],
  rules: {
    "no-restricted-imports": ["error", {
        "patterns": ["../*"] # no parent imports at all
    }]
  }

This would mean in order to import from other folders, we'd want to use subpath imports, described here: https://nodejs.org/api/packages.html#subpath-imports (an ESM / type=module only feature)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions