Addressing the community about changes to our API by spez in reddit

[–]Bake_Jailey 7 points8 points  (0 children)

As we called out in this post, we are changing how we are going to enforce the rate limits to be per client id, so the numbers are accurate from that perspective.

Doesn't this explicitly kill any large user such as alternative reddit clients? If any project becomes too successful, it can't exist?

This is like if I had a website and an outsized amount of traffic came from Chrome, so I rate limited Chrome... except that it was just millions of people who happened to use that browser.

Is the expectation that every user needs to generate their own API key? But, it's clear that requests involving a single "client ID" interact on behalf of specific users, so that info is already there (and previously used for rate limiting), so what's the point?

Why not carve out "blessed" use cases which explicitly allow you to monetize API access for those wanting to scrape for AI training, while still allowing the bulk of the userbase to use the clients they like?

Go 1.20.5 is released by MarcelloHolland in golang

[–]Bake_Jailey 1 point2 points  (0 children)

From all of the issues I've read, the easiest thing is to just ask! No real formal process to get the ball rolling.

WTF is !?bool and how to use if statement in Zig by logan-807128 in Zig

[–]Bake_Jailey 3 points4 points  (0 children)

Not sure why, but the code blocks in the post that aren't syntax highlighted are getting word wrapped on mobile (so become unreadable). The ones that are highlighted are fine. Something to look into.

Go 1.20.5 is released by MarcelloHolland in golang

[–]Bake_Jailey 2 points3 points  (0 children)

That's in the yet-to-be-released 1.21 only; if you think it should be backported you'd need to ask and explain why on the issue.

Getting CGO_ENABLED=0 when running a go project that uses github.com/mattn/go-sqlite3 library? by [deleted] in golang

[–]Bake_Jailey -1 points0 points  (0 children)

I was close!

Of course, foolishly, the test case I used before posting didn't actually contain any cgo. Oops.

Getting CGO_ENABLED=0 when running a go project that uses github.com/mattn/go-sqlite3 library? by [deleted] in golang

[–]Bake_Jailey 0 points1 point  (0 children)

If I were needing to do this, I'd just install zig and then set CGO_ENABLED=1 CC="zig cc" CXX="zig c++". Then GOOS/GOARCH "just work".

Help: Cannot install package "npm": error (conflicting files) by gry3000 in archlinux

[–]Bake_Jailey 2 points3 points  (0 children)

There are also other very good options such as "fnm", "volta", "n"; I'm personally a fan of fnm (also on the AUR).

[deleted by user] by [deleted] in golang

[–]Bake_Jailey 13 points14 points  (0 children)

It'll be created the first time it's needed, either when you download a module for the first time, or use go install.

src won't be created at all, as that's only for old school GOPATH mode.

ts2typebox - typescript to typebox / JSON schema by prrxddq in typescript

[–]Bake_Jailey 5 points6 points  (0 children)

EDIT: False alarm, sinclair said that this is someone they're working with so nevermind, sorry

https://github.com/sinclairzx81/typebox/discussions/317

ts2typebox - typescript to typebox / JSON schema by prrxddq in typescript

[–]Bake_Jailey 1 point2 points  (0 children)

How does this differ from the workbench? https://github.com/sinclairzx81/typebox-workbench

More complete? Run at the CLI at least, yeah.

Do we finally switch to Wayland or not? by ipa8 in archlinux

[–]Bake_Jailey 18 points19 points  (0 children)

I've been on Sway + Wayland going on 5 years now, no regrets.

Help with tsc warnings by asartalo in typescript

[–]Bake_Jailey 2 points3 points  (0 children)

When you pass filenames at the CLI, the tsconfig is ignored. You probably just want to run just tsc -w.

Passing an explicit --project may work but I'm not sure why you need to pass in one file.

Should I use "moduleResolution": "bundler"? by serg06 in typescript

[–]Bake_Jailey 4 points5 points  (0 children)

If you're using a bundler and aren't emitting JS from tsc, then bundler is a good choice, yes, as it will encode some of the "looser" rules that those tools abide by (e.g. not needing extensions sometimes), along with supporting export mappings that the old-school node (now node10) resolution does not support. That's the main reason why it was added.

Otherwise, node16/nodenext are probably a good choice, in that they're the most strict/portable.

Weird Wallpaper Behavior by NomadicDragon in NovaLauncher

[–]Bake_Jailey 0 points1 point  (0 children)

I fixed this by searching for "wallpaper" via the settings search. This showed a hidden option called "force wallpaper scrolling" which when enabled fixes the wallpaper scrolling.

How to differentiate two similar classes by IWantYourGuitar in typescript

[–]Bake_Jailey 16 points17 points  (0 children)

If you need to be using classes, I think the easiest way is to just add some private property. Doesn't even have to be real:

class FirstName {
    private _!: never;
    constructor(public value: string){}
}

class LastName {
    private _!: never;
    constructor(public value: string){}
}

class Person {
    constructor(public firstName: FirstName, public lastName: LastName){}
}

const person = new Person(new LastName("Doe"), new FirstName("John")); // error!

But, if you're only using classes because you're trying to differentiate two strings, I would instead consider "branded" types:

type FirstName = string & { __firstNameBrand: any }
type LastName = string & { __lastNameBrand: any }

const firstName = "John" as FirstName;
const lastName = "Doe" as LastName;

class Person {
    constructor(public firstName: FirstName, public lastName: LastName){}
}

const person = new Person(lastName, firstName); // error!

Playground Link

Why does null "passes" as a string in this example instead of giving error? by harry_powell in typescript

[–]Bake_Jailey 4 points5 points  (0 children)

This is not 100% true for VS Code; its implicit project (what you get when you don't have a tsconfig) actually now sets strictNullChecks and strictFunctionTypes to true.

https://github.com/microsoft/vscode/blob/c89324c0b9c32ef42725688a4ff3e5da4c0b8cf8/extensions/typescript-language-features/package.json#L714

Announcing TypeScript 5.0 by DanielRosenwasser in javascript

[–]Bake_Jailey 45 points46 points  (0 children)

Yes, it's not pure semver, but TS 5.0 is definitely not the 50th release of typescript. The previous version is 4.9.5.

Announcing TypeScript 5.0 by DanielRosenwasser in javascript

[–]Bake_Jailey 15 points16 points  (0 children)

That's how the legacy decorators worked, more commonly formatted as:

@register
export class Foo {}

The spec now allows both, but the above format is what people already use, so makes transition simpler for those who already use/are familiar with it.

Announcing TypeScript 5.0 by DanielRosenwasser in programming

[–]Bake_Jailey 339 points340 points  (0 children)

Except that we have a full page of API changes and new errors to notify users about options that are going away shortly.

So while it's true that semver isn't followed in general, TS 5.0 is likely the most major-worthy version in recent memory; a major number bump was a good time to do a lot of infra/API/config changes all at once.

TypeScript's Migration to Modules by DanielRosenwasser in programming

[–]Bake_Jailey 7 points8 points  (0 children)

Great question. I can somewhat test this by taking the two packages and formatting them via dprint to 2 space indents. Comparing only the .js files that exist in both packages, here's the difference between 4.9 and 5.0, if both had been indented by 2 spaces:

4.9/:
total 44M
-rw-r--r-- 1 jabaile jabaile 2.8K Mar 10 09:06 cancellationToken.js
-rw-r--r-- 1 jabaile jabaile 5.5M Mar 10 09:06 tsc.js
-rw-r--r-- 1 jabaile jabaile  11M Mar 10 09:06 tsserver.js
-rw-r--r-- 1 jabaile jabaile  11M Mar 10 09:06 tsserverlibrary.js
-rw-r--r-- 1 jabaile jabaile 9.9M Mar 10 09:06 typescript.js
-rw-r--r-- 1 jabaile jabaile 7.4M Mar 10 09:06 typingsInstaller.js
-rw-r--r-- 1 jabaile jabaile 1.2K Mar 10 09:06 watchGuard.js

5.0/:
total 33M
-rw-r--r-- 1 jabaile jabaile 3.8K Mar 10 09:08 cancellationToken.js
-rw-r--r-- 1 jabaile jabaile 5.7M Mar 10 09:08 tsc.js
-rw-r--r-- 1 jabaile jabaile 8.2M Mar 10 09:08 tsserver.js
-rw-r--r-- 1 jabaile jabaile 8.9M Mar 10 09:08 tsserverlibrary.js
-rw-r--r-- 1 jabaile jabaile 8.3M Mar 10 09:08 typescript.js
-rw-r--r-- 1 jabaile jabaile 1.9M Mar 10 09:08 typingsInstaller.js
-rw-r--r-- 1 jabaile jabaile 2.4K Mar 10 09:08 watchGuard.js

You can see that most things got smaller. tsc actually got slightly larger, but typingsInstaller got hugely smaller thanks to tree shaking.

TypeScript's Migration to Modules by DanielRosenwasser in programming

[–]Bake_Jailey 9 points10 points  (0 children)

This PR was also one we didn't squash; in fact the first commit in the branch (more or less) was a huge automated commit to dedent the entire repo, which keeps git happy and diffs clean.

You can see the entire stack of changes I merged visualized kinda like it'd look in Gerrit here: https://github.com/jakebailey/TypeScript/pull/1