« first day (4170 days earlier)      last day (785 days later) » 

1:03 AM
posted on March 17, 2022 by Daniel Gagnon

The Beta channel is being updated to 100.0.4896.44 (Platform version: 14526.28.0) for most Chrome OS devices. If you find new issues, please let us know by visiting our forum or filing a bug. Interested in switching channels Find out how. You can submit feedback using β€˜Report an issue...’ in the Chrome menu (3 vertical dots in the upper right corner of the browser). Da

 
 
2 hours later…
2:42 AM
 
 
8 hours later…
user12582392
10:30 AM
i'm gonna try to reverse engineer a format using javascript, I've written parsers before but never reng
 
user12582392
any advices or libraries I should checkout?
 
user12582392
smth i found out is that another "partner program" transforms those into text, so I will compare those files.
 
4:23 PM
Introspection comments in TypeScript. I think it's pretty cool, even if minor.
Using // ^? will show a label with the actual type of something. Same as hovering but...saves you the hovering.
 
4:41 PM
cc @VLAZ - speaking of TypeScript
 
Oh yeah, I saw that. I'm really interested where it would go.
 
posted on March 17, 2022 by Harry Souders

Hi, everyone! We've released Chrome Beta 100 (100.0.4896.46) for iOS: it'll become available on App Store in the next few days. You can see a partial list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Harry Souders Google Chrome

 
@OlegValteriswithUkraine we had minor discussion early in chat if you interested
I'm not a fan
 
@VLAZ I am cautiously optimistic, but not too much - TS purists aren't the primary audience of the proposal :)
@JBis thanks, will look it up!
yeah, kind of the same feeling - interesting, but not really necessary. Will see when it reaches stage 1, though
 
5:17 PM
i'd be fine with some simple, optional types, but none of the complex 3 lines wordwrapped types
aka no 'this can be a string, number, or boolean'
that defeats the purpose
 
5:35 PM
@rattlesnake Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
@rattlesnake Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
1 message moved to Trash can
 
Whoops πŸ™ˆ
Hello everyone :) I have a quick question how you usually structure a short Node.js script. I require another package and call an async function from it. Then let's say I just want to print it. If I simply await the return value, then I'll get an error, that I can only use await inside an async function itself. So currently I just have it like this:
async function main() {
  foo = await someOtherAsyncFunc();
  console.log(foo);
}

main()
 
@rattlesnake Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
 
Is that the way to do it?
(By the way, why doesn't it say at chat.stackoverflow.com/faq that I can/should use 4 spaces indentation to format code? I'm sorry for invoking the bot twice.)
 
6:29 PM
@rattlesnake It works. I'd do it that way. But for the record, you can also use an async IIFE:
(async function() {
  foo = await someOtherAsyncFunc();
  console.log(foo);
})();
It's the same as yours but without a function declaration. I personally prefer having a separate one, though. It doesn't actually matter in the end.
 
@VLAZ Okay thanks :)
I've also seen people combining arrow functions with IIFE
 
(async () => {
  foo = await someOtherAsyncFunc();
  console.log(foo);
})();
This is also the same.
 
Yup :) Exactly like that
I'm coming from Python and there you wouldn't be able to just call the async function from the main program
So I was more confused about that part
Like, what's the reason await doesn't work in the main program
But never mind - I'm okay with it just working like this now
Thanks again for your help :)
 
@rattlesnake It wasn't specced to. I suppose because it adds a lot of complexity whereas they did want await to actually be included as soon as possible. For the record, there is already a spec for top-level await which is what you're talking about. But not all environments have implemented it yet.
 
6:49 PM
@VLAZ Nice :)
You know what, I'm just gonna post that as a question
Could be interesting
0
Q: Because I can't run await on the top level, I have to put it into an async function - why can I then call that async function directly?

rattlesnakeI have a short Node.js script where I require another package and call an async function from it and subsequently want to print the return value. If I simply await the return value from the top level, then I'll get an error, saying that I can only use await inside an async function itself. So app...

 
Be aware that the question might be closed as opinion-based. See Eric Lippert on the topic here and here. In general asking why something is not in the language is not really that useful. It's almost always "because it hasn't been designed and implemented (yet)"
In general requiring await to work at the top level also requires the entire module to be asynchronous. And that carries with itself even mroe complexity and consequences - if you have an async module A which you use in module B, then B also has to be async in order to properly handle interactions with A. And if C uses B, that propagates again. It's not a simple matter.
Not insurmountable difficulty either. As evidenced by the fact it now has a specification. But still takes more time than not having it at first.
 
7:14 PM
@VLAZ Thanks for the heads-up πŸ‘
If there is a reason - I'm gonna learn from it. (Like I already learned something from your two short explanations already.) But fair enough, if there isn't a reason, then there isn't much to learn and the question is useless. :)
 
There would be a reason. It's just likely to be "not enough time to get it into ES7".
 
yeah my understanding is this is an expected future feature
 
7:37 PM
github.com/tc39/proposal-top-level-await - it's Stage 4. Basically means "it's ready to go into the next release of the next spec"
 
8:11 PM
@KevinB not a union man, eh?
 
?
 
8:52 PM
sorry, a pun about string | number | boolean fell flat :)
 
yeah... i don't know anything about unions, so that's kinda, way over my head
unless you mean, like a query result union
¯\_(ツ)_/¯
 
@KevinB never looked into TS's notion of union types?
 
nope
i tend to avoid terminology and instead focus on what it does
somewhat frustrating at times, but it's how i remember it
 
ah, I see. Well, it's not much more complex than "X can be Y or Z". Untill you get into distributive conditionals where things start to get messy
 
 
1 hour later…
10:07 PM
i'm seeing SO main becoming more and more useless for new languages and frameworks
most Q&A seems to be done outside of SO
 
10:37 PM
has it ever been, though? SO is more like a long-term storage, with Q&As accumulating over time as technology matures and gains populrity - IMO, it makes sense that newer technologies do not get much traction initially
 

« first day (4170 days earlier)      last day (785 days later) »