diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index b75f65b5..9c537f1a 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -39,7 +39,7 @@ body: id: repro attributes: label: Minimal reproduction - description: Smallest HTML + JS that shows the bug, or a link to a fork/playground. Prefer root-absolute paths and `aura-router-link`. + description: Smallest HTML + JS that shows the bug, or a link to a fork/playground. Prefer root-absolute paths and `data-aura-link`. placeholder: | ```html diff --git a/README.md b/README.md index dff71717..33a3a667 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Serve a complete page for every URL and keep the same selector around the conten **2. Declare routes. Mark the links.** ```html -About +About diff --git a/docs/guide/01-fundamentals.md b/docs/guide/01-fundamentals.md index e085165c..c8965b7c 100644 --- a/docs/guide/01-fundamentals.md +++ b/docs/guide/01-fundamentals.md @@ -44,8 +44,8 @@ A minimal router: ```html diff --git a/docs/guide/02-routes-and-navigation.md b/docs/guide/02-routes-and-navigation.md index d926e7bd..a854dbd3 100644 --- a/docs/guide/02-routes-and-navigation.md +++ b/docs/guide/02-routes-and-navigation.md @@ -33,11 +33,21 @@ Parameterized routes require the browser's `URLPattern`. Catch-all values are av ## Navigation -Mark only links that Aura should intercept: +Mark only the links that Aura should intercept. +Use the `data-aura-link` attribute as the default marker for such links: ```html -User +User ``` +You can customize which links are processed by configuring the `links-selector` in ``. For example, to use a different attribute: +```html + +``` +Or to handle all anchor tags on the page: +```html + +``` +**Warning:** In this mode, every intercepted link must have a corresponding route defined in the router configuration. Failing to define a route for a URL will result in a 404 error, even if the page exists on the server. Aura resolves the anchor's `href` as the browser does, requires the result to stay on the same origin, then navigates with `pathname + search + hash`. diff --git a/docs/guide/03-views-and-layouts.md b/docs/guide/03-views-and-layouts.md index 629f61f1..f0208ccc 100644 --- a/docs/guide/03-views-and-layouts.md +++ b/docs/guide/03-views-and-layouts.md @@ -112,7 +112,7 @@ Nested routes let several pages share UI without remounting it on every navigati ```html diff --git a/docs/guide/07-navigation-ux.md b/docs/guide/07-navigation-ux.md index 166d426b..c3d17cc7 100644 --- a/docs/guide/07-navigation-ux.md +++ b/docs/guide/07-navigation-ux.md @@ -81,7 +81,7 @@ Route-level `prefetch` inherits through parent routes. Use a child route or link -Docs +Docs ``` An absent `prefetch` attribute does not disable the feature; Aura falls back to `intent`. Set `prefetch="false"`, `off`, or `none` explicitly to opt out. diff --git a/docs/guide/08-errors-and-accessibility.md b/docs/guide/08-errors-and-accessibility.md index fab66bfc..757d534c 100644 --- a/docs/guide/08-errors-and-accessibility.md +++ b/docs/guide/08-errors-and-accessibility.md @@ -94,7 +94,7 @@ URLs with a hash do not receive branch matches. ### Link scope -`links-container-selector` narrows scanning to the closest matching ancestor of the router. `links-selector` controls both interception and scanning and defaults to `[aura-router-link]`. +`links-container-selector` narrows scanning to the closest matching ancestor of the router. `links-selector` controls both interception and scanning and defaults to `[data-aura-link]`. ### Read the active route branch diff --git a/docs/guide/09-api-reference.md b/docs/guide/09-api-reference.md index e3b3b110..ad2ed011 100644 --- a/docs/guide/09-api-reference.md +++ b/docs/guide/09-api-reference.md @@ -32,7 +32,7 @@ A child route can override any inherited value. Where supported, `none`, `off`, | Attribute | Default / purpose | | -------------------------- | ------------------------------------------------------------------------- | | `outlet` | Selector; otherwise first document outlet, otherwise auto-created sibling | -| `links-selector` | `[aura-router-link]` | +| `links-selector` | `[data-aura-link]` | | `links-container-selector` | Whole document when absent | | `link-active-class` | No default; classes for exact active links | | `link-active-branch-class` | No default; classes for active parent-section links | diff --git a/docs/recipes/nested.md b/docs/recipes/nested.md index d4541582..d0466901 100644 --- a/docs/recipes/nested.md +++ b/docs/recipes/nested.md @@ -29,8 +29,8 @@ The layout remains mounted while navigation stays inside `/users`; only the chil ## Links ```html -User 1 -User 2 +User 1 +User 2 ``` Because the resolved view URL changes with `:id`, moving from `/users/1` to `/users/2` remounts the child; any `ready` hook runs again. Use a stable view plus `update` when the same mounted shell should handle every id. diff --git a/docs/recipes/not-found.md b/docs/recipes/not-found.md index 0398f02f..aa18486d 100644 --- a/docs/recipes/not-found.md +++ b/docs/recipes/not-found.md @@ -14,7 +14,7 @@ diff --git a/docs/recipes/prefetch-cache.md b/docs/recipes/prefetch-cache.md index 542eda3d..f86933ce 100644 --- a/docs/recipes/prefetch-cache.md +++ b/docs/recipes/prefetch-cache.md @@ -16,8 +16,8 @@ -Contacts -User 1 +Contacts +User 1 ``` The router provides defaults; child routes and links only declare overrides. diff --git a/docs/tutorial.md b/docs/tutorial.md index 213a2ac8..112d0104 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -47,8 +47,8 @@ Create `index.html`:
@@ -115,7 +115,7 @@ Open the local URL printed by Vite, then check: ## If it does not work -**A link performs a full reload:** confirm that it has `aura-router-link` and points to the same origin. +**A link performs a full reload:** confirm that it has `data-aura-link` and points to the same origin. **The wrong markup appears:** every page response must contain the selector configured in `extract` (`#content` here). diff --git a/playground/pages/parts/nav.html b/playground/pages/parts/nav.html index 0de6dbcb..a6b63dcb 100644 --- a/playground/pages/parts/nav.html +++ b/playground/pages/parts/nav.html @@ -1,12 +1,12 @@ diff --git a/playground/pages/parts/router.html b/playground/pages/parts/router.html index daa37337..b6185972 100644 --- a/playground/pages/parts/router.html +++ b/playground/pages/parts/router.html @@ -37,8 +37,8 @@

Users

Profile

requires login (guard="auth")

@@ -56,7 +56,7 @@

About

404

Route not found (path="*").

-

Home

+

Home

diff --git a/playground/pages/profile.html b/playground/pages/profile.html index 1cf0d2ef..f0bbe6c0 100644 --- a/playground/pages/profile.html +++ b/playground/pages/profile.html @@ -12,8 +12,8 @@

Profile

requires login (guard="auth")

diff --git a/playground/pages/users.html b/playground/pages/users.html index c199f890..2b79d92f 100644 --- a/playground/pages/users.html +++ b/playground/pages/users.html @@ -17,9 +17,9 @@

Users

List from the server (view="users"). Nested layout: aura-router-ssr on shell; flat leaf-only markup → no full adopt (cold fetch / structure-error).

diff --git a/public/features/animations/index.html b/public/features/animations/index.html index d7f6c303..e78d011a 100644 --- a/public/features/animations/index.html +++ b/public/features/animations/index.html @@ -39,9 +39,9 @@ diff --git a/public/features/animations/intro.html b/public/features/animations/intro.html index b1dc9a24..568a5b20 100644 --- a/public/features/animations/intro.html +++ b/public/features/animations/intro.html @@ -12,8 +12,8 @@

transition-order

Текущий режим: parallel

@@ -37,8 +37,8 @@

transition-order

Хук fade

Core не содержит встроенных анимаций — только фазы pipeline и staged mount. Хук fade анимирует [data-aura-view-root] на фазах transitionOut / transitionIn. При prefers-reduced-motion анимация пропускается.

Смените порядок на панели, затем несколько раз переключитесь A ↔ B — шапка и URL-бар остаются, меняется только timing перехода.

diff --git a/public/features/animations/page-a.html b/public/features/animations/page-a.html index e3101564..1876e205 100644 --- a/public/features/animations/page-a.html +++ b/public/features/animations/page-a.html @@ -7,7 +7,7 @@

Страница A

diff --git a/public/features/animations/page-b.html b/public/features/animations/page-b.html index 2f36613d..86c95b2c 100644 --- a/public/features/animations/page-b.html +++ b/public/features/animations/page-b.html @@ -7,8 +7,8 @@

Страница B

Кнопка «Назад» в браузере вернёт страницу A с той же анимацией выхода.

diff --git a/public/features/hydration/about.html b/public/features/hydration/about.html index 5323ff64..3777ce85 100644 --- a/public/features/hydration/about.html +++ b/public/features/hydration/about.html @@ -13,6 +13,6 @@

About

diff --git a/public/features/hydration/index.html b/public/features/hydration/index.html index d8a344a0..fbf03839 100644 --- a/public/features/hydration/index.html +++ b/public/features/hydration/index.html @@ -23,8 +23,8 @@ @@ -78,7 +78,7 @@

About

diff --git a/public/features/hydration/page-b.html b/public/features/hydration/page-b.html index 8b1722e7..26e6d391 100644 --- a/public/features/hydration/page-b.html +++ b/public/features/hydration/page-b.html @@ -10,6 +10,6 @@

Страница B

diff --git a/public/features/phase-update/hash.html b/public/features/phase-update/hash.html index fadaa4a3..2e7469bd 100644 --- a/public/features/phase-update/hash.html +++ b/public/features/phase-update/hash.html @@ -5,9 +5,9 @@

Hash — якорь

Активный якорь: #

Переключайте якоря: view не remount-ится, обновляются только URL и scroll.

@@ -22,8 +22,8 @@

Hash — якорь

diff --git a/public/features/phase-update/index.html b/public/features/phase-update/index.html index 2a8e2b8a..b633d0cd 100644 --- a/public/features/phase-update/index.html +++ b/public/features/phase-update/index.html @@ -23,11 +23,11 @@ diff --git a/public/features/phase-update/intro.html b/public/features/phase-update/intro.html index 1c6beefe..59453c66 100644 --- a/public/features/phase-update/intro.html +++ b/public/features/phase-update/intro.html @@ -6,9 +6,9 @@

Update shortcut

Search — смена query

Pathname тот же, меняется только ?tab=…. Pipeline: runUpdate() — load → history → update-хуки. Без render и unmount.

@@ -21,16 +21,16 @@

Search — смена query

Hash — смена якоря

Pathname и search те же, меняется только #…. Processor не запускается: history + scroll. View и хуки не вызываются.

@@ -43,15 +43,15 @@

Hash — смена якоря

:id remount — не update, свой HTML на id

Один leaf remount/:id, param меняется, но view — шаблон user-:id.html: viewKey разный (user-1.htmluser-2.html). Engine выбирает FULL, не runUpdate() — synthetic exit/enter leaf, render, unmount, ready.

@@ -65,16 +65,16 @@

:id remount — не update, свой HTML на id

-User 1 -User 2 +User 1 +User 2

Param-update — update shortcut для :id

Тот же leaf update/:id и тот же viewKey (user-shell.html на все id). Pipeline: runUpdate() — меняется param id, view остаётся в DOM.

@@ -87,8 +87,8 @@

Param-update — update shortcut для :id

diff --git a/public/features/phase-update/search.html b/public/features/phase-update/search.html index 91328a0e..3f2a3a54 100644 --- a/public/features/phase-update/search.html +++ b/public/features/phase-update/search.html @@ -5,9 +5,9 @@

Search — query

Активная вкладка: tab=

Переключайте вкладки: меняется только query. «Назад» восстановит предыдущее значение tab.

@@ -22,7 +22,7 @@

Search — query

diff --git a/public/features/phase-update/user-1.html b/public/features/phase-update/user-1.html index 51ae02b4..fa99f5d6 100644 --- a/public/features/phase-update/user-1.html +++ b/public/features/phase-update/user-1.html @@ -4,8 +4,8 @@

Пользователь 1

Параметр id:

Переключайте User 1 ↔ User 2: synthetic exit/enter leaf, render, unmount.

@@ -21,7 +21,7 @@

Пользователь 1

-User 1 -User 2 +User 1 +User 2 diff --git a/public/features/phase-update/user-2.html b/public/features/phase-update/user-2.html index bac9b4de..7a059672 100644 --- a/public/features/phase-update/user-2.html +++ b/public/features/phase-update/user-2.html @@ -4,8 +4,8 @@

Пользователь 2

Параметр id:

Переключайте User 1 ↔ User 2: synthetic exit/enter leaf, render, unmount.

@@ -21,7 +21,7 @@

Пользователь 2

-User 1 -User 2 +User 1 +User 2 diff --git a/public/features/phase-update/user-shell.html b/public/features/phase-update/user-shell.html index caa657c6..5fd89b0f 100644 --- a/public/features/phase-update/user-shell.html +++ b/public/features/phase-update/user-shell.html @@ -4,9 +4,9 @@

Shell пользователя

Параметр id:

Переключайте User 1 ↔ User 2 ↔ User 3: тот же viewKey, меняется только param id.

@@ -21,8 +21,8 @@

Shell пользователя

diff --git a/public/features/routing-advanced/index.html b/public/features/routing-advanced/index.html index adb93bce..84c94eb8 100644 --- a/public/features/routing-advanced/index.html +++ b/public/features/routing-advanced/index.html @@ -23,12 +23,12 @@
diff --git a/public/features/routing-advanced/intro.html b/public/features/routing-advanced/intro.html index 7ade2d15..d90437ca 100644 --- a/public/features/routing-advanced/intro.html +++ b/public/features/routing-advanced/intro.html @@ -7,9 +7,9 @@

Продвинутые сценарии

Приоритет маршрутов

При нескольких кандидатах побеждает более специфичный pattern: статический сегмент → динамический :id → catch-all *.

@@ -30,13 +30,13 @@

Приоритет маршрутов

Третий уровень вложенности

Цепочка outlet: корневой → users-layoutuser-layout → конечный view. Профиль и настройки одного пользователя разделяют layout второго уровня.

Catch-all и 404

Маршрут path="*" обрабатывает path, для которого нет более специфичного совпадения. URL в адресной строке сохраняется; страница не перезагружается.

diff --git a/public/features/routing-advanced/not-found.html b/public/features/routing-advanced/not-found.html index f0b1530b..e441a91c 100644 --- a/public/features/routing-advanced/not-found.html +++ b/public/features/routing-advanced/not-found.html @@ -3,7 +3,7 @@

Страница не найдена

Сработал catch-all path="*": для запрошенного path нет более специфичного маршрута.

diff --git a/public/features/routing-advanced/user-settings.html b/public/features/routing-advanced/user-settings.html index 36f1728a..0b0a1287 100644 --- a/public/features/routing-advanced/user-settings.html +++ b/public/features/routing-advanced/user-settings.html @@ -3,8 +3,8 @@

Настройки пользователя

Третий уровень: users-layoutuser-layout → view настроек.

diff --git a/public/features/routing-advanced/user.html b/public/features/routing-advanced/user.html index c15af5f0..5725b1d9 100644 --- a/public/features/routing-advanced/user.html +++ b/public/features/routing-advanced/user.html @@ -3,7 +3,7 @@

Профиль пользователя

Конечный view второго layout-уровня. Настройки — sibling-маршрут на том же уровне вложенности.

diff --git a/public/features/routing-advanced/users-about.html b/public/features/routing-advanced/users-about.html index bc5b4c9e..94ab4cd4 100644 --- a/public/features/routing-advanced/users-about.html +++ b/public/features/routing-advanced/users-about.html @@ -3,8 +3,8 @@

О разделе Users

Статический сегмент about имеет приоритет над :id — path /users/about не интерпретируется как профиль.

diff --git a/public/features/routing-advanced/users-list.html b/public/features/routing-advanced/users-list.html index f516eede..982824c1 100644 --- a/public/features/routing-advanced/users-list.html +++ b/public/features/routing-advanced/users-list.html @@ -3,8 +3,8 @@

Список пользователей

Index-маршрут ветки /users.

diff --git a/public/features/routing-basics/index.html b/public/features/routing-basics/index.html index 7f974108..f6ffe365 100644 --- a/public/features/routing-basics/index.html +++ b/public/features/routing-basics/index.html @@ -23,9 +23,9 @@
diff --git a/public/features/routing-basics/intro.html b/public/features/routing-basics/intro.html index e95f69ab..a11d95e3 100644 --- a/public/features/routing-basics/intro.html +++ b/public/features/routing-basics/intro.html @@ -6,8 +6,8 @@

Основы маршрутизации

Плоские маршруты

Два независимых path ссылаются на разные view. При переходе между «Страница A» и «Страница B» роутер выгружает текущий view и монтирует новый в тот же outlet. Шапка и панель навигации остаются на месте — они объявлены вне роутера.

@@ -25,15 +25,15 @@

Плоские маршруты

-Страница A -Страница B +Страница A +Страница B

История браузера

-

Клик по ссылке с aura-router-link добавляет запись в session history. Последовательность A → B → «Назад» вернёт страницу A: и URL, и контент восстановятся без перезагрузки документа.

+

Клик по ссылке с data-aura-link добавляет запись в session history. Последовательность A → B → «Назад» вернёт страницу A: и URL, и контент восстановятся без перезагрузки документа.

Откройте A, перейдите на B, затем нажмите «Назад» в браузере.

diff --git a/public/features/routing-basics/page-a.html b/public/features/routing-basics/page-a.html index 322788a1..4303499f 100644 --- a/public/features/routing-basics/page-a.html +++ b/public/features/routing-basics/page-a.html @@ -3,7 +3,7 @@

Страница A

Плоский маршрут без промежуточного layout.

diff --git a/public/features/routing-basics/page-b.html b/public/features/routing-basics/page-b.html index 20623290..b3dc1aa4 100644 --- a/public/features/routing-basics/page-b.html +++ b/public/features/routing-basics/page-b.html @@ -3,8 +3,8 @@

Страница B

Sibling-маршрут на том же уровне дерева, что и страница A.

Кнопка «Назад» в браузере вернёт страницу A без перезагрузки вкладки.

diff --git a/public/features/routing-nested/index.html b/public/features/routing-nested/index.html index 67f8fd28..23e107ad 100644 --- a/public/features/routing-nested/index.html +++ b/public/features/routing-nested/index.html @@ -23,12 +23,12 @@
diff --git a/public/features/routing-nested/intro.html b/public/features/routing-nested/intro.html index 8099dd92..44e122ba 100644 --- a/public/features/routing-nested/intro.html +++ b/public/features/routing-nested/intro.html @@ -6,10 +6,10 @@

Вложенные маршруты

Layout и вложенный outlet

Маршрут с атрибутом layout рендерит шаблон с собственным <aura-outlet>. Дочерние маршруты монтируют view во внутренний outlet. При переходе «User 1» → «User 2» layout остаётся в DOM, обновляется только содержимое slot.

@@ -40,8 +40,8 @@

Layout и вложенный outlet

Index-дочерний маршрут (path=".")

Точка (path=".") задаёт view по умолчанию для ветки. URL остаётся /features/routing-nested/users — без дополнительного сегмента и без редиректа.

@@ -57,16 +57,16 @@

Index-дочерний маршрут (path=".")

-Список +Список

Sibling-маршруты и сегмент :id

Под layout — два sibling-маршрута: index (path=".", список) и профиль (path=":id"). Переход «Список» → «User 2» — смена sibling: layout остаётся, меняется конечный view. Переход «User 1» → «User 2» — update того же маршрута :id: view тот же, меняются параметр id и URL.

@@ -84,8 +84,8 @@

Sibling-маршруты и сегмент :id

-Список -User 1 -User 2 +Список +User 1 +User 2 diff --git a/public/features/routing-nested/user.html b/public/features/routing-nested/user.html index 4b47f74f..e3f3b5f6 100644 --- a/public/features/routing-nested/user.html +++ b/public/features/routing-nested/user.html @@ -3,9 +3,9 @@

Профиль пользователя

Динамический сегмент :id. Переход между пользователями — update конечного view без размонтирования layout.

diff --git a/public/features/routing-nested/users-list.html b/public/features/routing-nested/users-list.html index 6f6c0aca..fb9270b5 100644 --- a/public/features/routing-nested/users-list.html +++ b/public/features/routing-nested/users-list.html @@ -3,8 +3,8 @@

Список пользователей

Index-маршрут (path=".") — URL /features/routing-nested/users без дополнительного сегмента.

diff --git a/src/examples/demo/layout-templates.ts b/src/examples/demo/layout-templates.ts index 832107d8..38ff7375 100644 --- a/src/examples/demo/layout-templates.ts +++ b/src/examples/demo/layout-templates.ts @@ -4,7 +4,7 @@ function renderNavLinks(basePath: string, links: DemoNavLink[]): string { return links .map( (link) => - `${link.label}`, + `${link.label}`, ) .join('\n '); } diff --git a/src/examples/demo/main.ts b/src/examples/demo/main.ts index 07795372..3d1b75e1 100644 --- a/src/examples/demo/main.ts +++ b/src/examples/demo/main.ts @@ -51,7 +51,7 @@ if (router) { document.addEventListener( 'click', (event) => { - if ((event.target as Element).closest('[aura-router-link]')) { + if ((event.target as Element).closest('[data-aura-link]')) { scheduleDemoUiRefresh(); } }, diff --git a/src/modules/aura-router/README.md b/src/modules/aura-router/README.md index 6a7c1b09..142fb3cb 100644 --- a/src/modules/aura-router/README.md +++ b/src/modules/aura-router/README.md @@ -31,9 +31,9 @@ AuraRouter.configure({ notFoundHandler: (url, router) => { /* ... */ } }); | Атрибут | Описание | |---------|----------| | `prefetch` | Default prefetch для in-app ссылок: `intent` (default), `tap`, `false` / `none` (off). Override на ссылке: `data-prefetch`. | -| `links-selector` | CSS-селектор in-app ссылок для перехвата кликов. По умолчанию: `[aura-router-link]`. Same-origin absolute `https://…` / `//…` тоже SPA; чужой origin — обычный переход (см. [guide — How href resolves](../../../docs/guide/02-routes-and-navigation.md#how-href-resolves)). | +| `links-selector` | CSS-селектор in-app ссылок для перехвата кликов. По умолчанию: `[data-aura-link]`. Same-origin absolute `https://…` / `//…` тоже SPA; чужой origin — обычный переход (см. [guide — How href resolves](../../../docs/guide/02-routes-and-navigation.md#how-href-resolves)). | | `links-container-selector` | Опционально сужает поиск ссылок для active-state до предка (по умолчанию — весь документ). | -| `link-active-class` | CSS-класс точного совпадения URL на `[aura-router-link]`. | +| `link-active-class` | CSS-класс точного совпадения URL на `[data-aura-link]`. | | `link-active-branch-class` | CSS-класс prefix-совпадения (активная ветка / раздел). | | `error-template` | Id `