« first day (4709 days earlier)      last day (461 days later) » 

03:25
Hiya folks, just wanted to say Hi! :)
Hey Shrek
03:47
How's it down in the swamp? 😂
04:08
posted on September 07, 2023 by Harry Souders

  Hi, everyone! We've just released Chrome 117 (117.0.5938.44) for Android to a small percentage of users. It'll become available on Google Play over the next few days. You can find more details about early Stable releases here. This release includes stability and performance improvements. You can see a full list of the changes in the Git log. If you find a new issue, p

04:50
pretty stinky
2
 
2 hours later…
06:53
@Ooker 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
1 message moved to Trash can
@Ooker 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
1 message moved to Trash can
import * as esbuild from 'deno.land/x/[email protected]/…'

const result = await esbuild.build({
entryPoints: ['main.ts'],
bundle: true,
})
await Deno.writeTextFile("./out.txt", result);
I got this build script. Why does the out.txt file only have [object Object]? I know it's something about promise but I still can't get my head through it
hmm, I can get it with JSON.stringify(result), but what I want is the actual output, not a log object
 
4 hours later…
11:08
@Ooker I don't think it's about promises. result seems to be an object. And when an object is converted to a string, by default that results in the string "[object Object]"
@Ooker What is "the actual output"? If you make a request and you get an object back...that's the output. If that's supposed to be some JSON, then serialising it is correct. If you want some part of the object then you should be using the relevant part. There is no one "output" any and all objects would have.
E.g., do you need to use something like result.output? Or what should happen? What is the data you have and what do you require from it?
 
1 hour later…
12:40
in typescript how do I create a signal type?
like, I have a function that returns either a string or a special value that represents that the string is not found or a special value that represents that the strings are still loading
in normal JS, I would probably use symbols for these special cases
but they dont neatly convert to typescript's type system
13:15
@VLAZ I wonder if you have used esbuild before? When I build a ts file, the result is the js file. It seems to me that the only way to get it is to write it in a temp output file, then read it back. I can't find a way to read it right in the script
for example, if main.ts contains const π: number = 3.14, then the result is const \u03C0 = 3.14;
@Wietlol normaly I'd do this the same way as in other languages: have one routine for getString(...) returning the string and null if it wasn't found and a second routine like isPending(...) for checking if it's loading or not and if that is not an option for whatever reason you can always create a result type with discriminator
interface SuccessResult<T> {
    pending: false;
    success: true;
    item: T
}

interface PendingResult {
    pending: true;
    success: false;
    item: null
}

interface FailedResult {
    pending: false;
    success: false;
    item: null;
}

type OperationResult<T> = FailedResult | PendingResult | SuccessResult<T>
like this you could use getString(): OperationResult<string> and return either PendingResult, FailedResult or SuccessResult with the string
that looks like a massive overkill
why not just one interface?
13:35
It's only (a bit) more information for the type system so typescript can decide based on the discriminators success and pending and f.e. OperationResult does not allow pending = true and success = true or item being set when pending/failed.. so more typesafety.
of course you could also use something like interface OperationResult {pending: boolean, success: boolean, item?: string}
13:47
@Ooker I've not used esbuild, however evidently - no, that's not what the result is. You are getting an object by your own admission. Checking the types build returns BuildResult<T> and BuildResult<T> is most definitely an object.
At a glance from the types, you want result.outputFiles[0].contents or something in that region. It just says it's an array of files, not sure if you'd only have one.
14:00
@Wietlol Allows discrimination. Then at compile time you can do checks that TS will narrow for you: tsplay.dev/wX18VN An alternative of the same idea is that instead of boolean fields, you just have one field for status: tsplay.dev/wO297W Although that's not a super important choice. Depends on how you want to consume it. Both have more or less the same result.
That last one might work a bit better with enums. But I was lazy.
hmm... I still dont want to create new objects every time, as this method is going to be invoked very often
ill just stick with some const symbols and just accept that the type system doesnt know which symbols can be returned
its a private function anyway
Well, yeah - there is no great way to create what you want in TS. You can get sort of nominal typing with brands. But you can't really usefully distinguish branded primitives at runtime. Which would probably be a requirement. The branded types work as far as disallowing you to assign one to another. E.g., you can distinguish a company name from a person name and not allow cross-assigning. But no way to really distinguish which one it is at runtime.
Although that's a bit heavy handed. And you need a kind of useless identity function to assure TS the type is correct. Well, you can also use type assertion but still.
This opaque helper type is much nicer. Not as heavy handed. You can assign any string to the opaque type and once assigned it's "sealed" so you can't reassign it to a different opaque type.
 
2 hours later…
16:41
hello, i had a problem with minio client. when I use hardcoded keys like accessKey: "abcd" it works, but if i use env variables like accessKey: process.env.ACCESS_KEY, it fails to connect. What could be the reason?
@SharifMohammadAbdullah 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.
16:56
posted on September 07, 2023 by Ben Mason

Hi everyone! We've just released Chrome Beta 117 (117.0.5938.54) 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

 
1 hour later…
18:14
posted on September 07, 2023 by Ben Mason

The Dev channel has been updated to 118.0.5993.3 for Windows, Mac and Linux. A partial list of changes is available in the Git log. Interested in switching release channels? Find out how. If you find a new issue, please let us know by filing a bug. The community help forum is also a great place to reach out for help or learn about common issues. Daniel Yip Google Chrome

 
3 hours later…
21:43
||man welcome
welcome: "Welcomes a new user to the room with a message" Examples: || welcome @JBis , || welcome JBis , || welcome
||welcome @JamesBot
@@JamesBot 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.
||welcome JamesBot
@JamesBot 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.
 
2 hours later…
23:26
posted on September 07, 2023 by Ben Mason

Hi everyone! We've just released Chrome Dev 118 (118.0.5993.2) for Android. It's now available on Google Play. You can see a partial list of the changes in the Git log. For details on new features, check out the Chromium blog, and for details on web platform updates, check here. If you find a new issue, please let us know by filing a bug. Krishna Govind Google Chrome


« first day (4709 days earlier)      last day (461 days later) »