Skip to content

Commit

Permalink
Remove manually imported ActionCable code
Browse files Browse the repository at this point in the history
  • Loading branch information
rubendinho committed Jul 13, 2024
1 parent a7132c4 commit abef252
Show file tree
Hide file tree
Showing 18 changed files with 29 additions and 714 deletions.
2 changes: 2 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@
},
"dependencies": {
"@apollo/client": "^3.9.9",
"@rails/actioncable": "^7.1.3-4",
"cross-fetch": "^4.0.0",
"graphql": "^16.9.0",
"graphql-ruby-client": "^1.14.0"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@types/node": "20.14.10",
"@types/rails__actioncable": "6.1.11",
"@types/react": "18.3.3",
"bunchee": "5.2.2",
"rimraf": "6.0.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/api/graphql/links/ActionCableLink.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { GlobalStorage } from '@/storage'
import type { FetchResult, NextLink, Operation } from '@apollo/client/core/index.js'
import { ApolloLink, Observable } from '@apollo/client/core/index.js'
import type { Consumer } from '@rails/actioncable'
import { createConsumer } from '@rails/actioncable'
import { print } from 'graphql'
import { endpointWebsockets } from '../../../configuration'
import type { Consumer } from './actioncable'
import { createConsumer } from './actioncable'
import { GlobalStorage } from '@/storage'
import { endpointWebsockets } from '@/configuration'

type RequestResult = FetchResult<
{ [key: string]: unknown },
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/api/graphql/links/BatchHttpLink.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { BatchHttpLink as ApolloHttpLink } from '@apollo/client/link/batch-http/index.js'
import crossfetch from 'cross-fetch'

import { endpointGraphQL } from '@/configuration'

// Use `cross-fetch` only if `fetch` is not available on the `globalThis` object
const effectiveFetch = typeof fetch === 'undefined' ? crossfetch : fetch

import { endpointGraphQL } from '../../../configuration'

export const BatchHttpLink = new ApolloHttpLink({
uri: endpointGraphQL,
fetch: effectiveFetch,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/api/graphql/links/HttpLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import crossfetch from 'cross-fetch'
// Use `cross-fetch` only if `fetch` is not available on the `globalThis` object
const effectiveFetch = typeof fetch === 'undefined' ? crossfetch : fetch

import { endpointGraphQL } from '../../../configuration'
import { endpointGraphQL } from '@/configuration'

export const HttpLink = new ApolloHttpLink({
uri: endpointGraphQL,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/api/graphql/links/VersionLink.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApolloLink } from '@apollo/client/index.js'

import { version } from '../../../configuration'
import { version } from '@/configuration'

export const VersionLink = new ApolloLink((operation, forward) => {
operation.setContext(({ headers = {} }) => ({
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/api/graphql/links/actioncable/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions packages/core/src/api/graphql/links/actioncable/adapters.ts

This file was deleted.

188 changes: 0 additions & 188 deletions packages/core/src/api/graphql/links/actioncable/connection.ts

This file was deleted.

141 changes: 0 additions & 141 deletions packages/core/src/api/graphql/links/actioncable/connection_monitor.ts

This file was deleted.

Loading

0 comments on commit abef252

Please sign in to comment.