Skip to content

BasePattern migration + Lazy loading Patterns - #1312

Merged
thet merged 61 commits into
masterfrom
basepattern-migration
Nov 29, 2026
Merged

thet merged 61 commits into
masterfrom
basepattern-migration

Conversation

@thet

@thet thet commented Nov 29, 2026

Copy link
Copy Markdown
Member

See the ADR in this PR.

thet added 30 commits November 29, 2026 11:02
pat-clone is now based on BasePattern and gets destroyed automatically when
its element is removed from the document:

- The click handlers on the clone triggers, which can be anywhere in the
  document, and on the remove buttons are pattern instance scoped and
  removed on destroy. When a clone is removed, the handlers within it are
  removed too.

Fix: reaching the `max` number of clones threw an error because the clone
triggers were never collected (since 585d8ee). The triggers are now hidden
when the maximum is reached and shown again after a clone was removed.

Breaking change for JavaScript users: the default export is now the pattern
class. It is not created via `Base.extend` anymore and has no static `init`
method. Patterns are initialized asynchronously, so wait for
`events.await_pattern_init(instance)` before interacting.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-modal is now based on BasePattern and gets destroyed automatically when
its element is removed from the document:

- The document keyup and click listeners and the window resize listener are
  pattern instance scoped and removed on destroy. Before, closing one modal
  removed the keyup/click listeners of all modals, and the resize and
  reposition listeners were never removed and kept resizing removed modals.

- The jQuery listeners for pat-inject-content-loaded, patterns-injected and
  pat-update use an instance scoped namespace and are removed on destroy.
  Pending debounced resizes are not run after destroy.

- Closing the modal is now done by the new close() method. It can only run
  once, removes the modal and destroys the pattern. destroy() itself only
  cleans up. If an open modal is removed by other means, e.g. replaced by an
  injection, the modal-active and modal-panel classes are removed from the
  body as well.

- The options of the injection trigger are still merged in. The trigger is
  now taken as the constructor's third argument.

Fix the "closing: outside" option: before, any click anywhere, including
inside the modal, closed it, because `this.$el.has(ev.target)` always
returned a truthy jQuery object. Now only clicks outside the modal close it.

Breaking change for JavaScript users: the default export is now the pattern
class. There is no jQuery plugin and no static init() anymore. To close a
modal call close() instead of destroy(); destroy() does not remove the modal
anymore.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-close-panel is now based on BasePattern and gets destroyed automatically
when its element is removed from the document:

- The click listener and the close-panel listener on a surrounding dialog
  are pattern instance scoped and removed on destroy. Before, the dialog
  listener was registered under one shared id per dialog.

Breaking change for JavaScript users: the default export is now the pattern
class. The jQuery plugin and the static `init` method were removed. Use
`new Pattern(el)` instead.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-notification is now based on BasePattern and gets destroyed
automatically when its element is removed from the document:

- The healing timer of the notification panel is stopped on destroy.
  Notifications created via injection do not depend on the triggering
  element and keep healing on their own.

- The pat-inject-success listener on injection triggers is pattern instance
  scoped.

Fix duplicate ids: every notification panel got the id "pat-notification-1",
because the counter was kept per instance. A module wide counter now gives
each panel a unique id.

Breaking change for JavaScript users: the default export is now the pattern
class. There is no jQuery plugin and no static init() anymore. The panel
element is available as the instance's panel property.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-calendar is now based on BasePattern and gets destroyed automatically
when its element is removed from the document:

- The listeners on the calendar controls, the category controls and the
  timezone select are pattern instance scoped and removed on destroy. These
  controls can be outside of the calendar element.

- The FullCalendar instance is destroyed and a pending category filter timer
  is cleared on destroy. The calendar is not rendered if the pattern was
  destroyed while loading its dependencies.

- Adding events: the modal is created with the class based pat-modal and
  awaited properly. A modal from a previously added event is destroyed
  first, so that a new one can be opened on the same element.

Fix: the document submit listener for adding events is instance scoped and
replaced for every new event. Before, each added event registered another
submit listener which was never removed, and every later submit updated all
previously added events.

Breaking change for JavaScript users: the default export is now the pattern
class. The jQuery plugin and the static `init` method were removed. Use
`new Pattern(el)` instead.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-form-state was a plain object pattern and is now based on BasePattern.
It gets destroyed automatically when its form is removed from the document:

- On destroy, the input-change-events handlers and the form's
  pat-form-state event handlers are removed.

- The error dialog is opened with the class based pat-modal.

- Add tests.

Fix a missing import: input-change-events needs the findInclusive jQuery
extension, which was only available if another pattern had loaded
jquery-ext already.

Breaking change for JavaScript users: the default export is now the pattern
class. There is no static init() anymore, and the state handlers
(setModified, setReset, setSaved, setError, saveState) are instance methods
instead of jQuery event handlers.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-auto-submit is now based on BasePattern and gets destroyed automatically
when its element is removed from the document:

- The input-change-delayed listeners on the element and on contained
  subforms are pattern instance scoped and removed on destroy.

- The jQuery handlers for input-change, input-defocus, pat-update and
  patterns-injected are removed on destroy, as are the handlers installed by
  the input-change-events helper.

- A pending delayed submit is cancelled on destroy.

- Nested auto-submit elements which share a subform submit it only once.
  The internal input-change-delayed event is now stopped with
  stopImmediatePropagation.

Fix: the .pat-auto-submit trigger works again. The check for a nested
auto-submit element only looked for .pat-autosubmit, so elements with only
the .pat-auto-submit class never submitted.

Breaking change for JavaScript users: the default export is now the pattern
class. The jQuery plugin and the static `init` method are gone. Use
`new Pattern(el)` and wait for the initialization with
`events.await_pattern_init`, which now happens asynchronously.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-display-time is now based on BasePattern. The options are parsed by the
BasePattern options parser. It has no listeners or observers which would
need cleanup.

Fix: keep the locale of each instance when formatting again. The Moment.js
locale was only set globally during initialization. Calling `format()`
later, as pat-date-picker does on every change, used whatever locale was set
last by any other pat-display-time instance. Now the locale is set on each
Moment instance.

Breaking change for JavaScript users: the default export is now the pattern
class. There is no static `init` method and no jQuery plugin anymore - use
`new Pattern(el, options)` instead.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-date-picker is now based on BasePattern and gets destroyed automatically
when its element is removed from the document:

- The Pikaday instance is destroyed on destroy, which removes its calendar
  from the document body and its document listeners. Before, the calendar
  was never removed.

- The change listeners on the `after` reference inputs are pattern instance
  scoped and removed on destroy. Before, they were never removed and kept
  updating removed date pickers.

- The label click suppression listener is pattern instance scoped. Before it
  was registered under a global id.

- No Pikaday instance is created if the pattern was destroyed while loading
  its dependencies.

- With `output-format`, the initialization now waits for the
  pat-display-time instance to be initialized, before adding the clear
  button and the placeholder. The pattern's init event is thrown after that.

Breaking change for JavaScript users: the default export is now the pattern
class. There is no static `init` method and no jQuery plugin anymore - use
`new Pattern(el, options)` instead. Options passed to the constructor must
use the parser's option names (e.g. "output-format", not "outputFormat").

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-datetime-picker is now based on BasePattern and gets destroyed
automatically when its element is removed from the document:

- The internal pat-date-picker instance is destroyed on destroy, which also
  removes its Pikaday calendar.

- The change listeners on the `after` reference inputs are pattern instance
  scoped and removed on destroy. Before, they were never removed.

- Initialization stops if the pattern was destroyed while loading its
  dependencies.

Breaking change for JavaScript users: the default export is now the pattern
class. There is no static `init` method and no jQuery plugin anymore - use
`new Pattern(el, options)` instead.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-auto-suggest is now based on BasePattern and gets destroyed
automatically when its element is removed from the document:

- Select2 is destroyed on destroy. Pending debounced AJAX search responses
  are ignored after destroy - Select2 does not cancel them and would throw
  on its removed DOM.

- The jQuery listeners on the element (select2-close, select2-blur, change)
  and on a surrounding pat-depends element use an instance specific
  namespace and are removed on destroy. Before, the old destroy method
  removed the `.pat-autosuggest` namespace, which none of the listeners
  used, and the pat-depends listener was never removed.

- Initialization stops if the pattern was destroyed while loading Select2.

Fix: clear all auto-suggest inputs of a form on reset. The form reset
listener was registered under one global id per form, so each
pat-auto-suggest in the same form replaced the listener of the previous
one. Only the last auto-suggest input was cleared on form reset. The
listener is now pattern instance scoped and removed on destroy.

Breaking change for JavaScript users: the default export is now the pattern
class. There is no static `init` method and no jQuery plugin anymore - use
`new Pattern(el, options)` instead. `destroy()` takes no arguments anymore.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-selectbox is now based on BasePattern and gets destroyed automatically
when its element is removed from the document:

- The form reset listener is pattern instance scoped and removed on
  destroy. The marker on the element which prevented binding the reset
  listener twice is gone, so the pattern also handles form resets after
  re-initialization.

- The jQuery change listeners on the select elements use an instance
  specific namespace and are removed on destroy. Before, the old destroy
  method only removed listeners on the pattern element, not on the
  contained selects.

- A pending delayed update after a form reset is cancelled on destroy.

Breaking change for JavaScript users: the default export is now the pattern
class. The jQuery plugin and the static `init` method were removed. Use
`new Pattern(el)` instead.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-colour-picker is now based on BasePattern and gets destroyed
automatically when its element is removed from the document. The Spectrum
colour picker is destroyed on destroy, which removes its container from the
document body and its event listeners. Before, it was never removed.

Add tests.

Breaking change for JavaScript users: the default export is now the pattern
class instead of a plain object. There is no static `init($el)` method
anymore - use `new Pattern(el)` instead. The pattern name stays
"polyfill-color".

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-toggle is now based on BasePattern and gets destroyed automatically when
its element is removed from the document:

- The options are parsed by BasePattern with `parser_multiple = true`, so
  multiple toggles separated by `&&` keep working.

- The stored state (`store: local|session`) is still restored synchronously
  during initialization.

- The event handlers on the element are removed on destroy and pending
  debounced toggles are not run anymore after destroy. The handlers stay
  jQuery based so that events triggered via jQuery are still handled.

Breaking change for JavaScript users: the default export is now the pattern
class. It is not created via `Base.extend` anymore and has no static `init`
method. `ClassToggler`, `AttributeToggler` and `parser` are still exported.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-switch is now based on BasePattern and gets destroyed automatically when
its element is removed from the document. The click handler is pattern
instance scoped and removed on destroy.

Fix: clicking a pat-switch on a link prevents the default action again.
This regressed in 78e4756, which checked `e.tagName` on the event instead
of the element's tag name.

Breaking change for JavaScript users: the default export is now the pattern
class. The jQuery plugin `$.fn.patternSwitch` was removed. Instead of
`$el.patternSwitch(options)` use `new Pattern(el, options)`. Instead of
`$el.patternSwitch("execute")` call `instance.execute()`, and instead of
`$el.patternSwitch("destroy")` call `instance.destroy()`. The instance is
available as `el["pattern-switch"]` instead of `$el.data("pattern-switch")`.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-tabs is now based on BasePattern and gets destroyed automatically when
its element is removed from the document:

- The ResizeObserver is disconnected on destroy.

- The `pat-update` handler on the body uses an instance specific jQuery
  namespace and is removed on destroy. Before, it was never removed and kept
  adjusting removed tabs. Handlers of other pat-tabs instances are not
  affected.

- Pending debounced adjustments and running adjustment loops stop after
  destroy.

Breaking change for JavaScript users: the default export is now the pattern
class. The jQuery plugin and the static `init` method were removed. Use
`new Pattern(el)` instead.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-checklist is now based on BasePattern and gets destroyed automatically
when its element is removed from the document:

- The click handlers on the select/deselect/toggle buttons and the change
  handler are pattern instance scoped and removed on destroy. This also
  fixes global buttons (`select: #id`) shared by multiple pat-checklist
  instances. Before, the instances replaced each other's handler and only
  one of them reacted.

- The `patterns-injected` handler is removed on destroy. Before, destroy
  tried to remove the misspelled `patterns_injected` event.

- Pending debounced updates are not run anymore after destroy.

Breaking change for JavaScript users: the default export is now the pattern
class. The jQuery plugin and the static `init` method were removed. Use
`new Pattern(el)` instead.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-push is now based on BasePattern and gets destroyed automatically when
its element is removed from the document:

- The `push` event listener on the body is pattern instance scoped and
  removed on destroy. Before, it was never removed and kept injecting into
  removed elements.

- Content fetched after destroy is not injected anymore.

- Add tests.

Fix: the desktop notification permission was requested even if it was
already granted or denied, because the permission was checked with the `in`
operator on an array. Also, initialization no longer fails in browsers
without the Notification API.

Breaking change for JavaScript users: the default export is now the pattern
class. It is not created via `Base.extend` anymore and has no static `init`
method.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-forward is now based on BasePattern and gets destroyed automatically
when its element is removed from the document. The click handler is pattern
instance scoped and removed on destroy. Delayed clicks are not forwarded
anymore after destroy.

Breaking change for JavaScript users: the default export is now the pattern
class. It is not created via `Base.extend` anymore and has no static `init`
method.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-menu is now based on BasePattern and gets destroyed automatically when
its element is removed from the document. The mouse handlers and the pending
close timer are removed on destroy.

Fixes:

- The options are read from `data-pat-menu`. Before, the parser was wrongly
  named "fullscreen" and read `data-pat-fullscreen`.

- The `open` and `closed` classes are set on the menu items and not on the
  hovered descendant elements. A parent item now closes together with its
  sub items when the pointer leaves it.

- Opening a menu item only closes its open siblings. Before, the whole menu
  was closed, which also closed the parent item when moving between sub
  items.

Breaking change for JavaScript users: the default export is now the pattern
class. It is not created via `Base.extend` anymore and has no static `init`
method.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-masonry is now based on BasePattern and gets destroyed automatically
when its element is removed from the document:

- The MutationObserver on document.body is disconnected on destroy. Before,
  it was never disconnected and kept re-layouting removed elements.

- The media loaded listeners and the wait for images are aborted on destroy.

- The jQuery patterns-injected and pat-update handlers are namespaced per
  instance and removed on destroy. Pending debounced updates and layouts are
  not run anymore after destroy.

- The Masonry instance is destroyed, which removes its window resize
  listener.

Nested pat-masonry instances are now looked up via `el["pattern-masonry"]`
instead of the removed jQuery plugin.

Breaking change for JavaScript users: the default export is now the pattern
class. The jQuery plugin `$.fn.patMasonry` and the static `init` method were
removed. Use `new Pattern(el)` and the instance methods `quicklayout()`,
`layout()` and `update()` instead.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-gallery is now based on BasePattern and gets destroyed automatically
when its element is removed from the document:

- The MutationObserver watching for new items is disconnected on destroy.

- The click handlers on the gallery items are instance scoped and removed on
  destroy.

- An open PhotoSwipe overlay is closed on destroy. The overlay lives outside
  of the pattern element and stayed open before.

The `images` list is now an instance property, not shared on the prototype
anymore.

Fix: open the gallery at the clicked item. The start index was looked up via
the clicked item's href/src in the list of image sources. Items without
these, e.g. a <div> wrapping an <img>, got the index -1. The index now comes
from the clicked element's position in the item list.

Breaking change for JavaScript users: the default export is now the pattern
class. The static `init` method was removed, use `new Pattern(el)`.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-carousel is now based on BasePattern and gets destroyed automatically
when its element is removed from the document:

- Slick is unslicked on destroy, which removes its window resize and
  orientationchange listeners and the autoplay timer.

- The media loaded listeners are removed and pending debounced
  repositionings are not run anymore after destroy.

- Panel link click handlers are instance scoped and removed on destroy.

Fixes for two documented features which never worked:

- Panel links (`<a href="#panel-id">`) jump to that panel and get a
  `current` class. The panel ids are read before slick restructures the DOM,
  the click calls `slickGoTo` and `current` is updated on slick's
  `afterChange` event.

- Lazy loading via `data-src`: it is now converted to slick's `data-lazy`,
  so slick's on-demand lazy loading handles it.

Breaking change for JavaScript users: the default export is now the pattern
class. The static `init` method and the unused methods `_loadPanelImages`,
`onPanelLinkClick`, `onInitialized`, `onSlideInit` and `onSlideComplete`
were removed.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-image-crop is now based on BasePattern and gets destroyed automatically
when its element is removed from the document:

- The Jcrop instance is destroyed on destroy.

- If the pattern is destroyed before the image is loaded, Jcrop is not set
  up anymore.

The preview, form, inputs and the Jcrop API are now stored on the pattern
instance instead of a separate data object.

Fix: the `preview-width` and `preview-height` options were ignored. The code
checked `opts.previewWidth`, which is undefined because the options are
grouped as `opts.preview.width`, so it always used the preview parent's size.

Breaking change for JavaScript users: the default export is now the pattern
class instead of a plain object. The static `init` method was removed.
`onSelect(c)`, `updatePreview(c)` and `updateInputs(c)` are instance methods
without the former `data` argument.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-slides is now based on BasePattern and gets destroyed automatically when
its element is removed from the document:

- A running presentation is stopped on destroy, which removes its global
  keydown, touchstart and resize listeners.

- The SlideDisplay and SlideHide listeners are instance scoped.

- Slides are rescanned when content is injected into the slideshow (composed
  injection). This listener is scoped to the pattern element and removed on
  destroy. It replaces a global document listener and a `destroy` event
  hook, neither of which worked.

Fixes:

- pat-slides threw a TypeError on every page, because the plain object
  pattern used `this.el`, which was undefined there.

- The `?slides=` URL filter crashed, because a string was passed instead of
  an array. It now uses `searchParams.getAll()`, which also supports the
  documented repeated `slides=` parameters.

- Rescanning after injection never happened, because the handler used the
  wrong `this`.

Breaking change for JavaScript users: the default export is now the pattern
class instead of a plain object. The static `init` and `setup` methods and
`_hook` were removed. The presentation is available as
`instance.presentation` instead of `$el.data("pat-slide")`.
`_remove_slides(ids)` now works on the pattern element.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-zoom is now based on BasePattern and gets destroyed automatically when
its element is removed from the document. The change and input listeners on
the range slider are instance scoped and removed on destroy.

Breaking change for JavaScript users: the default export is now the pattern
class instead of a plain object. The static `init` and `onZoom` methods were
removed. Use `new Pattern(el)`. The slider is available as
`instance.slider` and `instance.zoom()` applies its value.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-fullscreen and pat-fullscreen-close are now based on BasePattern and get
destroyed automatically when their element is removed from the document:

- The click handlers are instance scoped and removed on destroy. The click
  handler is now a native event listener, which also works for links when
  the click is triggered via jQuery.

- The screenfull change handler for the exit button is removed on destroy.

Fix: with `close-button: show`, every fullscreen request added another
screenfull change handler and never removed it. On later changes the old
handlers tried to remove buttons which were already gone and threw an
error. Now only one exit button and one handler exist at a time, and both
are removed when fullscreen is left.

Breaking change for JavaScript users: the default exports of pat-fullscreen
and pat-fullscreen-close are now the pattern classes. The static `init`
methods were removed. Use `new Pattern(el)`.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-scroll-box is now based on BasePattern and gets destroyed automatically
when its element is removed from the document:

- The scroll listener is instance scoped and removed on destroy.

- The pending scroll stop timeout is cleared on destroy, and an animation
  frame queued before destroy doesn't update the classes anymore.

Breaking change for JavaScript users: the default export is now the pattern
class. The static `init` method was removed, use `new Pattern(el)`.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
pat-auto-scale is now based on BasePattern and gets destroyed automatically
when its element is removed from the document:

- The window resize listener is instance scoped and removed on destroy.
  Before, it was never removed and kept rescaling removed elements.

- The jQuery pat-update listener on the document is namespaced per instance
  and removed on destroy. Before, all instances shared the `.autoscale`
  namespace.

- Pending debounced rescales are not run anymore after destroy.

- Add tests.

Fix: in browsers without CSS `zoom` support the scale method was not forced,
because `force_method` was set after the method option had already been
applied. The feature check now runs first.

Breaking change for JavaScript users: the default export is now the pattern
class. The static `init` method was removed, use `new Pattern(el)`.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
thet added 27 commits November 29, 2026 11:02
The minimal example pattern is now a clean BasePattern example: a static
parser for the options, an instance scoped click listener which is removed
on destroy, and the recommended test initialization style. Also fix the
option reference in the documentation, which referred to pat-fullscreen.

Breaking change for JavaScript users: the default export is now the pattern
class. The jQuery plugin and the static `init` method were removed. Use
`new Pattern(el)` instead.

Ref: ADR 0009

Assisted-by: Claude Opus 5.5
…rn instance.

Lazily loaded patterns return a Promise of the pattern instance when
instantiated. events.await_pattern_init now also accepts such a Promise, so
that `await events.await_pattern_init(new Pattern(el))` keeps working.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
create_lazy_pattern returns a placeholder pattern class, which can be
registered instead of the real pattern class. The real implementation is
only loaded when the pattern is used for the first time. Instantiating the
placeholder returns a Promise of the real pattern instance, so the registry
and code doing `new registry.patterns[name](el)` keep working. After loading,
the placeholder is replaced by the real class in the registry.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
… the registry.

pat-markdown instantiates pat-syntax-highlight and pat-tooltip instantiates
pat-markdown from the patterns registry. Await the instances, as these
patterns might be registered as lazily loaded placeholders, which return a
Promise of the pattern instance.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to syntax-highlight--implementation.js and is loaded
when the pattern is used for the first time. syntax-highlight.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of syntax-highlight.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
syntax-highlight--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to display-time--implementation.js and is loaded
when the pattern is used for the first time. display-time.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of display-time.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
display-time--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to date-picker--implementation.js and is loaded
when the pattern is used for the first time. date-picker.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of date-picker.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
date-picker--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to datetime-picker--implementation.js and is loaded
when the pattern is used for the first time. datetime-picker.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of datetime-picker.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
datetime-picker--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to scroll-marker--implementation.js and is loaded
when the pattern is used for the first time. scroll-marker.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of scroll-marker.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
scroll-marker--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to navigation--implementation.js and is loaded
when the pattern is used for the first time. navigation.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of navigation.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
navigation--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to modal--implementation.js and is loaded
when the pattern is used for the first time. modal.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of modal.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
modal--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to calendar--implementation.js and is loaded
when the pattern is used for the first time. calendar.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of calendar.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
calendar--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to notification--implementation.js and is loaded
when the pattern is used for the first time. notification.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of notification.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
notification--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to auto-suggest--implementation.js and is loaded
when the pattern is used for the first time. auto-suggest.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of auto-suggest.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
auto-suggest--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to sortable--implementation.js and is loaded
when the pattern is used for the first time. sortable.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of sortable.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
sortable--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to bumper--implementation.js and is loaded
when the pattern is used for the first time. bumper.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of bumper.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
bumper--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to image-crop--implementation.js and is loaded
when the pattern is used for the first time. image-crop.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of image-crop.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
image-crop--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to clone--implementation.js and is loaded
when the pattern is used for the first time. clone.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of clone.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
clone--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to masonry--implementation.js and is loaded
when the pattern is used for the first time. masonry.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of masonry.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
masonry--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to gallery--implementation.js and is loaded
when the pattern is used for the first time. gallery.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of gallery.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
gallery--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to carousel--implementation.js and is loaded
when the pattern is used for the first time. carousel.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of carousel.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
carousel--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to auto-submit--implementation.js and is loaded
when the pattern is used for the first time. auto-submit.js only registers a lazily
loaded placeholder, which keeps the implementation out of the eagerly loaded
patterns bundle.

Breaking change for JavaScript users: the default export of auto-submit.js is the
placeholder class, which returns a Promise of the pattern instance when
instantiated, and `parser` is not exported there anymore. Import
auto-submit--implementation.js to use the pattern class or the parser directly.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
pat-form-state imported the pat-modal implementation module directly, which
put it back into the eagerly loaded patterns bundle. Use the lazily loaded
pat-modal instead. The error modal is opened once pat-modal is loaded.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The pattern implementation moved to markdown--implementation.js and is
loaded when the pattern is used for the first time. markdown.js only
registers a lazily loaded placeholder, which keeps the implementation out of
the eagerly loaded patterns bundle.

The pat-inject integration - marking URLs to markdown resources and the
markdown type handler - stays in markdown.js, so that injecting markdown
files keeps working without a pat-markdown element on the page. Add tests
for it.

Breaking change for JavaScript users: the default export of markdown.js is
the placeholder class, which returns a Promise of the pattern instance when
instantiated. Import markdown--implementation.js to use the pattern class
directly. Importing only the implementation module does not register the
pat-inject integration.

Ref: ADR 0010

Assisted-by: Claude Opus 5.5
The keypress handler compared the key code with the string "13" and never
fired. It is removed instead of fixed: buttons and links already activate on
Enter natively, and an additional click would toggle twice and could submit
a form twice.

Assisted-by: Claude Opus 5.5
…-submit subforms.

Pressing Enter in an input of a pat-subform with pat-autosubmit submitted
the subform, but the browser also submitted the surrounding form via its
implicit form submission. The default action is now prevented, so only the
subform is submitted. Subforms without pat-autosubmit keep the browser's
behavior.

Assisted-by: Claude Opus 5.5
@thet
thet force-pushed the basepattern-migration branch from fcb15cd to 7f71942 Compare November 29, 2026 10:07
@thet
thet merged commit 08298ae into master Nov 29, 2026
1 check passed
@thet
thet deleted the basepattern-migration branch November 29, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant