Open athewsey opened 3 years ago
@athewsey I am looking for the same currently, wish any of the authors (@yunabe, @yannisgu, @tiagosiebler) could help.
To you guys, tslab is wonderful, I am using it to create educational material, but this issue of mandatory type-checking is causing differentiating behavior from npm runtime.
Minimal example would be
var a=2, b='2'; // Below lines does throws error in notebook a==b
Also, I don't have much experience in Type-script, but is it okay if it shows different type-checking behavior based on context? For example switch-case types are matched only if it runs globally, but not when it executes in a function
Error when executing code in global context
While below code runs successfully when the similar switch-case logic in in a function
(Sorry to bombard with issues lately! I think this one is again separate, but likely linked to #38)
I'm seeing the JavaScript/
jslab
kernel raise errors on module imports that shouldn't be a problem in plain JavaScript.For instance, referring to the TensorFlow.js MNIST node example, if I:
...I'm seeing:
I appreciate that by some perspectives this is a good thing, and even in the README this project calls out that it provides "Type safety even in JavaScript mode".
...but in JS mode we don't have the option of simply suppressing the checks by e.g. adding e.g.
as any
, since that's TS-specific syntax - even assuming we're able to edit the source file.Is there any way to turn off type checking either locally or globally for the JS kernel?