Fix live preview reload for documentSaved events#5207
Conversation
There was a problem hiding this comment.
Naming nit: the term "instrumentationEnabled" doesn't really match the functionality. HTML documents are instrumented, but CSS documents aren't. How about using liveEditingEnabled instead? The function on CSSDocument/HTMLDocument would be called isLiveEditingEnabled().
|
I'm seeing a failure in the Live Development unit tests: "should reapply in-memory css changes after saving changes in html document". |
|
Initial review complete. |
There was a problem hiding this comment.
SpecRunnerUtils.getTempDirectory() is used several times in this file. This value should be in a variable.
|
@jasonsanjose re-review complete. Still have one failing unit test. |
…_SAVE test cases.
|
@gruehle went a different route to fix the async bug in that test. Changed the tests to wait for the |
There was a problem hiding this comment.
No need to restore file content now that we read the project from test/temp
|
Everything is working well. It's too bad we need to wait 3 seconds for each of the tests that is expecting the page to not reload, but I can't think of an alternative. Merging. |
Fix live preview reload for documentSaved events
Fix for #5185. Instead of relying on
doc.url, simply use theDocument.file.fullPathand let the server provide the expected URL.