« first day (549 days earlier)      last day (903 days later) » 

3:34 PM
@Scratte Apologies - I've had a difficult couple of weeks. It sounds like you have a lot to say - since it doesn't seem to fit in the contact form, you can email it to me if you like. My address is in my profile.
 
 
3 hours later…
6:52 PM
@Catija and what is the upper cap on the "contact us" form? Hey, @Scratte, do drop by here from time to time, we miss ya
on an unrelated note, TS 4.5 is live 🎉 devblogs.microsoft.com/typescript/announcing-typescript-4-5
 
@OlegValter Awaited seems like a good addition. import type and import assertions seem interesting, too.
Oh, and ES6 module support.
 
7:10 PM
@VLAZ yup (although I recently tried to find a use case in my codebases and ... failed, actually), I like import { type A } from the statements the most from it, I have a bunch of projects where it will declutter imports significantly
Frankly, I know little of import assertions - haven't followed the proposal
but a stable target for ESM is nice, yeah
 
7:28 PM
@OlegValter This is the first time I head of those. I suppose it would help with making sure you import the right thing. Which sounds useful.
 
@VLAZ same till I read the RC announcement :) Seems like it early-implements this proposal: github.com/tc39/proposal-import-assertions
 
Yeah, I was just reading it and...I'm not actually that impressed.
 
yeah, it is a headscratcher
 
You can say stuff like "I want to make sure I get JSON" or not which is OK and you can also assert you get a specific structure but...I can't actually see THAT much of a use.
The JSON assertion is probably OK if you have import whatever from 'file.js' just in case somebody decides to change the file to be code.
Or something similar, at least.
But the structural assertions seems a bit "meh". Sounds like just added maintenance - either the module supplies you what you want or you change it and then have to go and change the import + assertion.
Oh, and the webassembly assertion is OK, I guess. Similar to JSON.
 
Honestly, I am still not sure I understand the motivation
 
7:37 PM
If you import something you don't expect, it fails directly.
Not sure how much it helps with understanding...
Also, I'm not really sure when exactly you'd want that. Like, you are testing your code, right? Surely if you import random stuff it just wouldn't work.
 
that's exactly what I fail to grasp
 
I suppose it's a way to automatically test this for you but...still not sure how much of a benefit it is.
 
but that depends on when exactly the assertion fails
let's say Alice wants to import a JSON module, and assert that it is JSON. Bob then tries to steal some info by substituting it with a malicious script that will get executed when imported
the question is... where does the failure happen? I hope as early as possible
then I probably see the reason
 
@OlegValter When the module is loaded, I'd assume.
More specifically there is import X from 'x.js' {type: json} in module A - when module A is processed then it fails.
Because you might have import X from 'x.js' without an assertion in module B - that shouldn't fail.
 
then it more or less makes sense - if the assertion throws as soon as it detects that the module is not what it is asserted to be, this is not a bad idea
 
7:46 PM
Yes, the JSON/Webassembly ones are OK. I don't disagree.
But the structural assertions are weird to me. You can assert that the imported value is some specific thing.
 
that said, I imagine this is going to lead to a huge number of confused new devs :)
import { A, type B } from "./foo." assert { type: "something" } with { transform: "anything" };
 
Ah wait, the structural one is not in this proposal but an example for future expansion.
 
^^ something like the above will break more than one young mind :)
 
I still don't get the with
 
it looks like an alternative to assert for now
it worries me a little, though, that with made it back to JS, and is going to have a completely different semantics on top of that
seems like if, assert, when, and with are considered as options to go for for designating assertions
with assert being the primary one
 
7:56 PM
The proposal mentions something about transformations but somehow I can't find what those tranformations would be. And yeah, I get the point of returning with but different.
 
I could not either
this might shed some light - issue #99 on the proposal
with might only refer to "evaluator attributes", a follow-up proposal
heh, fun:
> Yeah, I know... 😞 Stupid English doesn't have a shorter way to write expecting:
yes, it does, called expect
 

« first day (549 days earlier)      last day (903 days later) »