Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 15 09:28
    pasinduperera synchronize #1514
  • Oct 15 09:20
    pasinduperera synchronize #1514
  • Oct 15 09:11
    pasinduperera opened #1514
  • Oct 02 22:01
    kaiyoma opened #1513
  • Sep 30 20:20
    jfellus edited #1512
  • Sep 30 20:20
    jfellus edited #1512
  • Sep 30 20:19
    jfellus edited #1512
  • Sep 30 20:18
    jfellus edited #1512
  • Sep 30 20:18
    jfellus edited #1512
  • Sep 30 20:17
    jfellus opened #1512
  • Sep 21 09:57
    arcanis opened #1511
  • Sep 20 16:18
    reduxdj edited #1510
  • Sep 20 16:18
    reduxdj opened #1510
  • Sep 20 08:28
    mininek opened #1509
  • Aug 15 17:06
    chaffeqa opened #1508
  • Aug 08 16:07
    lierdakil closed #1507
  • Aug 08 16:07
    lierdakil labeled #1507
  • Aug 08 11:43
    rahamin1 opened #1507
  • Aug 07 12:07
    lierdakil labeled #1505
  • Aug 07 12:07
    lierdakil closed #1505
Mike Graham
@cmichaelgraham

hopefully it helps to get to see us bumping around as we experiment. it could probably be handled as a training issue. perhaps just a short section on getting started tips and tricks.

i really think once we incorporate your comments, there should be no issues with atom-typescript.

Mike Graham
@cmichaelgraham
on the topic of default exports, i hacked this together and it seems to be working:
// Type definitions for Showdown 0.3.1
// Project: https://github.com/coreyti/showdown
// Definitions by: cbowdon <https://github.com/cbowdon>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

declare module Showdown {

    /** Defined for information only - used in union type */
    interface Replace {
        /**
         * This is just the replacer function argument to String.prototype.replace, signature from lib.d.ts
         */
        replace(substring: string, ...args: any[]): string;
    }

// ... removed for brevity ...

    function forEach<T>(obj: T[], callback: (value: T, index: number, array: T[]) => any): void;
}

declare module "showdown" {
    var s: { Showdown };
    export default s.Showdown;
}
Mike Graham
@cmichaelgraham
i also edited the knockout.d.ts at the bottom to make it happy:

declare module "knockout" {
    var ko: KnockoutStatic;
    export default ko;
}
moved the KnockoutStatic inside the module declare
and replaced the = with default
Basarat Ali Syed
@basarat
@cmichaelgraham I suspect you are compiling with target system which is why you needed to make that change. If so then this inconsistency has been reported: Microsoft/TypeScript#3125
Willson Haw
@MrHayato
Hey all, just installed atom-typescript and I don't think it's working... It says all dependencies installed but none of my .ts files are color highlighted and things like autocomplete aren't working on them. Even editing and saving tsconfig.json does nothing. I've tried restarting atom and even uninstalling and reinstalling atom-typescript from command... am I missing something?
Willson Haw
@MrHayato
Figured it out. atom-typescript wasn't installing the autocomplete-plus dependency properly, had to manually apm install it and now it works..
Basarat Ali Syed
@basarat
@mrhayato : don't mind my asking which OS and which version of atom and how long did you wait. First time this has been reported :)
Basarat Ali Syed
@basarat
@mtraynham npm install tsd -g ... no need for the @next anymore.
Nelo Mitranim
@Mitranim
it's not marked as release though
on gh
Basarat Ali Syed
@basarat
sorry got it
Nelo Mitranim
@Mitranim
yeah that one
Basarat Ali Syed
@basarat
Nelo Mitranim
@Mitranim
nice
kpgarrod
@kpgarrod
I'm having trouble with lodash mixins and webpack. I've posted on SO (http://stackoverflow.com/questions/30172767/provide-lodash-with-mixins-globally-via-webpack-provideplugin) and asked in the webpack gitter, but can't find a solution
Now I'm trying to use es6-style 'extends' to add the functions
I've started with
import * as lodash from 'lodash'; class lodashExtended extends lodash{ }
but get an error cannot find name 'lodash'
is this a workable solution?
Basarat Ali Syed
@basarat

@kpgarrod

When I log '_' I see that capitalize is in fact a function on that Object.

log _.capitalize you will find it is undefined. If you only log _ you get the opportunity to see a mutated version. => if this is correct then it leads me to believe that you have a ordering issue somewhere in your code :)

kpgarrod
@kpgarrod

I can see what the problem is, but I don't know how to fix it. This is what I get in the log:

user.js:214 Lodash Object {default: function}default: function lodash(value) {VERSION: "3.8.0"add: function add(augend, addend)

I'm doing this:

import * as lodashExtended from 'lodash';
export default lodashExtended

so I see that 'export default' is adding a block around lodash(which does have my mixins mixed in)
kpgarrod
@kpgarrod

in webpack.config I add lodash like this:

lodashPlugin = new webpack.ProvidePlugin({
_: 'common/lodash_mixins'
}),

If I could just get rid of the default block, my problem would be solved
Basarat Ali Syed
@basarat

If I could just get rid of the default block, my problem would be solved

export {lodashExtended as _}

@kpgarrod ^
kpgarrod
@kpgarrod

@basarat: then what I get is an object with _ as function lodash(value) as a method. If I just use:

lodashPlugin = new webpack.ProvidePlugin({
_: 'lodash'
})

then _ is function lodash(value)

in the first case, the function has my mixins added
kpgarrod
@kpgarrod
@basarat: well, I have a solution!
in lodash_mixins I use module.exports = lodashExtended;
where lodashExtended is lodash + mixins
so now the only (minor) issue for now, is how to code that in es6 syntax?
Basarat Ali Syed
@basarat
@kpgarrod export = is not supported in es6 .... < not entirely true (you can do it if your export is not callable and only has members you access) but doesn't work well
kpgarrod
@kpgarrod
@basarat: OK, thanks very much for the help. so you are saying that my module.exports is valid in es6?
Nelo Mitranim
@Mitranim
module.exports is runtime CommonJS API, export = ... ambient definition
Oh wait maybe I misunderstand something
you do module.exports in ambient context?
kpgarrod
@kpgarrod
@mitranim, not as I understand it, but I'm a newbie to commonJS and Typescript and ES6, so I am open to correction!
Nelo Mitranim
@Mitranim
Well if you're not getting errors then module.exports and export = is fine
But this combination of export and definition is a pain to consume with external ES6 code
If you add {__esModule: true} to your CommonJS export, then import _ from 'lodash' will work fine, but right now you'll probably get TypeScript errors when trying to import it like that (TS will want you to do import * as _ from 'lodash' but this won't work at runtime)
Oh wait I'm talking about the SystemJS environment
Disregard that if you're not using it
Basarat Ali Syed
@basarat
Microsoft/TypeScript#3147 sooooish :)
David Driscoll
@david-driscoll
@basarat are you going look at taking the completions.json out of https://github.com/atom/autocomplete-atom-api to create a d.ts? I'm currently looking at it myself.
Basarat Ali Syed
@basarat
@david-driscoll nope, but great idea. The API definitions I have are enough already ;). I'm more interested in getting a better ui framework (not space pen) in place 🌹