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

babel-plugin-htmlbars-inline-precompile

Package Overview
Dependencies
Maintainers
4
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-htmlbars-inline-precompile - npm Package Compare versions

Comparing version 4.4.6 to 5.0.0

__tests__/mock-precompile.js

20

__tests__/tests.js

@@ -67,2 +67,20 @@ 'use strict';

it('supports compilation with templateCompilerPath', function () {
plugins[0][1].templateCompilerPath = require.resolve('./mock-precompile');
let transpiled = transform(
"import hbs from 'htmlbars-inline-precompile';\nvar compiled = hbs`hello`;"
);
expect(transpiled).toMatchInlineSnapshot(`
"import { createTemplateFactory as _createTemplateFactory } from \\"@ember/template-factory\\";
var compiled = _createTemplateFactory(
/*
hello
*/
precompiledFromPath(hello));"
`);
});
it('does not error when transpiling multiple modules with a single plugin config', function () {

@@ -826,3 +844,3 @@ let transpiled = transform(

contents: source,
scope: ['foo', 'bar'],
locals: ['foo', 'bar'],
});

@@ -829,0 +847,0 @@ });

@@ -0,1 +1,13 @@

## v5.0.0 (2021-03-17)
#### :boom: Breaking Change
* [#358](https://github.com/ember-cli/babel-plugin-htmlbars-inline-precompile/pull/358) Rename `scope` to `locals` for strict mode transpilation ([@pzuraq](https://github.com/pzuraq))
#### :rocket: Enhancement
* [#358](https://github.com/ember-cli/babel-plugin-htmlbars-inline-precompile/pull/358) Adds a `templateCompilerPath` option ([@pzuraq](https://github.com/pzuraq))
#### Committers: 1
- Chris Garrett ([@pzuraq](https://github.com/pzuraq))
## v4.4.6 (2021-03-17)

@@ -2,0 +14,0 @@

22

index.js

@@ -69,11 +69,7 @@ 'use strict';

let value;
if (shouldParseScope && propertyName === 'scope') {
value = parseScopeObject(buildError, name, property.value);
result.locals = parseScopeObject(buildError, name, property.value);
} else {
value = parseExpression(buildError, name, property.value);
result[propertyName] = parseExpression(buildError, name, property.value);
}
result[propertyName] = value;
});

@@ -173,2 +169,4 @@

let precompile;
let visitor = {

@@ -179,2 +177,10 @@ Program(path, state) {

if (state.opts.templateCompilerPath) {
let templateCompiler = require(state.opts.templateCompilerPath);
precompile = templateCompiler.precompile;
} else {
precompile = state.opts.precompile;
}
if (state.opts.ensureModuleApiPolyfill) {

@@ -382,3 +388,3 @@ // Setup state for the module API polyfill

let { precompile, isProduction } = state.opts;
let { isProduction } = state.opts;
let scope = shouldUseAutomaticScope(options) ? getScope(path.scope) : null;

@@ -466,3 +472,3 @@ let strictMode = shouldUseStrictMode(options);

let { precompile, isProduction } = state.opts;
let { isProduction } = state.opts;

@@ -469,0 +475,0 @@ // allow the user specified value to "win" over ours

{
"name": "babel-plugin-htmlbars-inline-precompile",
"version": "4.4.6",
"version": "5.0.0",
"description": "Babel plugin to replace tagged template strings with precompiled HTMLBars templates",

@@ -12,2 +12,7 @@ "repository": "https://github.com/ember-cli/babel-plugin-htmlbars-inline-precompile",

},
"jest": {
"testPathIgnorePatterns": [
"mock-precompile"
]
},
"dependencies": {

@@ -14,0 +19,0 @@ "babel-plugin-ember-modules-api-polyfill": "^3.4.0"

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