Ember: camelCase helper references not recognised - ember.js

I upgraded Ember CLI from 2.4.6 to 2.8.0. After this, the helpers referred by camelCase names in the template are throwing the error Assertion Failed: A helper named "helperName" could not be found. If I change the references to helper-name from helperName, things work fine.

Related

Ember's HTMLBars Compiler Error: Unexpected token export

I've inherited an Ember application at v1.8.1. I have successfully upgraded the application to v.1.9.1, and would like to continue to update it to at least v1.13.8.
In my v1.10.1 build, it appears that the ember-template-compiler is not quite meshing with Ember and am getting the following errors in the console:
Uncaught SyntaxError: Unexpected token export
Uncaught TypeError: Cannot read property 'name' of undefined
The line erroring for the 'name' error is:
set(appController, 'currentRouteName', infos[infos.length - 1].name);
infos is empty... so it doesn't have an object to call name on.
I'm looking for some direction in how to better track down the error, and what needs to be done to successfully upgrade.
The project is using broccoli (but not ember cli), so i'm trying to make the ember-cli-htmlbars plugin work.
Is there a better way to compile HTMLBars for Ember v1.10.1?
Should I transition the project over to Ember cli?
Please let me know what code you need would need to see.

MVC RazorGenerator - “Type (…) already defines a member called 'Execute' with the same parameter types”

I've been working on a big MVC Application and now i need to improve application's startup performance (which is bad +1min for the first load).
I installed RazorGenerator nugget and the extension too, but when i compile a lot of errors appear.
May this be caused by not specifying the Generator Type?
Because i didn't find their documentation very helpful about this.
Or maybe because i added the following directive to one of my views (_EditHelperPage.cshtml) because it was rendering as HelperPage instead of WebViewPage:
#* Generator: MvcView *#
After i remove this line and adding it to razorgenerator.directives, it throws me another error:
Edit
And if i search for a class/constructor with the same name, it find results in /obj/CodeGen/(...)
I found the problem.
Before i installed the VS Extension RazorGenerator (not the nugget!), i installed RazorGenerator.MsBuild which does the same as the extension but on build time (right?).
But why was it happening?
I think that the extension builds views before MsBuild, however they were doing the same and therefore creating duplicated .cs files
I just unistalled .MsBuild package and voilá, it works.

How to fix 'Microsoft' is not defined in Ember CLI Bing Map?

In an Ember CLI project, I managed to get the old 'bing-maps-element' working as a Component, but jshint and unit tests complain that "'Microsoft' is not defined". The Microsoft object is a global loaded by a 'veapicore' script (Virtual Earth API) after after the Ember Component tries to reference it, but it actually works OK at runtime.
I tried to install the 'ember-cli-bing-map' addon, thinking it might better integrate this global reference but I got a 'not a properly formatted package' error with it so had to remove it.
How can I resolve these problems?
You need to specify the global variables in .jshintrc file.
Add Microsoft to the predef array in the file and your jshint errors should go away.

Keep geeting errors when I use razor views for the updated Hot Towel Template

I am using the upgraded version of Hot Towel template which has new versions of Durandal, Knockout, Breeze, etc. for a Single Page Application. This process works fine with the older version but not the newest.
This is the error I get:
Unhandled exception at line 93, column 13 in [http://servername:50921/Scripts/durandal/viewEngine.js]
0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'length': object is null or undefined
I have changed the convention for the viewLocator in the main to use my ViewController.
viewLocator.useConvention('viewmodels', '../../view');
viewEngine.viewExtension = '/';
This use to work fine in the previous version of Hot Towel Template.
Please any ideas for the errors... will be grateful for any.
Thanks.

Playframework 2.1 precompiling ember handlebars

I'm trying to write an SBT plugin for PlayFramework 2.1 which would precompile handlebars templates located in app/assets/templates. I will of course share this plugin when it is complete. I found this howto http://eng.netwallet.com/2012/04/25/emberhandlebars-template-precompilation-with-play/ which was a little outdated, but it was no problem adapting it for Play! 2.1.
Then I tried to compile a simple template file, but SBT failed with the following:
ember: processing template test
[error] /.../templates/test.handlebars: Compilation error[unexpected exception during Ember compilation (file=/.../templates/test.handlebars, options=List(), ember=ember-1.0.0-pre.4.js): org.mozilla.javascript.EvaluatorException: missing name after . operator (ember-1.0.0-pre.4.js#3309)]
[error] (MyProject/*:play-copy-assets) #6dap83075: Compilation error in /.../templates/test.handlebars:null
[error] (MyProject/compile:resources) #6dap83075: Compilation error in /.../templates/test.handlebars:null
ember-1.0.0-pre.4.js at line 3309 has a volatile keyword, which is apparently reserved in Rhino.
I'm far from an expert in Rhino, which is why I'm wondering if someone knows of a way to work around this? I'm not looking for a 5* solution right now. Any solution (even quick and dirty hacks like using a custom ember.js) that has a reasonable chance of working for most simple handlebars templates would work and we'd worry about polishing it once the functionality is there and the SBT plugin is out.
Thanks in advance!
I wrote an equivalent plugin for Grails. I get the exact same error if I switch from rhino 1.7R4 to 1.7R2.
You have to switch to org.mozilla:rhino:1.7R4.
If you encounter further issues, I suggest you take a look at my source code. You can start here: https://github.com/florent-blanvillain/grails-ember-templates-precompiler/blob/master/src/groovy/org/grails/plugin/ember/handlebars/Precompiler.groovy
Cheers
This is due to ember using the keyword volatile which is reserved for rhino, as it conforms to JavaScript EC3. Setting rhino to use EC5 has no effect
See https://github.com/emberjs/ember.js/issues/1202
This is even worse in ember-1.0.rc1 as they are using other reserved keywords.
A solution is to do a custom ember.js file with those keywords renamed
My plugin for ember precompilation in play 2.1 is working. It supports ember-1.0.0-pre.2, ember-1.0.0-rc.1 and ember-1.0.0-rc.3 and works around the issues related to rhino.
See
https://github.com/krumpi/play-emberjs

Resources