Skip to content
isaiah edited this page Jun 20, 2015 · 2 revisions

What is going away

The repeat template from the Stacks 2 API along with its companion templates:

%[repeat n]%
%id=repeatIndex%
%[endrepeat]%

Why is it going away

As noted in the API documentation, the performance of repeat is poor. It is also very inflexible: it doesn't allow stack reordering or removing a stack from the middle of a group. The bottom line: it makes customers unhappy. We can do better.

When is it going away

The exact date is not known, but it will be at least 12 months from the release of Stacks 3. In that time most developers should have moved to new stacks.

When will it be replaced

Repeat will be for another year, but the replacement is here today. If you're adding new features or building new stacks, use the new API.

What will replace it

Repeat was used for repeating sub-elements and or containers. Add-Types lets the user add specific sub-stacks to a container. Sub-stacks can be wrapperless, confined only to your stack(s), and hidden in the library. This covers many of the same features of repeat, in a more flexible and customizable way.

And it goes without saying, but the new API solves the existing problems: it's fast and it allows the customer to reorder/delete in the usual stacks way.

How do I get started

The easiest way to get started is to see it in action. The Image Fun stack is a complete working example stack that uses the addTypes API, inline (wrapperless) sub-stacks, and a lot more. It's open source and here on GitHub.

Clone this wiki locally