Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 05:09
    ms747 closed #36203
  • 04:24
    typescript-bot opened #36281
  • 03:20

    DanielRosenwasser on missing3.2Prs

    (compare)

  • 03:20

    DanielRosenwasser on fixLibToIterableAndES5

    (compare)

  • 03:19

    DanielRosenwasser on getRidOfCrappyLiterals

    (compare)

  • 03:18

    DanielRosenwasser on allowImplicitAnyForAccessorsInDts

    (compare)

  • 03:18
    DanielRosenwasser labeled #36278
  • 03:15
    DanielRosenwasser review_requested #36280
  • 03:15
    DanielRosenwasser review_requested #36280
  • 03:15
    DanielRosenwasser review_requested #36280
  • 03:15
    DanielRosenwasser edited #36280
  • 03:14
    DanielRosenwasser opened #36280
  • 03:13

    DanielRosenwasser on noimplicitany-private-ambient-getter-3.6

    Fix noImplicitAny check on ambi… (compare)

  • 03:03

    DanielRosenwasser on allowImplicitAnyForAccessorsInDts

    Fix scripts. Update test to check for privat… Accepted baselines. and 2 more (compare)

  • 02:22
    DanielRosenwasser review_requested #36279
  • 02:22
    DanielRosenwasser review_requested #36279
  • 02:22
    DanielRosenwasser opened #36279
  • 02:22
    DanielRosenwasser review_requested #36279
  • 02:08
    BenLorantfy opened #36278
  • 02:03

    DanielRosenwasser on alwaysBeEmittingAny

    Always emit `any` in private ge… Accepted baselines (compare)

Keith Layne
@keithlayne
sorry, got a meeting for now
Thanzex
@Thanzex
yup, using webpack
sorry, forgot to add
Keith Layne
@keithlayne
yeah I never really use any bundlers on npms. I can imagine some use cases, but I generally let the consumer decide if/how to bundle.
Bruce Pascoe
@fatcerberus
You can't do export from with isolatedModules afaik
With that setting on the compiler is basically looking at each file individually so it's not able to thread the types through
Since you're using webpack I recommend disabling isolatedModules and using ts-loader
Then webpack will compile the TS directly as part of the build
No need for a pre-transpile step
Andrew Hodges
@betawaffle
Is there a reason something like this isn't in lib.es5.d.ts? https://gist.github.com/betawaffle/98f10203a9d97eb43e64468488b3df9a
AnyhowStep
@AnyhowStep
The TS team tends to shy away from using generics and conditional types in the lib.d.ts files, from my experience
Andrew Hodges
@betawaffle
has anybody made a library with extensions like that to get more type information out?
another thing i'd like to see would be the ability to replace any with unknown in a lot of places
like maybe a compiler option to treat any the same as unknown?
Keith Layne
@keithlayne
I'd like that, it wouldn't break some things, but sadly there are places where you need any and unknown wouldn't work.
Andrew Hodges
@betawaffle
yeah, so maybe just putting it in more places in the stdlib, or having an alternate set of libs (or extra lib) which replaces most of the any with unknown
though i'm curious, where is any really needed besides just being a shortcut?
Keith Layne
@keithlayne
that seems like the only reasonable way, they'd never make it a required change because of all the breakage it would cause.
I think @webstrand had an example.
It had to do with variance.
There may be other more common cases.
since any is one half unknown and one half never I imagine there are a lot of things that could break by substituting unknown.
webstrand
@webstrand
Looks like I didn't save that example to my gists, you'll have to search for it in chat history :unamused:
Keith Layne
@keithlayne
You remember though, right? Something with classes.
webstrand
@webstrand
very vaguely, we're talking about a place where any has to be used instead of unknown?
Keith Layne
@keithlayne
We could take bets on whether or not gitter search would find it.
yeah
webstrand
@webstrand
Oh! I forgot, I have a logger running. I'll see if I can find it
Particularly, existential types in both input and output positions
You can't just use unknown
unknown is good for output only usage. never is good for input only usage. The existential type is good for both. But since it isn't implemented yet, we use any as a hack-y workaround in most cases
Keith Layne
@keithlayne
cue @fatcerberus to talk about his toy language, been a while for that
AnyhowStep
@AnyhowStep
I'm wondering if I'll give up on my SQL query builder first, or if he'll give up on his toy language first
Bruce Pascoe
@fatcerberus
I'd love to talk about it, but despite my fascination with existential types nothing is coming to mind that's relevant
On an unrelated note, I just discovered this issue and am amused by it: microsoft/TypeScript#34608
"I want to use the C preprocessor with typescript, please add core support for this feature that will help with this totally normal use case"
Keith Layne
@keithlayne
you had a name for your existential top/bottom type though, you used to mention it every day
webstrand
@webstrand
I use GPP when I feel the need to use a preprocessor. Unlike CPP, it's turing-complete!
and works with any language
Bruce Pascoe
@fatcerberus
Was it my question types? Foo<?> is a Foo<T> where the T is existential
Keith Layne
@keithlayne
yeah
Bruce Pascoe
@fatcerberus
Okay yeah, the special trick with that was that you could extract the type and then pretend you know it, like an inside-out generic:
let foo: List[?] = someList.  // question type
let firstItem: T in foo = foo::first().  // existential
But I need to put some more thought into that to ensure it's sound in the face of e.g. reassignment
Bruce Pascoe
@fatcerberus
Say foo is a List[int] and you later reassign it as List[string], now the original T in foo is no longer valid
I had opened this issue about it but then I got bored and never figured it out :stuck_out_tongue_closed_eyes: fatcerberus/tuffle#1
Keith Layne
@keithlayne
Speaking of first-world problems, I was just cleaning my white mac keyboard with some water and a Jimmy John's napkin, and the ink got on the space bar and I can't get it all off. Plus it took like 30 minutes for them to bring my sandwich. Woe is me.
Bruce Pascoe
@fatcerberus
Apple started the trend of white electronics, I kind of hate it. I'm forever wiping dirt and smudges off my AirPods case
Keith Layne
@keithlayne
Life is hard.
Bruce Pascoe
@fatcerberus
It's hard and nobody understands.
Orta
@orta
well, you can pay more nowadays to get a pro keyboard and mouse ;)