Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
ember-cached-decorator-polyfill
Advanced tools
Polyfill for RFC 566 "@cached decorator".
ember 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.
import { tracked, cached } from '@glimmer/tracking';
class Person {
@tracked firstName = 'Jen';
@tracked lastName = 'Weber';
@cached
get fullName() {
return `${this.firstName} ${this.lastName}`;
}
}
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
):
import '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"
]
}
v1.0.2 (2023-07-26)
FAQs
Polyfill for RFC 566: @cached
We found that ember-cached-decorator-polyfill demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.