Socket
Socket
Sign inDemoInstall

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.4 to 4.4.5

30

__tests__/tests.js

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

it('does not error when transpiling multiple modules with a single plugin config', function () {
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
*/
\\"precompiled(hello)\\");"
`);
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
*/
\\"precompiled(hello)\\");"
`);
});
it('passes options when used as a call expression', function () {

@@ -69,0 +99,0 @@ let source = 'hello';

@@ -0,1 +1,10 @@

## v4.4.5 (2021-03-12)
#### :bug: Bug Fix
* [#355](https://github.com/ember-cli/babel-plugin-htmlbars-inline-precompile/pull/355) Avoid sharing list of previously added imports. ([@rwjblue](https://github.com/rwjblue))
#### Committers: 1
- Robert Jackson ([@rwjblue](https://github.com/rwjblue))
## v4.4.4 (2021-02-25)

@@ -2,0 +11,0 @@

11

index.js

@@ -154,7 +154,5 @@ 'use strict';

let allAddedImports = Object.create(null);
function processModuleApiPolyfill(state) {
for (let module in allAddedImports) {
let addedImports = allAddedImports[module];
for (let module in state.allAddedImports) {
let addedImports = state.allAddedImports[module];

@@ -191,4 +189,7 @@ for (let addedImport in addedImports) {

state.allAddedImports = Object.create(null);
state.ensureImport = (exportName, moduleName) => {
let addedImports = (allAddedImports[moduleName] = allAddedImports[moduleName] || {});
let addedImports = (state.allAddedImports[moduleName] =
state.allAddedImports[moduleName] || {});

@@ -195,0 +196,0 @@ if (addedImports[exportName]) return addedImports[exportName].id;

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

@@ -16,3 +16,3 @@ "repository": "https://github.com/ember-cli/babel-plugin-htmlbars-inline-precompile",

"devDependencies": {
"@babel/core": "^7.13.1",
"@babel/core": "^7.13.10",
"@babel/plugin-proposal-class-properties": "^7.13.0",

@@ -23,3 +23,3 @@ "@babel/plugin-transform-modules-amd": "^7.13.0",

"common-tags": "^1.8.0",
"ember-source": "^3.25.1",
"ember-source": "^3.25.3",
"eslint": "^6.8.0",

@@ -26,0 +26,0 @@ "eslint-config-prettier": "^6.15.0",

@@ -16,4 +16,6 @@ module.exports.registerRefs = (newPath, getRefPaths) => {

let binding = ref.scope.getBinding(ref.node.name);
binding.reference(ref);
if (binding !== undefined) {
binding.reference(ref);
}
}
};
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