Skip to content

Conversation

@nrkruk
Copy link
Collaborator

@nrkruk nrkruk commented Nov 6, 2025

What does this PR do?

This PR ports functional changes from the 258-patch branch to main, focusing on improvements for IDE-based component preview and VSCode/Code Builder integration.

Key Changes:

  • Added new metaUtils.ts utility for auto-enabling Lightning Preview in orgs
  • Enhanced lightning dev component command with:
    • --api-version flag for API version override
    • Auto-enable local dev support (via AUTO_ENABLE_LOCAL_DEV env var)
    • VSCode/Code Builder proxy support (via SF_CONTAINER_MODE and VSCODE_PROXY_URI env vars)
    • Improved return type with ComponentPreviewResult for better JSON output
  • Added generateComponentPreviewUrl() helper method in previewUtils
  • Removed lightning-base-components dependency from lwc.config.json
  • Updated GitHub workflow to promote version 4 to 'latest' tag
  • Updated command snapshot for new flag
  • Fix preview url encoding

What issues does this PR fix or reference?

@W-20141594@

@nrkruk nrkruk requested review from a team as code owners November 6, 2025 23:00
@nrkruk nrkruk requested a review from a team as a code owner November 24, 2025 16:45
@nrkruk nrkruk requested a review from abdulsattar November 25, 2025 17:04
@nrkruk nrkruk changed the title feat: port 258-patch changes to main for IDE preview support @W-20141594@ feat: port 258-patch changes to main for IDE preview support @W-20141594 Nov 25, 2025
@nrkruk nrkruk self-assigned this Nov 25, 2025
package.json Outdated
"@inquirer/prompts": "^5.3.8",
"@inquirer/select": "^2.4.7",
"@lwc/lwc-dev-server": "~13.3.0",
"@lwc/sfdc-lwc-compiler": "~13.2.19",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This got out of sync with CLCO. Need to downgrade and then branch for 260

ldpServerId: string,
componentName?: string
): string {
let url = `${instanceUrl}/lwr/application/e/devpreview/ai/localdev-preview?ldpServerUrl=${ldpServerUrl}&ldpServerId=${ldpServerId}`;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the path for 260 to local-dev

@@ -0,0 +1,239 @@
/*
* Copyright 2025, Salesforce, Inc.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating mydomain settings and enabling local dev automatically from vscode

import { Messages, SfProject, Logger } from '@salesforce/core';
import { Platform } from '@salesforce/lwc-dev-mobile-core';
import { ComponentUtils } from '../../../shared/componentUtils.js';
import { PromptUtils } from '../../../shared/promptUtils.js';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are pulling forward the --json changes from 258

@nrkruk nrkruk requested a review from bpbuch November 26, 2025 15:30
const apiVersion = flags['api-version'];

// Auto enable local dev
if (process.env.AUTO_ENABLE_LOCAL_DEV === 'true') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be auto enabling. Can we make this interactive?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can but I probably need to do it from the VSCode side of things. Its awkward to handle sending standard input to a spawned CLI process

};

// Open the browser and navigate to the right page (unless OPEN_BROWSER is set to true)
if (process.env.OPEN_BROWSER !== 'false') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a command flag?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can make one, just wanted to review with CLI folks first before we created a flag for this

@nrkruk nrkruk changed the title feat: port 258-patch changes to main for IDE preview support @W-20141594 feat: add json flag / preview url encoding fixes / auto enable / fix 260 dependencies @W-20141594 Dec 8, 2025
@nrkruk nrkruk merged commit eb4d6ce into main Dec 9, 2025
17 checks passed
@nrkruk nrkruk deleted the nkruk/fixmainpreview branch December 9, 2025 12:18
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.

4 participants