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

Decommission the monorepo #5292

Merged
merged 35 commits into from
Sep 12, 2019
Merged

Decommission the monorepo #5292

merged 35 commits into from
Sep 12, 2019

Conversation

hwillson
Copy link
Member

@hwillson hwillson commented Sep 9, 2019

This PR represents a first pass at removing Apollo Client's monorepo structure. For Apollo Client 3.0 we're moving away from using lerna and a monorepo based structure / deployment approach, to reduce complexity, better integrate project internals, and pave the way to better leverage modern build tooling capabilities.

This PR should be seen as a starting point for the new structure, not the endpoint. There are still a lot of adjustments to make, but it would be great to get these structural changes in place first to serve as a basis for subsequent PR's.

Key changes in this PR:

  • Apollo Client is now published as @apollo/client
  • All packages have been removed, with their contents moved alongside the rest of the Apollo Client core
  • Apollo Client source has been moved to src
  • The building/bundling infrastructure has been updated to work without lerna
  • All dependencies and config elements that are no longer used (lerna, danger, prettier, TS project references, flow, etc.) have been removed
  • All dependencies have been updated (and tested)

Important notes:

  • The file and directory layouts put in place by this PR are most likely temporary. For example, the apollo-cache and apollo-cache-inmemory packages have been moved into src/cache/core and src/cache/inmemory respectively, but these locations can be considered temporary. There are many cache changes coming for AC 3 that will likely require re-adjusting this structure.
  • apollo-utilities was moved into src/utilities. We already have a src/utils directory, so this duplication seems odd. I've left things like this for now, as we're going to be re-visiting all of the utilities included with Apollo Client, to decide what stays in place, and what gets moved into @apollo/graphql.

The changes in this PR (and everything in release-3.0) have been published as @apollo/client@alpha.

We'll be handling this differently with Apollo Client 3.0.
This was originally created to help promote contributions from
people working for oranizations that required author names to
be included with contributions. We haven't received any
requests for this kind of user contribution tracking in quite
some time, so let's assume it is no longer needed.
The `refactoring` folder is temporary and holds all config and
other support related files from each child package, that won't
be part of the new no monorepo approach, but we still neeed for
reference during refactoring.
These new locations will more than likely be temporary. They're
being moved to get them out of their separate package locations,
so those packages can be de-commissioned.
Full removal of the monorepo child packages structure.
This commit fixes all imports paths that were broken after
merging the monorepo packages togther. It then wires up a new and
fully functional single package.json for the entire project, which
replaces the package.json's that were in the monorepo packages.
All package.json scripts included are functional, which means
tests are passing and bundles are being built.

Note: `npm run deploy` has intentionally been left out for now
since our deployment process is going to change quite
significantly.
Not really needed and is interfering with `npm install`'s of
Apollo Client into applications.
Looks a little better when the bundle is referred to in
stacktraces.
Everyhing we need (for now) has been moved elsewhere.
@hwillson hwillson self-assigned this Sep 9, 2019
package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@jbaxleyiii jbaxleyiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hwillson I really appreciate the commit by commit grouping that you did here, it made the review quite easy. This looks great to me and I think we should land it asap so @benjamn and @JakeDawkins can begin working on top of it

@wmertens
Copy link
Contributor

As an interested bystander, what are some of the reasons for this move? It seems to me that tight coupling between package changes will still be desireable?

This reverts my previous PR #4538, now that
siddharthkp/bundlesize#260 has been merged and
published to npm.
Copy link
Member

@benjamn benjamn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is a huge testament to your code wrangling skills @hwillson, and also to the value of TypeScript, without which it would be so much harder to know that everything still works as it did before. Thanks for splitting everything up so cleanly!

I have one important change to request (see below), but I can push that one-line commit myself.

packages/apollo-cache-inmemory/CHANGELOG.md Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
config/prettierignore Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
This saves 1.1KB of minified+gzip code, and I believe it aligns with our
goals of consolidating the parts of apollo-utilities that we actually use
into the combined @apollo/client package.

More explanation in this comment:
#5292 (comment)
@benjamn benjamn added this to the Release 3.0 milestone Sep 11, 2019
@hwillson hwillson merged commit 95060d4 into release-3.0 Sep 12, 2019
@hwillson hwillson deleted the goodbye-lerna branch September 12, 2019 00:12
StephenBarlow pushed a commit that referenced this pull request Oct 1, 2019
This saves 1.1KB of minified+gzip code, and I believe it aligns with our
goals of consolidating the parts of apollo-utilities that we actually use
into the combined @apollo/client package.

More explanation in this comment:
#5292 (comment)
@benjamn benjamn mentioned this pull request Jan 7, 2020
31 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants