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

Finch v2 #205

Merged
merged 35 commits into from
Sep 26, 2021
Merged

Finch v2 #205

merged 35 commits into from
Sep 26, 2021

Conversation

jcblw
Copy link
Contributor

@jcblw jcblw commented Sep 12, 2021

Description

This PR outlines Finch v2, which revamps Finch to allow for things to be split up into smaller modules. This will allow us to have more focused modules, and remove extra dependencies not needed in different areas. For instance, on a website using Finch, you will not need to have the graphql-middleware modules, and if your extension that does not use react you should not need to install it to use Finch.

This is going to change the API of Finch a little, but enough to the point where I think it is useful to make a clean break for v2.

The modules now will all be under the @finch-graphql scope and the new packages are:

  • @finch-graphql/api
  • @finch-graphql/client
  • @finch-graphql/react
  • @finch-graphql/types ( shared types )
  • @finch-graphql/browser-polyfills
  • @finch-graphql/typescript-codgen

This means savings across the board in terms of package size, and flexibility for new integrations.

Testing

  • Includes test.
  • Manually tested.

Additional notes

No additional information is given

@jcblw
Copy link
Contributor Author

jcblw commented Sep 19, 2021

This is starting to look really good, got a few things I would like to get done before merging and distributing the update.

  • Update all the docs, including README, to reflect new changes.
  • Add page to docs outlining migration from v1 -> v2.
  • Create a v1 branch to allow for updates to still happen if the upgrade path is difficult.
  • Publish a new version of v1 with deprecation notice.

 - @finch-graphql/api@2.0.1-alpha.0
 - @finch-graphql/browser-polyfill@2.0.1-alpha.0
 - @finch-graphql/client@2.0.1-alpha.0
 - finch-graphql-devtools@1.5.2
 - finch-docs@0.1.0
 - finch-typescript-codegen@0.1.1-alpha.0
 - @finch-graphql/react@2.0.1-alpha.0
 - @finch-graphql/types@2.0.1-alpha.0
 - @finch-graphql/api@2.0.2-alpha.0
 - @finch-graphql/browser-polyfill@2.0.2-alpha.0
 - @finch-graphql/client@2.0.2-alpha.0
 - finch-graphql-devtools@1.5.3
 - finch-docs@0.1.1
 - finch-typescript-codegen@0.1.1
 - @finch-graphql/react@2.0.2-alpha.0
 - @finch-graphql/types@2.0.2-alpha.0
 - @finch-graphql/api@2.0.3-alpha.0
 - @finch-graphql/browser-polyfill@2.0.3-alpha.0
 - @finch-graphql/client@2.0.3-alpha.0
 - finch-graphql-devtools@1.5.4
 - finch-docs@0.1.2
 - finch-typescript-codegen@0.1.2-alpha.0
 - @finch-graphql/react@2.0.3-alpha.0
 - @finch-graphql/types@2.0.3-alpha.0
@jcblw
Copy link
Contributor Author

jcblw commented Sep 25, 2021

Playing around with this in the Toucan application. Got this error.

Uncaught Error: Cannot use GraphQLObjectType "Query" from another module or realm.

Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.

https://yarnpkg.com/en/docs/selective-version-resolutions

Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
    at instanceOf (background.js:146189)
    at isObjectType (background.js:156749)
    at mapArguments (background.js:138014)
    at mapDefaultValues (background.js:137895)
    at Module.mapSchema (background.js:137811)
    at createNewSchemaWithResolvers (background.js:129364)
    at addResolversToSchema (background.js:129257)
    at addMiddlewareToSchema (background.js:127913)
    at normalisedMiddlewares.reduceRight.schema.schema (background.js:127942)
    at Array.reduceRight (<anonymous>)

@jcblw
Copy link
Contributor Author

jcblw commented Sep 25, 2021

https://yarnpkg.com/en/docs/selective-version-resolutions

Fixed, seems like we had a couple of versions of graphql in the modules. These are all in sync now.

@jcblw jcblw merged commit 80b36f4 into master Sep 26, 2021
@jcblw jcblw deleted the feature/finch-v2 branch September 26, 2021 04:57
@jcblw jcblw mentioned this pull request Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant