Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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
  • Aug 06 21:51
    TheEmrio closed #1506
  • Aug 05 14:22
    TheEmrio opened #1506
  • Jul 15 15:40
    Xapphire13 closed #1496
  • Jul 10 13:23
    akonwi opened #1505
  • Jul 10 04:44
    nelson6e65 edited #1504
  • Jul 10 04:40
    nelson6e65 opened #1504
  • Jul 08 06:40
    sshquack closed #846
  • Jun 17 16:02
    akonwi opened #1503
  • Jun 02 18:18
    tanfonto opened #1502
  • May 28 17:11
    jazzdragon opened #1501
  • Apr 29 01:12
    dyping closed #1500
  • Apr 28 06:56
    dyping edited #1500
  • Apr 28 06:54
    dyping edited #1500
  • Apr 26 11:38
    dyping opened #1500
kpgarrod
@kpgarrod
ah! export {default as Controller1} from './controller1';
Basarat Ali Syed
@basarat
my export statement was meant to go inside controller1. But whatever works :rose:
kpgarrod
@kpgarrod
I see I was using export default in Controller1. If I just use export Controller1 then I can re-export
Microsoft/TypeScript#2726
@basarat: Thanks for the help anyway
Nelo Mitranim
@Mitranim
default exports are more of a carryover from cjs
In ES6, you nearly always want to use named exports
Basarat Ali Syed
@basarat

In ES6, you nearly always want to use named exports

I also find them much easier to refactor ;)

kpgarrod
@kpgarrod
thanks for the advice
kpgarrod
@kpgarrod
how do you change the indentation (number of spaces) for formatting?
kpgarrod
@kpgarrod
perfect! thanks
how do you run a command: Typescript: Dependency View?
Basarat Ali Syed
@basarat
@kpgarrod ctrl + shift + p and type in dependency view
kpgarrod
@kpgarrod
wow! that is very cool :)
Mike Graham
@cmichaelgraham

@basarat :point_up: atom-typescript notes you are awesome :+1:

@AshleyGrant and I will make sure we incorporate these tips into the more polished subsequent versions of the :point_up: video chat

Basarat Ali Syed
@basarat
Thanks for your kindness. I need to work to make it easier to display the package's world view of files (which tsconfig, which file names etc etc.)
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!