<commit_before>## [0.7.0-pre.3] - 2022-03-16
### Changed
- Extracted LitVirtualizer class to be imported without side-effects

## [0.6.0] - 2021-05-01
- This is a stopgap release to unblock migrations to Lit 2.0
- In the near future:<commit_msg>Add 0.7.2 changes<commit_after>## [0.7.0-pre.3] - 2022-03-22
### Changed
- Extracted LitVirtualizer class to be imported without side-effects

## [0.7.0-pre.2] - 2021-10-08
### Changed
- The `scroll` directive has been renamed to `virtualize`. Note that the `<lit-virtualizer>` element remains the recommended way to use virtualizer in most cases; the directive exists primarily for developers who are using Lit's `lit-html` templating system standalone and don't need the `LitElement` base class elsewhere in their project.

- By default, a virtualizer instance is no longer itself a scroller; rather, it is a block-level container that:

  - Determines its own size by calculating or estimating the total size of all of its children (both those that are currently in the DOM and those that are not)
  - Adds and removes children from the DOM as the visible portion of the virtualizer changes (i.e., when any of its containing ancestors, including the window, is scrolled, resized, etc.).
  
  If you want to make a `<lit-virtualizer>` element into a scroller, you can do so by adding the `scroller` attribute; likewise, you can set `scroller: true` if you're using the `virtualize` directive.
  
  As a result of this change, the `scrollTarget` property / attribute is no longer needed and has been removed.

- In `0.5` and `0.6`, it was necessary to explicitly specify a layout. In `0.7`, we revert to the behavior from earlier versions: if you don't specify a layout, the default layout (previously called `Layout1d`, now called `flow`—see below) will be used (and loaded dynamically as needed).

- The lineup of layouts has been updated and cleaned up. The default layout, previously called `Layout1d`, is now called `flow`. The previous, rudimentary grid layouts have been replaced with a single, new `grid` layout with some options to control its behavior. The `Layout1dFlex` layout has been renamed to `flexWrap` and remains a work in progress, not yet fully usable (though getting close).

- The syntax for specifying layouts has changed; rather than providing a layout constructor (e.g., `FlowLayout`) or a configuration object containing the required type property (e.g. `{type: FlowLayout, direction: ‘horizontal’}`), you now import a layout as a function and call that function (passing it an optional configuration object as desired). For example:

  ```
  <lit-virtualizer
    .layout=${flow({
      direction: ‘horizontal’
    })
  ></lit-virtualizer>
  ```

- The `spacing` property of the default layout (which has been present since the earliest releases but never documented) has been removed. Setting margins on the child elements you render is the way to control spacing. This margin-based method was already supported and recommended / demonstrated in previous versions, but has been improved in `0.7` with basic support for margin-collapsing: margins set explicitly on child elements will now be collapsed, but any margins on elements contained within child elements are not considered. If you were relying on the previous (non-collapsing) behavior, you may need to adjust existing style rules.

- In another return to pre-`0.5` behavior, the `visibilityChanged` and `rangeChanged` events are no longer `CustomEvent`s, so you’ll access their properties directly from the event object, not from under a `details` property. Additionally, these event objects no longer contain both range and visibility information; rather, `visibilityChanged` reports only visibility changes and `rangeChanged` reports only range changes. Both event objects have just two properties: `first` and `last`.

- Inline API docs are still minimal, but types for `<lit-virtualizer>`, the `virtualize` directive and the various layouts are essentially correct and complete, so typeahead / autocomplete should work if your editor has these features.

- Exports from the `@lit-labs/virtualizer` packaged are now restricted by an export map. If you have been importing from any modules not intended to be part of the current public API (or if we have inadvertently left something out of the map), things may break—please file issues as needed.

### Fixed
- Scrolling issue on iOS ([#54](https://github.com/PolymerLabs/uni-virtualizer/issues/54))
- Incorrect index passed to `renderItem()` function ([#109](https://github.com/PolymerLabs/uni-virtualizer/issues/109))
- Undocumented change: doesn't work unless layout is explicitly specified ([#103](https://github.com/PolymerLabs/uni-virtualizer/issues/103))

The following are also believed to be fixed, but didn't have specific repro cases to test against so require confirmation:

- Scroll listeners on `window` not removed ([#55](https://github.com/PolymerLabs/uni-virtualizer/issues/55))
- Doesn't always reflow when items change ([#75](https://github.com/PolymerLabs/uni-virtualizer/issues/75))
- Hangs / freezes when switching between virtualizer instances ([#105](https://github.com/PolymerLabs/uni-virtualizer/issues/105))
- Scrolling issue under certain circumstances when `items` array changes ([#108](https://github.com/PolymerLabs/uni-virtualizer/issues/108))

## [0.6.0] - 2021-05-01
- This is a stopgap release to unblock migrations to Lit 2.0
- In the near future:
{'fraction_non_alphanumeric': 0.08394294074615948, 'fraction_numerical': 0.020848573518653987, 'mean_word_length': 4.563580874872838, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7643685', 'n_tokens_mistral': 1515, 'n_tokens_neox': 1395, 'n_words': 718}