-
Notifications
You must be signed in to change notification settings - Fork 792
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dev-server): improve dev-server status/progress
- Loading branch information
1 parent
d5cfea5
commit 4960fbe
Showing
15 changed files
with
175 additions
and
91 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import * as d from '../../declarations'; | ||
|
||
|
||
export function emitBuildLog(win: d.DevClientWindow, buildLog: d.BuildLog) { | ||
win.dispatchEvent(new CustomEvent(BUILD_LOG, { detail: buildLog })); | ||
} | ||
|
||
|
||
export function emitBuildResults(win: d.DevClientWindow, buildResults: d.BuildResults) { | ||
win.dispatchEvent(new CustomEvent(BUILD_RESULTS, { detail: buildResults })); | ||
} | ||
|
||
|
||
export function emitBuildStatus(win: d.DevClientWindow, buildStatus: d.BuildStatus) { | ||
win.dispatchEvent(new CustomEvent(BUILD_STATUS, { detail: buildStatus })); | ||
} | ||
|
||
|
||
export function onBuildLog(win: d.DevClientWindow, cb: (buildLog: d.BuildLog) => void) { | ||
win.addEventListener(BUILD_LOG, (ev: any) => { | ||
cb(ev.detail); | ||
}); | ||
} | ||
|
||
|
||
export function onBuildResults(win: d.DevClientWindow, cb: (buildResults: d.BuildResults) => void) { | ||
win.addEventListener(BUILD_RESULTS, (ev: any) => { | ||
cb(ev.detail); | ||
}); | ||
} | ||
|
||
|
||
export function onBuildStatus(win: d.DevClientWindow, cb: (buildStatus: d.BuildStatus) => void) { | ||
win.addEventListener(BUILD_STATUS, (ev: any) => { | ||
cb(ev.detail); | ||
}); | ||
} | ||
|
||
|
||
const BUILD_LOG = `devserver:buildlog`; | ||
const BUILD_RESULTS = `devserver:buildresults`; | ||
const BUILD_STATUS = `devserver:buildstatus`; |
This file contains 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
Oops, something went wrong.