This repository was archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Do not close/reopen live preview on currentDocumentChange #7119
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7996e9d
Do not close/reopen live preview on currentDocumentChange. Use Page.n…
jasonsanjose f144591
update status when changing HTML documents
jasonsanjose 0e300ad
fix jslint errors
jasonsanjose 39de981
sanity check args in BaseServer add/remove
jasonsanjose e34e931
remove extraneous dir
jasonsanjose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -407,7 +407,7 @@ define(function LiveDevelopment(require, exports, module) { | |
| } | ||
|
|
||
| /** Triggered by Inspector.error */ | ||
| function _onError(event, error) { | ||
| function _onError(event, error, msgData) { | ||
| var message; | ||
|
|
||
| // Sometimes error.message is undefined | ||
|
|
@@ -430,7 +430,7 @@ define(function LiveDevelopment(require, exports, module) { | |
| } | ||
|
|
||
| // Show the message, but include the error object for further information (e.g. error code) | ||
| console.error(message, error); | ||
| console.error(message, error, msgData); | ||
| } | ||
|
|
||
| function _styleSheetAdded(event, url) { | ||
|
|
@@ -1106,19 +1106,22 @@ define(function LiveDevelopment(require, exports, module) { | |
| } | ||
| }); | ||
| } | ||
|
|
||
| function _createLiveDocumentForFrame(doc) { | ||
| // create live document | ||
| doc._ensureMasterEditor(); | ||
| _liveDocument = _createDocument(doc, doc._masterEditor); | ||
| _server.add(_liveDocument); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fix in |
||
| } | ||
|
|
||
| // helper function that actually does the launch once we are sure we have | ||
| // a doc and the server for that doc is up and running. | ||
| function _doLaunchAfterServerReady(initialDoc) { | ||
| // update status | ||
| _setStatus(STATUS_CONNECTING); | ||
|
|
||
| // create live document | ||
| initialDoc._ensureMasterEditor(); | ||
| _liveDocument = _createDocument(initialDoc, initialDoc._masterEditor); | ||
| _createLiveDocumentForFrame(initialDoc); | ||
|
|
||
| // start listening for requests | ||
| _server.add(_liveDocument); | ||
| _server.start(); | ||
|
|
||
| // Install a one-time event handler when connected to the launcher page | ||
|
|
@@ -1255,9 +1258,22 @@ define(function LiveDevelopment(require, exports, module) { | |
| isViewable = exports.config.experimental || (_server && _server.canServe(doc.file.fullPath)); | ||
|
|
||
| if (!wasRequested && isViewable) { | ||
| // TODO (jasonsanjose): optimize this by reusing the same connection | ||
| // no need to fully teardown. | ||
| close().done(open); | ||
| // Update status | ||
| _setStatus(STATUS_CONNECTING); | ||
|
|
||
| // clear live doc and related docs | ||
| _closeDocuments(); | ||
|
|
||
| // create new live doc | ||
| _createLiveDocumentForFrame(doc); | ||
|
|
||
| // Navigate to the new page within this site. Agents must handle | ||
| // frameNavigated event to clear any saved state. | ||
| Inspector.Page.navigate(docUrl).then(function () { | ||
| _setStatus(STATUS_ACTIVE); | ||
| }, function () { | ||
| _close(false, "closed_unknown_reason"); | ||
| }); | ||
| } else if (wasRequested) { | ||
| // Update highlight | ||
| showHighlight(); | ||
|
|
||
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
Submodule psd-lens
added at
d71e1a
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSLint error:
_resetwas used before it was defined