Skip to content

Barrel exports on appropirate directories #49

Description

@prescience-data

This is a pattern I've found extremely nice to use compared to explicitly importing n nested functions/variables.

https://github.com/bencoveney/barrelsby

With a Vue project, the unplugin-vue-components Vite plugin performs a similar function for components, but I've found working with Vulk and Vuero that for the TypeScript imports there tends to be a huge stack of imports for even fairly simple scenarios.

The one directory where I've found it does not make sense to implement is the stores directory. Often stores will reference each other and due to how some (WebStorm) optimises imports, it will always attempt to use the shortest path. When using the /@src/ stub this can accidentally create circular dependencies that stores are particularly affected by.

Just a suggestion, so of course just close if explicit imports are a deliberate design decision.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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