Skip to content

v6 isolation improvements.#14786

Draft
bobbor wants to merge 48 commits intomainfrom
poc/bobbor/v7
Draft

v6 isolation improvements.#14786
bobbor wants to merge 48 commits intomainfrom
poc/bobbor/v7

Conversation

@bobbor
Copy link
Copy Markdown
Member

@bobbor bobbor commented Apr 22, 2026

THIS PR IS A DRAFT. Don't look at it yet (too thouroughly). breaking changes are likely.

Description of changes

  • Drop the singleton
    • create local/global context instead
  • isolate categories and have inter-category dependency explicit.
  • introduce a programmable Configuration manager.

Description of how you validated changes

  • have a sample app to test behaviour
  • e2e test pass
  • unit tests pass
  • more tests to come

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

Checklist for repo maintainers

  • Verify E2E tests for existing workflows are working as expected or add E2E tests for newly added workflows
  • New source file paths included in this PR have been added to CODEOWNERS, if appropriate

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 22, 2026

⚠️ No Changeset found

Latest commit: 591f989

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

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ This PR includes changes to the "aws-amplify" package.json file, which can have library-wide implications.

Please ensure that this PR:

  • Does not manually change "@aws-amplify/*" dependency versions, which may misalign core dependencies across the library
  • Remove any export paths without a major version bump

A repository administrator is required to review this change.

@bobbor bobbor force-pushed the poc/bobbor/v7 branch 3 times, most recently from 7d1ab15 to cc894b1 Compare April 29, 2026 13:33
@bobbor bobbor mentioned this pull request May 4, 2026
6 tasks
bobbor added 24 commits May 8, 2026 16:10
# Conflicts:
#	packages/storage/src/providers/s3/apis/server/index.ts
bobbor added 24 commits May 8, 2026 16:14
…kAmplifyContext

Replace jest.mock('@aws-amplify/core') + setUpGetConfig pattern with
createMockAmplifyContext + setGlobalContext in 20 simple CRUD API test files.

Also adds AMPLIFY_CONTEXT_BRAND to mockAmplifyContext.ts (required by
resolveCtxArgs runtime check).
…ockAmplifyContext

Migrate 9 sign-in error, resumable, signUp, and WebAuthn test files to
use createMockAmplifyContext + setGlobalContext pattern.
…etUpGetConfig

Migrate signOut, autoSignIn, confirmSignInHappyCases, and 8 signIn-family
tests from Amplify.configure to createMockAmplifyContext + setGlobalContext.

Delete setUpGetConfig.ts — all consumers have been migrated.
Export GraphQLAPI as a Proxy that lazily delegates to
createGraphQLAPI(getGlobalContext()) on property access. This preserves
the v6 import path without requiring context at import time.
…or class

Add AmplifyServerContextError as a subclass of AmplifyError for backwards
compatibility with v6 error handling (instanceof checks).

Add ContextSpec as a type alias for AmplifyContext and restore the
AmplifyServer namespace export from aws-amplify/adapter-core.
…nfigure merge

- Re-export fetchAuthSession from @aws-amplify/core in the auth barrel
  so that 'import { fetchAuthSession } from aws-amplify/auth' works.
- Restore libraryOptions merge behavior in Amplify.configure(): preserves
  previous libraryOptions when not explicitly provided.
If global context is already configured when the OAuth Hub listener
registers (e.g., dynamic imports or code-splitting), immediately invoke
attemptCompleteOAuthFlow instead of waiting for a configure event that
already fired.
Restore runWithAmplifyServerContext as a deprecated export from
aws-amplify/adapter-core for custom server adapters (Express, Fastify).
Delegates to getGlobalContext() and passes context to the operation.
…access

Use hasGlobalContext() guard so that grabbing a reference at module load
(const gql = GraphQLAPI.graphql) no longer throws. The error is deferred
until the function is actually called without configure().
…config

Type errors have been resolved — the suppression is no longer needed.
…-core path

Ensures the old import path via @aws-amplify/core/internals/adapter-core
still provides AmplifyServerContextError.
Update internal dependency versions to match local workspace versions
after rebasing onto main. Removes stale registry entries from yarn.lock.
Also removes leftover server/uploadData.ts from conflict resolution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant