
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
aurelia-v2-virtual-repeat
Advanced tools
A plugin for doing virtualization with Aurelia 2
To install the plugin, do:
npm install aurelia-v2-virtual-repeat
To register the standard behavior of the plugin in your application, add DefaultVirtualRepeatConfiguration
to your Aurelia instance:
import { DefaultVirtualRepeatConfiguration } from 'aurelia-v2-virtual-repeat';
Aurelia.register(DefaultVirtualRepeatConfiguration).app(MyApp).start();
This plugin can be used like the standard repeater, like in the following example:
<template>
<div virtual-repeat.for="item of items">
${$index} ${item}
</div>
</template>
<template>
<table>
<tr virtual-repeat.for="item of items">
<td>${$index}</td>
<td>${item}</td>
</tr>
</table>
</template>
<template>
<ul>
<li virtual-repeat.for="item of items">
${$index} ${item}
</li>
</ul>
</template>
The virtual-repeat
requires to be placed inside a "scrollable" element, which means the element should have either overflow: scroll
or overflow: auto
in its styles. An error will be throw if the virtual-repeat
is unable to locate such element.
virtual-repeat
: DOM recycling mode. In this mode, it is expected that the DOM nodes will be moved around, and only binding data will be changed. Application should be aware of this and employ reactive programming model with change handler xxxxxChanged()
to avoid surprises.<template/>
is not supported as a root of a repeat template, use a normal element instead:nth-child
and similar CSS selectors. This implementation requires appropriate shifting visible items, based on scroll position. This means DOM elements order will not stay the same, thus creating unexpected :nth-child
CSS selector behavior. To work around this, you can use contextual properties $index
, $odd
, $even
, $first
, $last
, $middle
, $length
to determine the position of an item, and apply CSS classes/styles against it, like the following example:
<template>
<div virtual-repeat.for="person of persons" class="${$odd ? 'odd' : 'even'}-row">
${person.name}
</div>
</template>
virtual-repeat
, unlike the standard repeat
. I.e: built-in template controllers: with
, if
, au-slot
cannot be used with the virtual-repeat
. This can be workaround'd by nesting other template controllers inside the repeated element, with <template/>
element, for example:
<template>
<h1>${message}</h1>
<div virtual-repeat.for="person of persons">
<template with.bind="person">
Person name is: ${name}
</template>
</div>
</template>
To develop the plugin, run
npm run test
Run unit tests in watch mode.
npm run test:watch
virtual-repeat
attribute at the moment. In the future, there will be more: non-recycling mode, variable height, and maybe an additional of <au-virtual-repeat>
custom element for more control over the behavior of the repeat.Set
& Map
are harder as they require better collection to index mappingFAQs
An Aurelia 2 virtual repeat implementation.
We found that aurelia-v2-virtual-repeat demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.