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
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 🌹
@david-driscoll while I have you, how are you guys shipping changes to omni server. I'm using onDidChange and its line handling is deplorable : https://github.com/TypeStrong/atom-typescript/blob/master/lib/main/atomts.ts#L182
^ or at least that's my experience.
Micah Zoltu
@MicahZoltu

@basarat What do you mean by

except for the typings stuff as I don't see the rational for that considering there is no way to have tsc send .js to one location and .d.ts to another location.

Re Microsoft/TypeScript#3147
Basarat Ali Syed
@basarat
blob
From Microsoft/TypeScript#2338 ^ I don't read typings on package.json
Basarat Ali Syed
@basarat
FWIW 4.4.0 should be a lot less flaky :rose:
Mike Graham
@cmichaelgraham
updating to 4.4.0 - thanks for all the hard work :)