Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 19:52
    typescript-bot synchronize #35631
  • 19:22
    andrewbranch synchronize #15575
  • 19:22
    andrewbranch synchronize #28460
  • 19:22
    andrewbranch synchronize #31641
  • 19:21

    andrewbranch on master

    Improve some completions on gen… (compare)

  • 19:21
    andrewbranch closed #34855
  • 19:21
    andrewbranch closed #34825
  • 18:56
    andrewbranch labeled #35632
  • 18:56
    andrewbranch milestoned #35632
  • 18:56
    andrewbranch labeled #35632
  • 18:56
    andrewbranch labeled #35632
  • 18:56
    andrewbranch assigned #35632
  • 18:56
    andrewbranch opened #35632
  • 18:51
    sheetalkamat synchronize #33287
  • 18:51

    sheetalkamat on solutionProjects

    Fix spelling codefix for option… Issue/34870 (#35586) * Add new… Move executeCommandLine.ts into… and 6 more (compare)

  • 18:32
    typescript-bot opened #35631
  • 18:31
    RyanCavanaugh milestoned #35390
  • 18:31
    RyanCavanaugh assigned #35390
  • 18:31
    RyanCavanaugh labeled #35390
  • 18:31
    RyanCavanaugh unlabeled #35390
Thanzex
@Thanzex
i do have many more files that contain only interfaces without the *.d.ts file and they work fine with this setup
Keith Layne
@keithlayne
are you writing in mixed js/ts?
Thanzex
@Thanzex
nope, only ts, but the package started as a normal js one
Keith Layne
@keithlayne
if you have tsc emit your declarations you shouldn't have a problem I think.
Unless it's something weird that I don't understand, which is totally possible.
what I was getting at is that tsc will generate a .d.ts per .ts file, and they'll reference each other just like the JS files.
I'm still not clear if you're writing those declarations by hand or not.
Thanzex
@Thanzex
in the issue that i referenced i foud out about isolatedModules. Apparently if you declare a constant in a file and export it, export it fro another file again like export { foo } from './bar' it's like the declaration doesn't exist
it was all done by hand
Keith Layne
@keithlayne
yeah you shouldn't do that, especially when tsc can do it for you. Why isolatedModules? Using babel or something?
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