Closed taras closed 7 years ago
Related https://github.com/emberjs/ember.js/issues/12114 but for us this might be quiet problematic. Thoughts?
I believe it's possible to turn let into a class helper. Let me know if you'd like me to look into this.
I believe it's possible to turn let into a class helper. Let me know if you'd like me to look into this.
There is no way to support the block param yielding with a class based helper.
Thank you Robert.
Since the helper registration is not tied to the container/registry of the app being booted, it doesn't really need to exist in an initializer at all. One possible solution would be to have a simple vendor/ember-let/register.js
file that does something (pseudo code) like this:
var registerHelper = Ember.__loader.require('ember-htmlbars/helpers').registerHelper;
var letKeywordModule = require('ember-let/-private/keyword').default; // => we would need to move the keyword implementation here
registerHelper('let', letKeyword);
Then we do this from the included
hook:
app.import('vendor/ember-let/register.js');
@rwjblue I created a WIP PR with your suggestion. It's not working at the moment because it seems that the vendor file is loaded before ember-let modules become available. Any idea why this might be?
Version of ember-let: 0.4.0
Ember Version / Ember CLI Version
Ember Version: any Ember CLI Version: 2.7.0
Expected Behavior
When using
let
helper in an addon, consumers of the addon should not have to know how my addon is created to do integration testing.Actual Behavior
Integration tests fail with
Error: Assertion Failed: A helper named "let" could not be found
becauselet
helper is not initialized.Steps To Reproduce:
Ember Twiddle / Example repo / Failing test:
Please create a reproduction of your bug with this ember-twiddle. This is extremely helpful and speeds up the debugging process.