#flowtype

/

      • kvda joined the channel
      • sverrej joined the channel
      • msch joined the channel
      • StoneCypher joined the channel
      • glevi_ joined the channel
      • glevi has quit
      • glevi_ has quit
      • coot_ joined the channel
      • caryyon_ has quit
      • glevi joined the channel
      • caryyon joined the channel
      • glevi has quit
      • kvda has quit
      • glevi joined the channel
      • kvda joined the channel
      • StoneCypher has quit
      • ilyaigpetrov joined the channel
      • StoneCypher joined the channel
      • StoneCypher has quit
      • charliesome has quit
      • StoneCypher joined the channel
      • StoneCypher has quit
      • Raynos has quit
      • Raynos joined the channel
      • krainboltgreene has quit
      • krainboltgreene joined the channel
      • StoneCypher joined the channel
      • kvda joined the channel
      • StoneCypher has quit
      • coot_ joined the channel
      • alexx joined the channel
      • StoneCypher joined the channel
      • StoneCypher has quit
      • StoneCypher joined the channel
      • StoneCypher has quit
      • kvda has quit
      • kvda joined the channel
      • StoneCypher joined the channel
      • StoneCypher has quit
      • kvda joined the channel
      • StoneCypher joined the channel
      • charliesome joined the channel
      • StoneCypher has quit
      • Zamerick joined the channel
      • charliesome has quit
      • charliesome joined the channel
      • charliesome has quit
      • Zamerick_ joined the channel
      • charliesome joined the channel
      • Zamerick has quit
      • Zamerick joined the channel
      • charliesome has quit
      • StoneCypher joined the channel
      • StoneCypher has quit
      • charliesome joined the channel
      • charliesome has quit
      • caryyon has quit
      • StoneCypher joined the channel
      • caryyon joined the channel
      • bradleymeck joined the channel
      • StoneCypher has quit
      • ncthom91 joined the channel
      • StoneCypher joined the channel
      • coot_ joined the channel
      • StoneCypher has quit
      • bradleymeck has quit
      • gr0gg|ex joined the channel
      • StoneCypher joined the channel
      • gr0gg|ex
        flow-help:"I'm just starting w/ Flow and I'm having trouble with Flow and ES6. I have a class "Foo" which I've annotated with type requirements but when I import that file in another file it doesn't seem to be checking the type parameters. Do I need to make a separate class declaration and import that rather than annotating a plain ES6 class?"
      • alexx has quit
      • alexx joined the channel
      • Aikar
        gr0gg|ex: same project, or published lib?
      • gr0gg|ex
        Same project. I thought I should be able to just import the annotated class where I need it and it'd work but it only seems to work sometimes.
      • Aikar
        that should work yes
      • whats your flow config
      • gr0gg|ex
        Really basic. Is there a sandbox online where I could code out an example? Maybe I'll make a paste and show you the files involved in as simple a way as possible.
      • I suppose my question is, is there ever a point using ES6 where I'd import a flow type rather than an annoted exported type?
      • StoneCyp1er joined the channel
      • So using `declare export class Database` versus just using `export class Database`.
      • Aikar
        declare is for when shipping type files standalone w/o source
      • not for your actual code
      • can you paste flow config, cause it should work
      • [include]
      • <PROJECT_ROOT>/src
      • is in your .flowconfig right (to whereever source is)
      • StoneCypher has quit
      • gr0gg|ex
        Sure. I think I know what the problem is, I want to try some things first. I think it's to do with someone importing a class that does not have annotations and then declaring it a type, I think it gets treated as "any" if the imported class doesn't have annotations.
      • Yeah, someone imported a class without annotations and that was causing the problem. It looks like there is a webpacked bundle in the project that has exported classes with no annotations.
      • Aikar
        you shouldnt need to put your database in libs
      • it should be understood from the [include]
      • also ignoring node modules has annoying consequences
      • gr0gg|ex
        Alright! Let me fix that. Thank you so much for your help Aikar.
      • Alright. Both things are fixed. I seem to be on the right path. I was looking for a good example project using Flow and ES6 but there aren't many/any on the net it seems.
      • Aikar
        https://github.com/aikar/json-object not really a complex project, but heres mine (my more complex project is still closed in doors atm)
      • gr0gg|ex
        Thanks again, that's very kind.
      • alexx has quit
      • Aikar
        gr0gg|ex: how come your using module.name_mapper='@' ->'<PROJECT_ROOT>/src'
      • thats gonna cause issues using scoped packages
      • you should give it more context, like @myapp
      • so it doesnt catch EVERY @
      • bradleymeck joined the channel
      • alexx joined the channel
      • alexx has quit
      • alexx joined the channel
      • gr0gg|ex
        It's because I have a webpack alias that links @ to src.
      • Aikar
        i understand, im just warning you yuo may want to adjust that
      • otherwise any module that uses scopes wont be available to you
      • gr0gg|ex
        Hmm. If I run into issues I'll keep that in mind.
      • Aikar
        and babel is moving to @babel/ in v7, so if you use babel-polyfill...
      • gr0gg|ex
        Right. Thanks for the heads up.
      • Aikar
        i just dont bother with imports :P webstorm handles them for you!
      • and almost my entire team uses it
      • gr0gg|ex
        You mean handling imports with an alias?
      • Aikar
        no, itll provide easy options to insert the correct import statement, or lot of times automatically adds it as you are writing the code
      • jetbrains is worth every dime i spend on them