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

Remove core circular dependencies #140

Merged
merged 2 commits into from
Oct 22, 2024
Merged

Conversation

MonicaOlejniczak
Copy link
Contributor

Motivation

There are multiple circular dependencies to @atlaspack/core that have existed for sometime and prevent us from utilising TypeScript references.

graph LR;
    core --> cache --> core;
    core --> fs --> core;
    fs --> workers;
    workers --> core;
    package_manager --> core --> package_manager;
Loading

Changes

  • Add @atlaspack/build-cache package to form a new leaf package instead of @atlaspack/core
  • Move the build cache, serialisation and deserialisation functions to this new package and rename appropriate references
  • Replace @atlaspack/core peer dependency with a regular @atlaspack/build-cache dependency, as this reduces complexity during the installation process and products will resolve to a single copy of atlaspack anyway
  • Remove process.browser handling from the worker to remove the circular dependency. This is only used in repl and theoretically should work (or be made to work), but unfortunately repl is currently an extremely broken state and needs several changes to repair it.
  • Fix some broken repl references

The new dependency graph for the relevant sections is now as follows.

graph LR;
    core --> cache --> build_cache;
    core --> build_cache;
    core --> package_manager;
    core --> fs --> build_cache;
    fs --> workers;
    package_manager --> build_cache;
    workers --> build_cache;
Loading

Checklist

  • Existing or new tests cover this change

@MonicaOlejniczak MonicaOlejniczak requested a review from a team October 21, 2024 06:43
@alshdavid
Copy link
Contributor

Amazing work 👏

@MonicaOlejniczak MonicaOlejniczak merged commit a750fb2 into main Oct 22, 2024
17 checks passed
@MonicaOlejniczak MonicaOlejniczak deleted the monica/circular-deps branch October 22, 2024 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants