refactor: 💥 ♻️ replace Apollo/Zenroom/raw-GQL with @interfacer/client SDK#870
Draft
phoebus-84 wants to merge 10 commits into
Draft
refactor: 💥 ♻️ replace Apollo/Zenroom/raw-GQL with @interfacer/client SDK#870phoebus-84 wants to merge 10 commits into
phoebus-84 wants to merge 10 commits into
Conversation
… SDK BREAKING CHANGE: Removes @apollo/client and graphql dependencies. All GQL operations, Zenroom crypto, and external REST calls now delegate to @interfacer/client SDK. Key changes: - AuthContext: Zenroom keypairoom → SDK AuthClient - useProjectCRUD: raw GQL mutations → SDK ResourceClient - useInBox/useWallet/useSocial: raw REST → SDK Inbox/Wallet/Social clients - useAutoimport: raw Octokit → SDK ImportClient - useResourceSpecs: Apollo → SDK getInstanceVariables - lib/dpp.ts: raw fetch → SDK DppClient - lib/fileUpload.ts: Zenroom hash → SDK FileClient - lib/tagging.ts: re-exports from SDK TaggingClient - lib/createApolloClient.ts: Apollo → SDK GraphQLClient - lib/apollo-compat.tsx: Apollo useQuery/useMutation compat layer (aliased via tsconfig paths + webpack for zero-change migration) - pages/sign_in.tsx: Zenroom doLogin → SDK auth.recreateKeys - Removed Zenroom WASM dynamic imports from AuthContext TypeScript: 0 errors (tsc --noEmit passes) Next.js build: reaches compilation (pre-existing Node 25 incompat)
- Removed: history/*, skills-lock.json, geo-search.md, enniogol.stl, manuelrdlg.txt - Restored AGPL-3.0 SPDX license headers in: hooks/useSignedPost.ts, hooks/useAuth.tsx, lib/fileUpload.ts Re: AuthContext as client init location — yes, it's the right place. It's the natural successor to the old ApolloProvider and provides the SDK client to all children via React Context. The alternative would be accepting a pre-built client as AuthProvider prop.
- Remove link:../interfacer-client from package.json - Update all imports across 9 source files to use @dyne/interfacer-client - Regenerate pnpm-lock.yaml
Previously returned hardcoded empty stubs — project creation would fail. Now calls getInstanceVariables() via useEffect and populates all 6 spec IDs from the Zenflows instance. Falls back to empty values while loading. TypeScript: 0 errors
…flow - Updated @dyne/interfacer-client to 0.2.9 (ProjectType enum fix) - Use SDK's InstanceVariables type, removed specDpp from hasAllSpecs guard - Pass processId + locationId to createProject, avoiding duplicates - Removed overly strict projectTypes guard in handleProjectCreation
…hange Session restore useEffect had router.asPath in deps, causing client.auth.login() on every navigation. Any network failure in that call wiped localStorage and logged the user out. Changed to use stable publicPage dependency instead.
- Replaced empty uploadFiles() stub with client.files.uploadToDpp() - Store DPP file URLs in metadata.image (single URL or array) - findProjectImages already supports metadata.image for display - Matches the fix from interfacer-init-data (commit 92d2ca2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE: Removes @apollo/client and graphql dependencies.
All GQL operations, Zenroom crypto, and external REST calls now
delegate to @interfacer/client SDK.