Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): refactor internals to reduce number of cycles #830

Merged
merged 2 commits into from
Sep 10, 2020
Merged

Commits on Sep 10, 2020

  1. fix(core): refactor internals to reduce number of cycles

    Most of the circular dependencies as reported by `madge` are now gone,
    both in the TS code as in the compiled JS. This should reduce weird
    circular dependency issues in some environments, like with webpack.
    
    Example of issues this should solve:
    `TypeError: Cannot read property 'getGlobalStorage' of undefined` due
    to `Utils` being undefined from inside `MetadataStorage`.
    
    Some general remarks:
    - do not import from barrel files (`index.ts`)
    - move types and interfaces to separate files
    - when we need some import for a type only, use interface to get around cycles
    - sometimes it was needed to fallback to `any` (e.g. with `EntityManager`)
    
    Still some cycles are there, but they should hopefully not matter (hard to
    get around them without doing breaking changes).
    B4nan committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    fd4e5fb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    064f490 View commit details
    Browse the repository at this point in the history