Babel plugin to replace tagged template strings with precompiled HTMLBars templates
Installations
npm install babel-plugin-htmlbars-inline-precompile
Developer
ember-cli
Developer Guide
Module System
Unable to determine the module system for this package.
Min. Node Version
10.* || >= 12.*
Typescript Support
No
Node Version
14.18.1
NPM Version
7.21.1
Statistics
9 Stars
523 Commits
21 Forks
11 Watching
26 Branches
35 Contributors
Updated on 23 Aug 2022
Bundle Size
139.07 kB
Minified
32.42 kB
Minified + Gzipped
Languages
JavaScript (89.45%)
TypeScript (10.55%)
Total Downloads
Cumulative downloads
Total Downloads
97,283,198
Last day
-12.2%
40,118
Compared to previous day
Last week
-11.8%
217,216
Compared to previous week
Last month
21.9%
1,024,853
Compared to previous month
Last year
-2.5%
14,528,155
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
5
Dev Dependencies
21
⚠️ Archived ⚠️
This library has been superceded by babel-plugin-ember-template-compilation and ember-template-imports.
Depending on a consumer's ember-source version, ember-cli-htmlbars will select whether to use babel-plugin-htmlbars-inline-precompile
or babel-plugin-ember-template-compilation
- based on this code -- i.e: after ember-source@3.27.0-alahpa.1
, only babel-plugin-ember-template-compilation
will be used.
At the time of archiving this repo, ember-source@3.x
is not under LTS
babel-plugin-htmlbars-inline-precompile
Babel plugin to replace tagged .hbs
formatted strings with a precompiled version.
Requirements
- Node 8+
- Ember 2.10+
- Babel 7
Usage
Can be used as either a normal function invocation or a tagged template string:
1import hbs from 'htmlbars-inline-precompile'; 2 3hbs`some {{handlebarsthingy}}`; 4hbs('some {{handlebarsthingy}}');
When used as a normal function invocation, you can pass additional options (e.g. to configure the resulting template's moduleName
metadata):
1import hbs from 'htmlbars-inline-precompile'; 2 3hbs('some {{handlebarsthingy}}', { moduleName: 'some/path/to/file.hbs' });
Babel Plugin Usage
1var HTMLBarsCompiler = require('./bower_components/ember/ember-template-compiler'); 2var HTMLBarsInlinePrecompile = require('babel-plugin-htmlbars-inline-precompile'); 3 4require('babel').transform("code", { 5 plugins: [ 6 [HTMLBarsInlinePrecompile, {precompile: HTMLBarsCompiler.precompile}], 7 ], 8});
Example
1import { module, test } from 'qunit'; 2import { setupRenderingTest } from 'ember-qunit'; 3import { render } from '@ember/test-helpers'; 4import hbs from 'htmlbars-inline-precompile'; 5 6module("my component", function(hooks) { 7 setupRenderingTest(hooks); 8 9 test('inline templates ftw', async function(assert) { 10 await render(hbs`hello!`); 11 12 assert.dom().hasText('hello!'); 13 }); 14});
results in
1import { module, test } from 'qunit'; 2import { setupRenderingTest } from 'ember-qunit'; 3import { render } from '@ember/test-helpers'; 4import hbs from 'htmlbars-inline-precompile'; 5 6module("my component", function(hooks) { 7 setupRenderingTest(hooks); 8 9 test('inline templates ftw', async function(assert) { 10 await render(Ember.HTMLBars.template(function() { 11 /* crazy HTMLBars template function stuff */ 12 })); 13 14 assert.dom().hasText('hello!'); 15 }); 16});
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 2/27 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/ember-cli/babel-plugin-htmlbars-inline-precompile/nodejs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/ember-cli/babel-plugin-htmlbars-inline-precompile/nodejs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/ember-cli/babel-plugin-htmlbars-inline-precompile/nodejs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/ember-cli/babel-plugin-htmlbars-inline-precompile/nodejs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/ember-cli/babel-plugin-htmlbars-inline-precompile/nodejs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/ember-cli/babel-plugin-htmlbars-inline-precompile/nodejs.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/nodejs.yml:47
- Warn: npmCommand not pinned by hash: .github/workflows/nodejs.yml:63
- Warn: npmCommand not pinned by hash: .github/workflows/nodejs.yml:27
- Info: 0 out of 6 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 3 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 29 are checked with a SAST tool
Reason
47 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-7wwv-vh3v-89cq
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g
- Warn: Project is vulnerable to: GHSA-px4h-xg32-q955
- Warn: Project is vulnerable to: GHSA-3j8f-xvm3-ffx4
- Warn: Project is vulnerable to: GHSA-4p35-cfcx-8653
- Warn: Project is vulnerable to: GHSA-7f3x-x4pr-wqhj
- Warn: Project is vulnerable to: GHSA-jpp7-7chh-cf67
- Warn: Project is vulnerable to: GHSA-q6wq-5p59-983w
- Warn: Project is vulnerable to: GHSA-j9fq-vwqv-2fm2
- Warn: Project is vulnerable to: GHSA-pqw5-jmp5-px4v
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp
- Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr
- Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6
- Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj
- Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-29xr-v42j-r956
- Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
2.2
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to babel-plugin-htmlbars-inline-precompile
babel-plugin-ember-template-compilation
Babel implementation of Ember's low-level template-compilation API
@types/htmlbars-inline-precompile
TypeScript definitions for htmlbars-inline-precompile
ember-cli-htmlbars
A library for adding htmlbars to ember CLI
@babel/plugin-transform-regexp-modifiers
Compile inline regular expression modifiers