Skip to content

Commit

Permalink
Upgrade dependencies, fix some things. (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
twavv authored Sep 8, 2021
1 parent bb358dc commit d25e7e0
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 21 deletions.
5 changes: 2 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,17 @@ Mux = "a975b10e-0019-58db-a62f-e48ff68538c9"
Blink = "ad839575-38b3-5650-b840-f874b8c74a25"
NBInclude = "0db19996-df87-5ea3-a455-e3a50d440464"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
NodeJS = "2bd173c7-0d6d-553b-b6af-13a54713934c"

[compat]
Widgets = "0.6.2"
julia = "0.7, 1"
JSExpr = "0.5"
JSON = "0.18, 0.19, 0.20, 0.21"
Observables = "0.2.3, 0.3, 0.4"
Observables = "0.4"
FunctionalCollections = "0.5.0"
AssetRegistry = "0.1.0"
WebSockets = "1.5.0"
Requires = "0.4.4, 0.5, 1.0.0"

[targets]
test = ["Blink", "Conda", "DataStructures", "Dates", "IJulia", "JSExpr", "Mux", "NBInclude", "NodeJS", "Test"]
test = ["Blink", "Conda", "DataStructures", "Dates", "IJulia", "JSExpr", "Mux", "NBInclude", "Test"]
12 changes: 1 addition & 11 deletions deps/_bundlejs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ end
let
package_dir = dirname(@__DIR__)

# NodeJS isn't a hard requirement of WebIO, but is needed to build packages,
# so we need to install it in CI.
if isci()
@info "CI detected, installing NodeJS..."

using Pkg
Pkg.add("NodeJS")
end

# Don't build packages outside of a dev environment (or CI).
if !isdev()
@warn(
Expand All @@ -27,9 +18,8 @@ let
end

# Build the dang packages!
using NodeJS
package_dir = normpath(joinpath(@__DIR__, "..", "packages"))
npm = `$(NodeJS.npm_cmd()) -C $(package_dir)`
npm = `npm -C $(package_dir)`

install_cmd = `$npm install --scripts-prepend-node-path=auto --unsafe-perm`
@info "Installing NPM dependencies..." cmd=install_cmd
Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-lab-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
],
"gitHead": "a17bcee97d64897d0e9b429a8551f19eedc47091",
"devDependencies": {
"typescript": "~3.3"
"typescript": "^4.4.2"
}
}
2 changes: 1 addition & 1 deletion packages/webio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"build-prod": "npm run build && webpack -p"
},
"devDependencies": {
"typescript": "~3.3",
"typescript": "^4.4.2",
"webpack": "^4.35.3"
},
"gitHead": "a17bcee97d64897d0e9b429a8551f19eedc47091"
Expand Down
5 changes: 3 additions & 2 deletions packages/webio/src/IFrame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ class WebIOIFrame extends WebIONode {
*/
private waitForWebIO(iframeWindow: Window, interval: number = 100) {
const future = new Future<WebIO>();
const wait = () => {
const wait = (): void => {
if (typeof (iframeWindow as any).WebIO === "undefined") {
debug(`IFrame doesn't have WebIO, waiting ${interval}ms...`);
return setTimeout(wait, interval);
setTimeout(wait, interval);
return;
}
future.resolve((iframeWindow as any).WebIO);
};
Expand Down
2 changes: 1 addition & 1 deletion packages/webio/src/ObservableNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class WebIOObservableNode extends WebIONode {
this.observable = this.scope.getObservable(schema.instanceArgs.name);
this.mountObservable();
this.scope.promises.connected.then(() => this.observable!.subscribe(this.onObservableUpdate));
} catch (e) {
} catch (e: any) {
this.node = null;
this.element.innerHTML = `<strong>Caught exception while trying to render ObservableNode: ${e.message}</strong>`;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/webio/src/imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const importLink = (url: string, options: {rel?: string, type?: string, m
return Promise.resolve();
}

return new Promise((resolve, reject) => {
return new Promise<void>((resolve, reject) => {
const link = document.createElement("link");

// Apply options
Expand Down
7 changes: 6 additions & 1 deletion src/scope.jl
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,12 @@ end
Set observable without synchronizing with the counterpart on the browser
"""
function set_nosync(ob, val)
Observables.setexcludinghandlers(ob, val, x -> !(x isa SyncCallback))
for f in listeners(ob)
if !(f isa SyncCallback)
Base.invokelatest(f, val)
end
end
return
end

const lifecycle_commands = ["scope_created"]
Expand Down

0 comments on commit d25e7e0

Please sign in to comment.