Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-htmlbars

Package Overview
Dependencies
Maintainers
2
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-htmlbars - npm Package Compare versions

Comparing version 0.7.6 to 0.7.7

utils.js

9

ember-addon-main.js

@@ -6,2 +6,3 @@ 'use strict';

var htmlbarsCompile = require('./index');
var utils = require('./utils');

@@ -31,4 +32,10 @@ module.exports = {

toTree: function(tree) {
var htmlbarsOptions = self.htmlbarsOptions();
return htmlbarsCompile(tree, htmlbarsOptions);
},
return htmlbarsCompile(tree, self.htmlbarsOptions());
precompile: function(string) {
var htmlbarsOptions = self.htmlbarsOptions();
var templateCompiler = htmlbarsOptions.templateCompiler;
return utils.template(templateCompiler, string);
}

@@ -35,0 +42,0 @@ });

11

index.js
'use strict';
var utils = require('./utils');
var Filter = require('broccoli-filter');

@@ -43,15 +44,11 @@

if (FEATURES && templateCompiler) {
for (var feature in FEATURES) {
templateCompiler._Ember.FEATURES[feature] = FEATURES[feature];
}
}
utils.initializeFeatures(templateCompiler, FEATURES);
};
TemplateCompiler.prototype.processString = function (string, relativePath) {
return 'export default Ember.HTMLBars.template(' + this.precompile(string, {
return 'export default ' + utils.template(this.options.templateCompiler, string, {
moduleName: relativePath
}) + ');';
}) + ';';
};
module.exports = TemplateCompiler;
{
"name": "ember-cli-htmlbars",
"version": "0.7.6",
"version": "0.7.7",
"description": "A library for adding htmlbars to ember CLI",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -42,1 +42,23 @@ # Ember CLI HTMLBars

```
### Precompile HTMLBars template strings within other addons
```javascript
module.exports = {
name: 'my-addon-name',
setupPreprocessorRegistry: function(type, registry) {
var htmlbarsPlugin = registry.load('template').find(function(plugin) {
return plugin.name === 'ember-cli-htmlbars';
});
// precompile any htmlbars template string via the precompile method on the
// ember-cli-htmlbars plugin wrapper; `precompiled` will be a string of the
// form:
//
// Ember.HTMLBars.template(function() {...})
//
var precompiled = htmlbarsPlugin.precompile("{{my-component}}");
}
};
```

@@ -40,3 +40,3 @@ 'use strict';

var source = fs.readFileSync(sourcePath + '/template.hbs', { encoding: 'utf8' });
var expected = 'export default Ember.HTMLBars.template(' + htmlbarsPrecompile(source) + ');';
var expected = 'export default Ember.HTMLBars.template(' + htmlbarsPrecompile(source, { moduleName: 'template.hbs' }) + ');';

@@ -58,3 +58,3 @@ assert.equal(actual,expected,'They dont match!');

var source = fs.readFileSync(sourcePath + '/web-component-template.hbs', { encoding: 'utf8' });
var expected = 'export default Ember.HTMLBars.template(' + htmlbarsPrecompile(source) + ');';
var expected = 'export default Ember.HTMLBars.template(' + htmlbarsPrecompile(source, { moduleName: 'web-component-template.hbs' }) + ');';

@@ -61,0 +61,0 @@ assert.equal(actual,expected,'They dont match!');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc