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

Have the constructor preload iframe assets by default, with optional SDK flag to defer preloading #634

Merged
merged 3 commits into from
Oct 13, 2023

Conversation

Dizigen
Copy link
Contributor

@Dizigen Dizigen commented Sep 26, 2023

📦 Pull Request

Have the SDK constructor run the iframe bootstrap logic by default, and introduce an SDK config flag to defer the preloading for devs who want to control when the Magic Iframe assets get loaded.

✅ Fixed Issues

🚨 Test instructions

const m = new Magic(API_KEY) -> will immediately bootstrap the auth relayer iframe by default

const m = new Magic(API_KEY, { deferPreload: true }) -> will not bootstrap the auth relayer iframe until the first sdk request is made (existing behavior)

⚠️ Don't forget to add a semver label!

Please only add one label:

  • patch: Bug Fix?
  • minor: New Feature?
  • major: Breaking Change?
  • skip-release: It's unnecessary to publish this change.
📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-ext/[email protected]
npm install @magic-sdk/[email protected]
npm install @magic-sdk/[email protected]
npm install @magic-sdk/[email protected]
npm install @magic-sdk/[email protected]
npm install @magic-sdk/[email protected]
npm install [email protected]
# or 
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-ext/[email protected]
yarn add @magic-sdk/[email protected]
yarn add @magic-sdk/[email protected]
yarn add @magic-sdk/[email protected]
yarn add @magic-sdk/[email protected]
yarn add @magic-sdk/[email protected]
yarn add [email protected]

@Dizigen Dizigen added the patch Increment the patch version when merged label Sep 26, 2023
@Dizigen Dizigen self-assigned this Sep 26, 2023
@Dizigen Dizigen changed the title force the constructor to preload the iframe force the constructor to preload the iframe by default, add optional SDK flag to defer preloading Oct 12, 2023
@Dizigen Dizigen marked this pull request as ready for review October 12, 2023 00:43
@Dizigen Dizigen requested review from Ethella and Ariflo October 12, 2023 00:43
@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #87853: Productionalize -deferPreload SDK flag.

@Dizigen Dizigen added major Increment the major version when merged and removed patch Increment the patch version when merged labels Oct 12, 2023
@Dizigen Dizigen changed the title force the constructor to preload the iframe by default, add optional SDK flag to defer preloading Have the constructor preload iframe by default, with optional SDK flag to defer preloading Oct 12, 2023
@Dizigen Dizigen changed the title Have the constructor preload iframe by default, with optional SDK flag to defer preloading Have the constructor preload iframe assets by default, with optional SDK flag to defer preloading Oct 12, 2023
@Dizigen Dizigen added this pull request to the merge queue Oct 13, 2023
Merged via the queue into master with commit 504f58d Oct 13, 2023
@Dizigen Dizigen deleted the force-ctor-preload-iframe branch October 13, 2023 12:50
@Ariflo Ariflo added the released This issue/pull request has been released. label Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Increment the major version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants