Gathering detailed insights and metrics for ember-cached-decorator-polyfill
Gathering detailed insights and metrics for ember-cached-decorator-polyfill
Gathering detailed insights and metrics for ember-cached-decorator-polyfill
Gathering detailed insights and metrics for ember-cached-decorator-polyfill
Polyfill for RFC 566: @cached
npm install ember-cached-decorator-polyfill
52.4
Supply Chain
52.4
Quality
75.7
Maintenance
100
Vulnerability
95.6
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
20 Stars
86 Commits
6 Forks
2 Watching
9 Branches
13 Contributors
Updated on 30 May 2024
Minified
Minified + Gzipped
TypeScript (54.66%)
JavaScript (37.64%)
HTML (7.41%)
Handlebars (0.3%)
Cumulative downloads
Total Downloads
Last day
-19.6%
13,100
Compared to previous day
Last week
2.3%
74,023
Compared to previous week
Last month
14.7%
318,598
Compared to previous month
Last year
29.9%
4,465,725
Compared to previous year
6
1
48
Polyfill for RFC 566 "@cached decorator".
1ember install ember-cached-decorator-polyfill
For addons, pass the -S
flag.
If you're working in an environment with an explicit Babel config (like a V2
addon or an app with ember-cli-babel
's { useBabelConfig: true }
mode), see "Explicit Babel Config" below.
Add a @cached
decorator for memoizing the result of a getter based on
autotracking. In the following example, fullName
would only recalculate if
firstName
or lastName
is updated.
1import { tracked, cached } from '@glimmer/tracking'; 2 3class Person { 4 @tracked firstName = 'Jen'; 5 @tracked lastName = 'Weber'; 6 7 @cached 8 get fullName() { 9 return `${this.firstName} ${this.lastName}`; 10 } 11}
For detailed usage instructions, refer to the RFC 566 "@cached decorator".
TypeScript's normal type resolution for an import from @glimmer/tracking
will not find the types provided by this polyfill, since the actual
@glimmer/tracking
package does not include an export for cache
.
In order for TypeScript to recognize the extra cache
export, add an import
like this somewhere in your codebase (like app.ts
or test-helper.ts
):
1import 'ember-cached-decorator-polyfill';
Once the upstream types have been updated to reflect RFC 566, this will no longer be necessary.
In environments where you have an explicit Babel config (like authoring a V2
addon) you will need to configure this polyfill's babel plugin. Add it to your
babel.config.js
like:
{
"plugins": [
"ember-cached-decorator-polyfill/babel-plugin"
]
}
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 5/17 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
53 existing vulnerabilities detected
Details
Score
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 More