meteor - Is there any way to disable var scoping? -
the file-level javascript variable scoping introduced in meteor 0.6.0 breaks projects , packages written in typescript (and coffeescript , other transpilers). there way disable it?
for example, typescript code:
declare var meteor: any; module model { export var players = new meteor.collection('players'); }
generates javascript no longer works because model no longer considered global:
var model; (function (model) { model.players = new meteor.collection('players'); })(model || (model = {}));
prepending this.model = null;
workaround it's redundant , have apply code used meteor (it's broken @ least 1 of meteorite packages).
what reason introducing meteor specific javascript language semantics?
its bit nice way because before having these files sharing variables bit odd. meteor treated every javascript file if one. having larger projects (>20 js files) made difficult modularize application
i'm not sure typescript it's suggested use @
make global before declaring in coffeescript on @ : http://docs.meteor.com/#coffeescript, perhaps there similar in typescript? (the @
comes coffeescript)
@myfunction = -> 123
Comments
Post a Comment