feat: add --merge-iframe (Option B) to lightning-out command - #1017
Draft
akashdhake wants to merge 2 commits into
Draft
feat: add --merge-iframe (Option B) to lightning-out command#1017akashdhake wants to merge 2 commits into
akashdhake wants to merge 2 commits into
Conversation
|
Thanks for the contribution! Unfortunately we can't verify the commit author(s): adhake <a***@s***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, refresh the status of this Pull Request. |
Reads a JSON definition file and scaffolds the LO 2.0 metadata via @salesforce/templates. Always warns that the generated IframeWhiteListUrlSettings REPLACES the org's Trusted Domains list on deploy. Generate-only.
Adds --merge-iframe/--target-org and retrieveIframeEntries so the command preserves the org's existing Trusted Domains for Inline Frames across the REPLACE-type deploy. Stacked on the Option A base.
akashdhake
force-pushed
the
lo2/lightning-out-merge
branch
from
August 8, 2026 18:06
079129f to
daf1e89
Compare
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.
Stacked on top of #1012 (Option A). This is PR 2 of the Lightning Out 2.0 stack, and depends on forcedotcom/salesforcedx-templates#881.
feat: add
template generate lightning-outcommandRepo: salesforcecli/plugin-templates
State: DRAFT — LO 2.0 (release 266) scaffolding spike POC
Stacked as two PRs:
lo2/lightning-out(base:main@ d64a80b, commit6140d24) — the command, generate-only, always warns on the REPLACE risk. Depends on salesforcedx-templates PR 1 (lo2/lightning-out).lo2/lightning-out-merge(base:lo2/lightning-out, commit079129f) — adds only--merge-iframe/--target-org+retrieveIframeEntries(5-file delta). Depends on salesforcedx-templates PR 2 (lo2/lightning-out-merge). Review after PR 1.What
Adds the
sf template generate lightning-outcommand. It reads a JSON definitionfile and delegates to the
@salesforce/templatesLightningOutgenerator toscaffold a Lightning Out 2.0 app's seven metadata artifacts. Generate-only — it
does not deploy.
Flags
--definition-file(-f)--output-dir(-d)--force--merge-iframe--target-org--merge-iframe)Option A vs Option B (the IframeWhiteListUrlSettings risk)
Deploying
IframeWhiteListUrlSettingsREPLACES the org's entire "Trusted Domains forInline Frames" list across all IFrame Types.
REPLACE the org's list on deploy, and the generator refuses to silently overwrite
an existing file without
--force.--merge-iframe --target-org <org>(Option B):retrieveIframeEntriesreadsthe org's current
IframeWhiteListUrlSettingsvia the Metadata API and passesevery entry (context preserved) to the generator, so the deploy ADDS this app's
domains rather than wiping the list.
Files
src/commands/template/generate/lightning-out/index.ts— the commandsrc/utils/lightningOutIframe.ts—retrieveIframeEntrieshelpermessages/lightningOut.mdtest/commands/template/generate/lightning-out/index.nut.ts— 11 NUTstest/utils/lightningOutIframe.test.ts— 6 unit testsTesting
modes) + 6 unit tests (read() scalar/array normalization, context preservation
across IFrame Types, url filtering) — 17 passing. Compile + lint clean.
(
test-domain-x.example.com) →--merge-iframe --target-org emptyOrgretrieved 1and generated a 3-entry file → deployed successfully → re-retrieved: all 3
survived (pre-existing entry + 2 app domains). Proves the merge is additive
against a REPLACE-type deploy. The live deploy also caught a real bug (a
--insidethe WARNING XML comment is invalid XML and was rejected by the platform) — now fixed
and regression-tested in the generator repo.