embeddable-explorer icon indicating copy to clipboard operation
embeddable-explorer copied to clipboard

Add a new npm package for shared helpers

Open mayakoneval opened this issue 2 years ago • 5 comments

What? This PR adds a new npm package @apollo/embed-helpers that contains shared code between @apollo/sandbox and @apollo/explorer.

Why? When we need to support new protocols, like @defer, multi part subscriptions, file upload, in our clients, we need to implement everything twice, in @apollo/sandbox and @apollo/explorer.

This is step one in migrating @apollo/sandbox and @apollo/explorer to share this code.

  1. make new npm package
  2. install it in @apollo/sandbox and @apollo/explorer, remove redundant code!

mayakoneval avatar Apr 04 '23 21:04 mayakoneval

⚠️ No Changeset found

Latest commit: 0d7b48d9f9a113ee9920ddf07b8de1982f6f02a3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Apr 04 '23 21:04 changeset-bot[bot]

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0d7b48d9f9a113ee9920ddf07b8de1982f6f02a3:

Sandbox Source
npm-embeddable-explorer (forked) Configuration
npm-embeddable-sandbox Configuration
maya-test-embed-next Configuration
maya-test-embed-next Configuration

codesandbox-ci[bot] avatar Apr 04 '23 21:04 codesandbox-ci[bot]

It might be nice to use some of these helpers in studio as well, so we only have 1 implementation of the defer stuff? What do you think about splitting these into 2 helper packages explorer-helpers and embed-helpers?

Or I guess we could just use embed-helpers? I'm guessing there aren't any large deps in there 🤔

Jephuff avatar Apr 04 '23 21:04 Jephuff

@Jephuff I like that idea! I think we could reuse constructMultipartForm and readMultipartWebStream specifically in Explorer. I'll split those out 🙇🏻

mayakoneval avatar Apr 04 '23 22:04 mayakoneval

This needs to wait on release of https://github.com/apollographql/embeddable-explorer/pull/235

mayakoneval avatar Apr 05 '23 00:04 mayakoneval