Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to handlebars 2 #31

Open
shaunc opened this issue Jan 15, 2015 · 4 comments
Open

upgrade to handlebars 2 #31

shaunc opened this issue Jan 15, 2015 · 4 comments

Comments

@shaunc
Copy link

shaunc commented Jan 15, 2015

I am not able to use with ember 1.9 which requires handlebars 2.0. When I manually require handlebars 2.0 inside of broccoli-template-compiler/ember-template-compiler, I get an error trying to build:

Any suggestions?

$ broccoli build dist
    File: templates/autocomplete-css.js
    Error: Line 2: Unexpected identifier
        at throwError (/Volumes/Macintosh_HD/Users/shauncutts/src/other/ic-autocomplete/node_modules/broccoli-dist-es6-module/node_modules/broccoli-es6-module-filter/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:2579:21)
        at throwUnexpected (/Volumes/Macintosh_HD/Users/shauncutts/src/other/ic-autocomplete/node_modules/broccoli-dist-es6-module/node_modules/broccoli-es6-module-filter/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:2623:13)
        at expect (/Volumes/Macintosh_HD/Users/shauncutts/src/other/ic-autocomplete/node_modules/broccoli-dist-es6-module/node_modules/broccoli-es6-module-filter/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:2650:13)
        at parseArrayInitialiser (/Volumes/Macintosh_HD/Users/shauncutts/src/other/ic-autocomplete/node_modules/broccoli-dist-es6-module/node_modules/broccoli-es6-module-filter/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:2783:21)
        at parsePrimaryExpression (/Volumes/Macintosh_HD/Users/shauncutts/src/other/ic-autocomplete/node_modules/broccoli-dist-es6-module/node_modules/broccoli-es6-module-filter/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:3076:20)
        at /Volumes/Macintosh_HD/Users/shauncutts/src/other/ic-autocomplete/node_modules/broccoli-dist-es6-module/node_modules/broccoli-es6-module-filter/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:5661:38
        at trackLeftHandSideExpressionAllowCall (/Volumes/Macintosh_HD/Users/shauncutts/src/other/ic-autocomplete/node_modules/broccoli-dist-es6-module/node_modules/broccoli-es6-module-filter/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:5563:61)
        at parsePostfixExpression (/Volumes/Macintosh_HD/Users/shauncutts/src/other/ic-autocomplete/node_modules/broccoli-dist-es6-module/node_modules/broccoli-es6-module-filter/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:3214:20)
        at /Volumes/Macintosh_HD/Users/shauncutts/src/other/ic-autocomplete/node_modules/broccoli-dist-es6-module/node_modules/broccoli-es6-module-filter/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:5661:38
        at parseUnaryExpression (/Volumes/Macintosh_HD/Users/shauncutts/src/other/ic-autocomplete/node_modules/broccoli-dist-es6-module/node_modules/broccoli-es6-module-filter/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:3278:16)

    Build failed
@shaunc
Copy link
Author

shaunc commented Jan 15, 2015

In templates/autocomplete-css.js we have

import Ember from 'ember';
export default Ember.Handlebars.template([object Object]);

... so this isn't compiling correctly....

@abuiles
Copy link

abuiles commented Jan 29, 2015

@shaunc see #30 you can use my fork in the meantime, just add this to your bower "ic-autocomplete": "abuiles/ic-autocomplete#htmlbars-build",

@shaunc
Copy link
Author

shaunc commented Jan 29, 2015

Ah — great — thanks!

On Jan 29, 2015, at 1:59 PM, Adolfo Builes notifications@github.com wrote:

@shaunc https://github.com/shaunc see #30 #30 you can use my fork in the meantime, just add this to your bower "ic-autocomplete": "abuiles/ic-autocomplete#htmlbars-build",


Reply to this email directly or view it on GitHub #31 (comment).

@shaunc
Copy link
Author

shaunc commented Jan 31, 2015

@abuiles ... btw -- how should I include now?

I used to jave:

app.import('bower_components/ic-styled/main.js');
app.import('bower_components/ic-autocomplete/dist/globals/main.js');

in my Brocfile; then I could include via:

import Autocomplete from 'sheetweaver/components/ic-autocomplete'

(where "sheetweaver" is my app.) This seemed a bit odd, as the ember-cli doc said that globals would simply be available as globals (I assume component was registering itself internally somehow). Now, however, this doesn't seem to work -- the import fails. Also "Autocomplete" is not in the global namespace.

Any hints? :) ... (e.g. if I use the AMD version, what should I export?)

UPDATED (to answer my own question):

after this:

app.import('bower_components/ic-autocomplete/dist/globals/main.js');

autocomplete is available as:

ic.autocomplete.AutocompleteComponent

I don't know how/why it was working before with the "import", but now am all set with the global.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants