Live-Reload Fails to Update Child Components with Dynamic Imports in Salesforce LocalDev for Experience Sites
@nrkruk 已经在做这个了。
开始于 2024年11月8日。
评估
这个 Issue 还没有评估数据。
描述
Summary
Live-reload functionality in Salesforce LocalDev does not refresh child components when the main component published to an Experience Website uses dynamic imports. Specifically, if a component is dynamically imported (e.g., import('c/dynamicComponent')), any changes made to the dynamically imported child component (or any other non-dynamically imported child component) are not recompiled or published as expected during live-reload.
Steps To Reproduce:
-
Set up a main component (WebsiteMain) that dynamically imports child components using
import('c/childComponent'). -
Publish the main component to an Experience Website and initiate live reload using the command:
sf lightning dev site --target-org dev --name "MyWebsite" -
Make a change to the dynamically imported child component, or any other child component (e.g., childComponent).
-
Observe that live reload does not pick up changes made to any child component.
Expected Result
When a change is made to any child component and the parent utilizes a dynamically imported component, live-reload should refresh and apply the changes across all relevant components, including any dynamically imported child components.
Actual Result
Live-reload does not detect or apply changes made to any child components other than the main component that utilizes the main site. All child components (even those that are not dynamically imported) appear to remain unaffected by these changes during live-reload.
Additional Information
Code Sample
Here’s an example of the WebsiteMain component, illustrating the dynamic import setup:
import { CurrentPageReference } from 'lightning/navigation';
import { LightningElement, track, wire } from 'lwc';
export default class WebsiteMain extends LightningElement {
@track currentPage = null; // Current page's object
@track dynamicComponent = null; // Holds the dynamically imported component constructor
myDynamicPages = [
{
id: 1,
name: "Basic Information",
path: "BasicInformation",
component: () => import('c/childComponent'),
showPageNavbar: false
}, ...
];
}
async loadComponent(page) {
const componentModule = await page.component();
this.dynamicComponent = componentModule.default;
}
Screenshots:
None
Logs:
No logs are created (even when DEBUG=* is set) when modifying a child component with dynamic imports utilized.
System Information
SF CLI:
{
"architecture": "win32-x64",
"cliVersion": "@salesforce/cli/2.63.8",
"nodeVersion": "node-v20.17.0",
"osVersion": "Windows_NT 10.0.22635",
"rootPath": "C:\\Users\\BradyNadeau\\AppData\\Local\\sf\\client\\2.63.8-fbf82e0",
"shell": "cmd.exe",
"pluginVersions": [
"@oclif/plugin-autocomplete 3.2.6 (core)",
"@oclif/plugin-commands 4.1.3 (core)",
"@oclif/plugin-help 6.2.15 (core)",
"@oclif/plugin-not-found 3.2.22 (core)",
"@oclif/plugin-plugins 5.4.15 (core)",
"@oclif/plugin-search 1.2.12 (core)",
"@oclif/plugin-update 4.6.4 (core)",
"@oclif/plugin-version 2.2.15 (core)",
"@oclif/plugin-warn-if-update-available 3.1.19 (core)",
"@oclif/plugin-which 3.2.16 (core)",
"@salesforce/cli 2.63.8 (core)",
"apex 3.5.4 (core)",
"api 1.3.1 (core)",
"auth 3.6.68 (core)",
"data 3.7.1 (core)",
"deploy-retrieve 3.15.3 (core)",
"info 3.4.12 (core)",
"lightning-dev 1.9.0 (user) published 19 days ago (Fri Oct 11 2024)",
"limits 3.3.33 (core)",
"marketplace 1.2.26 (core)",
"org 4.7.0 (core)",
"packaging 2.8.12 (core)",
"schema 3.3.36 (core)",
"settings 2.3.24 (core)",
"signups 2.5.23 (user) published 17 days ago (Sat Oct 12 2024)",
"sobject 1.4.42 (core)",
"source 3.5.21 (core)",
"telemetry 3.6.16 (core)",
"templates 56.3.24 (core)",
"trust 3.7.34 (core)",
"user 3.5.33 (core)"
]
}
OS:
Experience Sites Only:
{
"orgId": "00D7X000000URjZ",
"siteId": "0DMOt0000004igo",
"clwrVersion": "252.131",
"coreVersion": "252.11",
"coreChangelist": "49784824",
"bundleGenerationDate": "Oct 30, 2024 10:47:36 PM",
"siteTemplateName": "talon-template-byo",
"deployTarget": "CORE"
}
- 主要语言
- TypeScript
- 星标
- 19
- 派生
- 19
- 平均合并
- 3 天 12 小时
- 30 天内合并 PR
- 2
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
salesforcecli/plugin-lightning-dev 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
salesforcecli/plugin-lightning-dev#686 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 42/100
salesforcecli/plugin-lightning-dev#627 · 2 条评论 · 1 个 reaction ·
-
BUG P2
难度 3/5 1-2 天 新手友好度 45/100
salesforcecli/plugin-lightning-dev#544 · 4 条评论 ·
-
难度 3/5 1-2 天 新手友好度 45/100
salesforcecli/plugin-lightning-dev#456 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
查看 salesforcecli/plugin-lightning-dev 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
mksglu/context-mode#1200 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/claude-code#96687 ·
-
good first issue
难度 1/5 1 小时以内 新手友好度 95/100
AOSSIE-Org/DebateAI#582 · 2 条评论 ·