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.
@embroider/util
Advanced tools
Utilities to help apps and addons with Embroider support.
ember install @embroider/util
ensureSafeComponent
This function is intended to help addon authors who still need to support Ember < 3.25. In all other cases, instead of using this you should directly pass components around as values (not as strings) and invoke them directly with angle brackets (not the {{component}}
helper).
For the full explanation of why and how you would use this, see the Addon Author Guide.
Example usage in Javascript:
import { ensureSafeComponent } from '@embroider/util';
import Component from '@glimmer/component';
import DefaultTitleComponent from './default-title';
export default class extends Component {
get title() {
return ensureSafeComponent(this.args.title || DefaultTitleComponent, this);
}
}
<this.title />
Example usage in a template:
{{#let
(ensure-safe-component (or @title (component 'default-title')))
as |Title|
}}
<Title />
{{/let}}
The first argument is allowed to be:
staticComponents
enabled. We will return a value that is safe to invoke (via angle brackets) on your current Ember version.<YourComponent @customThing={{component "fancy"}}/>
). These are returned unchanged, because they're always safe to invoke.In the Javascript version, you must pass a second argument that is any object with an owner (a Component
instance works great).
If you are using Glint and environment-ember-loose
, you can add all the macros to your app at once by adding
import type { EmbroiderUtilRegistry } from "@embroider/util";
to your app's e.g. types/glint.d.ts
file, and making sure your registry extends from EmbroiderMacrosRegistry:
declare module '@glint/environment-ember-loose/registry' {
export default interface Registry
extends EmbroiderUtilRegistry, /* other registries here */ {
// ...
}
}
See the Contributing guide for details.
This project is licensed under the MIT License.
FAQs
Utilities for app and addon authors.
The npm package @embroider/util receives a total of 83,108 weekly downloads. As such, @embroider/util popularity was classified as popular.
We found that @embroider/util demonstrated a healthy version release cadence and project activity because the last version was released less than 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.