(context?: ModuleContext)
| 258 | } |
| 259 | |
| 260 | public _handleLivesync(context?: ModuleContext): boolean { |
| 261 | if (Trace.isEnabled()) { |
| 262 | Trace.write(`${this}._handleLivesync(${JSON.stringify(context)})`, Trace.categories.Livesync); |
| 263 | } |
| 264 | |
| 265 | // Handle local CSS |
| 266 | if (viewMatchesModuleContext(this, context, ['style'])) { |
| 267 | if (Trace.isEnabled()) { |
| 268 | Trace.write(`Change Handled: Changing CSS for ${this}`, Trace.categories.Livesync); |
| 269 | } |
| 270 | |
| 271 | // Always load styles with ".css" extension. Even when changes are in ".scss" ot ".less" files |
| 272 | const cssModuleName = `${sanitizeModuleName(context.path)}.css`; |
| 273 | |
| 274 | this.changeCssFile(cssModuleName); |
| 275 | |
| 276 | return true; |
| 277 | } |
| 278 | |
| 279 | // Handle script/markup changes in custom components by falling back to page refresh |
| 280 | if (viewMatchesModuleContext(this, context, ['markup', 'script']) && this.page && this.page.frame) { |
| 281 | if (Trace.isEnabled()) { |
| 282 | Trace.write(`Change Handled: Changing ${context.type} for ${this} inside ${this.page}`, Trace.categories.Livesync); |
| 283 | } |
| 284 | |
| 285 | return this.page.frame._handleLivesync({ |
| 286 | type: context.type, |
| 287 | path: this.page._moduleName, |
| 288 | }); |
| 289 | } |
| 290 | |
| 291 | return false; |
| 292 | } |
| 293 | |
| 294 | _setupAsRootView(context: any): void { |
| 295 | super._setupAsRootView(context); |
nothing calls this directly
no test coverage detected