mquandalle / meteor-harmony Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] Javascript Harmony for Meteor
Home Page: http://atmospherejs.com/mquandalle/harmony
License: MIT License
[DEPRECATED] Javascript Harmony for Meteor
Home Page: http://atmospherejs.com/mquandalle/harmony
License: MIT License
Normally in meteor calling var foo = 'bar'
will create a file scoped var and foo = 'bar'
will be a package or app scope var.
Unfortunately calling class foo {}
creates a file scoped var. What should be done to make a class visible within a package and exportable to an app?
Are template literals supposed to work?
I get Unexpected token ILLEGAL
when I try it.
Looks like some work has been done around this lately but I just freshly added the harmony package and I'm getting this on the client right on the initial load.
Traceur tries to use require
to import a variable, which doesn't exist in Meteor (because all variables are already imported). Should the divergence from the Traceur documentation be talked about in the readme, or should we handle it differently @mquandalle?
I didn't know about this problem until reading @jakobdamjensen's comment in #24.
Meteor 0.9.3 introduced a new version convention for wrapper packages:
Support for "wrapped package" version numbers. There is now a _ field in version numbers. The _ field must be an integer, and versions with the _ are sorted after versions without. This allows using the upstream version number as the Meteor package version number and being able to publish multiple version of the Meteor package (e.g. [email protected]_2).
Unfortunatly we have already released v1.3.0... So for instance v0.0.66_1 will be lower than v1.3.0 even if it has been released after. Any idea how we can solve this? Is there any way to “deprecate” version so the meteor package manager don't use them? Should we start a new package from scratch?
I know this doesn't support import
, but what if I want to use a 3rd party library written in ES6 that uses import to import it's own files locally?
Exported package variables are handled differently than anything else, which results in the following (where Fibonacci
is the exported variable):
if (typeof Package === 'undefined') Package = {};
Package['harmony-example-package'] = {
Fibonacci: Fibonacci
};
Since our globals are scoped to this
, the code should instead be something like:
if (typeof Package === 'undefined') Package = {};
Package['harmony-example-package'] = {
Fibonacci: this.Fibonacci
};
I think it's almost time to get Graspy...
This is because Meteor declares your exported variables beforehand, so you never need to do it with packages. Closing this issue.
If you have a file "example.next.js", it will be compiled to a es5 compliant file called "example.next.js" as well which is source-mapped to the original "example.next.js".
This might be confusing in the browser debugger as now you can see two files with the same name, but one is the original source-map and the second is the compiled version.
Proposition: the compiled file should differ and reflect that it is a compiled version. Examples: "example.next.js" => "example.now.js" or "example.es5.js" or "example.compiled.js".
How to reproduce:
mrt create example
cd example
mv example.js example.next.js
mrt add harmony
mrt run
Expected: user can distinguish compiled vs original files
There are certain experimental features I'd like to try out. Are there any plans to allow experimental features? Are there limitations that prevent this? Or is this something you would accept pull requests for?
It is not possible to use Velocity while mquandalle:harmony is active.
Try with sanjo:jasmine.
I want to user traceur type assertions with this library, so it would be neat if there was a possibility to set config flags on the compiler. (--type-assertions, --annotations etc)
It is impossible to use markdown with this package
Steps to reproduce
{{#markdown}}I am using __markdown__.{{/markdown}}
Render page and you will receive error:
ReferenceError: require is not defined
var fs = require('fs'); ...
markdow...7164765 (line 155, col 5)
It would be nice if some docs were written for how to use this. I guess the main thing I would be confused on how to do is the path to imports
and exports. Does it just take the path to the file or is it some other pattern?
Thanks
Just made a new meteor 0.9 project and added Harmony. But it doesn't seem to support/work on 0.9 at all =(
Downgraded to 0.8.3 and it worked fine..
TypeError: Cannot read property 'name' of undefined
Maybe we should keep the Travis CI code in a feature branch until it's resolved, that way our pull requests aren't all marked as failures.
I really like your initiative, yet I am unable to use it currently since it does not play well with velocity test framework. Here are steps to reproduce:
meteor create velocityEs6Test
cd velocityEs6Test
meteor add mquandalle:harmony
meteor add sanjo:jasmine
meteor
I immediately receive following errors:
W20141010-10:12:33.498(11)? (STDERR) The file "/Users/tomi/Documents/Platforms/Learning/es6test/tests/jasmine/server/unit/package-stubs.js" has syntax errors. [TypeError: Cannot read property 'type' of null]
I renamed a file (server.js → server.next.js) and nothing seemed to be loaded... Am I missing something?
I'm having issues using PhantomJS and meteor-harmony. When I run my acceptance specs with Meteor-Capybara using PhantomJS it throws the following:
Failures:
1) Model: Project should switch projects
Failure/Error: visit root_path
Capybara::Poltergeist::JavascriptError:
One or more errors were raised in the Javascript code on the page. If you don't care about these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (see documentation for details).
TypeError: 'undefined' is not a function (evaluating 'ModuleStore.register.bind(ModuleStore)')
TypeError: 'undefined' is not a function (evaluating 'ModuleStore.register.bind(ModuleStore)')
at http://localhost:3000/packages/harmony.js?d3d1f36ffdf75eff955aee4cc92356d83062d3ce:898
at http://localhost:3000/packages/harmony.js?d3d1f36ffdf75eff955aee4cc92356d83062d3ce:907
at http://localhost:3000/packages/harmony.js?d3d1f36ffdf75eff955aee4cc92356d83062d3ce:2135
at http://localhost:3000/packages/harmony.js?d3d1f36ffdf75eff955aee4cc92356d83062d3ce:2142
Is there anything I can do on my end? Currently i'm using the Chrome browser instead of PhantomJS to get them to run. There's a similar issue filed on Traceur issue 908 but i'm not sure how it applies to Meteor-Harmony
Meteor v1.2 will include official ES6 support using the BabelJS transpiler. MDG put a fair amount of work on ES6 integration, including the work on a new compiler API that allow for more powerful and efficient meteor plugins.
I propose to deprecate this mquandalle:harmony
package in favour of the new official ecmascript
package.
Is their any feature we will miss by moving from traceur to babel? Or is there any other reason to keep this package (and upgrade it to use the new compiler API, which is quite a bit of work)? What do you think @christianbundy?
At some point Harmony will become standard in most browsers, making ".next.js" seem a little weird. It would be nice to have an option to just compile all files.
Meteor's new packaging release uses a '+' to tack a build id onto each package version. It looks to see if a build id exists by checking for the '+' and throws this error if it finds one.
version already has a buildid?
So good work getting the version number into the package.js but bad luck that the versioning chosen errors. I fixed it by making the '+' a '-' in my local version.
Can't seem to start my project now. :(
Why-Not:storm alpjor$ meteor --settings config/settings.json
[[[[[ ~/Documents/Code/bolt/storm ]]]]]
=> Started proxy.
=> Started MongoDB.
/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173
throw(ex);
^
TypeError: Cannot read property 'length' of undefined
at Map.size (/Users/alpjor/.meteor/packages/mquandalle_harmony/.1.3.79.vsi28k++os+web.browser+web.cordova/plugin.compileHarmony.os/npm/compileHarmony/node_modules/traceur/bin/traceur.js:1254:27)
at /Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/node_modules/emissary/node_modules/property-accessors/node_modules/harmony-collections/harmony-collections.js:719:27
at initialize (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/node_modules/emissary/node_modules/property-accessors/node_modules/harmony-collections/harmony-collections.js:317:38)
at /Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/node_modules/emissary/node_modules/property-accessors/node_modules/harmony-collections/harmony-collections.js:716:3
at Object.<anonymous> (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/node_modules/emissary/node_modules/property-accessors/node_modules/harmony-collections/harmony-collections.js:793:2)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/node_modules/emissary/node_modules/property-accessors/lib/property-accessors.js:8:54)
at Object.<anonymous> (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/node_modules/emissary/node_modules/property-accessors/lib/property-accessors.js:74:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/node_modules/emissary/lib/behavior.js:9:23)
at Object.<anonymous> (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/node_modules/emissary/lib/behavior.js:120:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/node_modules/emissary/lib/helpers.js:5:14)
at Object.<anonymous> (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/node_modules/emissary/lib/helpers.js:55:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/node_modules/emissary/lib/emissary.js:4:13)
at Object.<anonymous> (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/node_modules/emissary/lib/emissary.js:14:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/lib/file.js:12:18)
at Object.<anonymous> (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/lib/file.js:384:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/lib/main.js:203:18)
at Object.<anonymous> (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/pathwatcher/lib/main.js:207:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.watch (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/safe-pathwatcher.js:27:5)
at [object Object]._.extend._watchFileOrDirectory (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/watch.js:417:35)
at /Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/watch.js:384:14
at Function._.each._.forEach (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
at [object Object]._.extend._startFileWatches (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/watch.js:379:7)
at new Watcher (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/watch.js:309:8)
at [object Object]._.extend._runOnce (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/run-app.js:653:23)
at [object Object]._.extend._fiber (/Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/run-app.js:758:28)
at /Users/alpjor/.meteor/packages/meteor-tool/.1.0.37.1ovh56a++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/run-app.js:365:12
Why-Not:storm alpjor$ mate /Users/alpjor/.meteor/packages/mquandalle_harmony/.1.3.79.vsi28k++os+web.browser+web.cordova/plugin.compileHarmony.os/npm/compileHarmony/node_modules/traceur/bin/traceur.js
I'm getting the above error on running my code, but if I clone my repo (not copying the .meteor
, .build
, or .npm
folders) and retry it works. Here's a screenshot of the error:
You can reproduce this bug with:
this.foo = 'bar';
This happens because Traceur wraps the code in module.exports = function () { ... }
, and module.exports
doesn't exist in Meteor. I've written #16 to resolve this.
Traceur enables default argument from ec6 but I got an unexpected token error for "=" in
var name = function(a = 1){ }
while building my package for test.
(I tried building it with a lower meteor version but still got the error.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.