Skip to content

Commit 98bef7c

Browse files
authored
Deprecate nativeMode (#220)
* Deprecate nativeMode option in SpatialNavigation; update documentation and add warning for removal in next version. * ci: update Node.js version in workflows to 24 * Create changeset * ci: upgrade actions/checkout and actions/setup-node to v6 in workflows * ci: remove npm update step
1 parent 74b4165 commit 98bef7c

6 files changed

Lines changed: 27 additions & 13 deletions

File tree

.changeset/slimy-spoons-kick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@noriginmedia/norigin-spatial-navigation-core": patch
3+
---
4+
5+
- Deprecate `nativeMode` option

.github/workflows/dev-portal.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212

1313
steps:
1414
- name: Checkout Project A
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v6
1616
with:
1717
path: ./project
1818

1919
- name: Checkout Project B
20-
uses: actions/checkout@master
20+
uses: actions/checkout@v6
2121
with:
2222
repository: Norigin/dev-portal
2323
token: ${{ secrets.NM_GH_TOKEN }}

.github/workflows/pull-request.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ jobs:
88
name: Test
99
steps:
1010
- name: Checkout repository
11-
uses: actions/checkout@v4
11+
uses: actions/checkout@v6
1212

1313
- name: Setup node
14-
uses: actions/setup-node@v4
14+
uses: actions/setup-node@v6
1515
with:
16-
node-version: 22
16+
node-version: 24
1717
cache: npm
1818

1919
- name: Install dependencies

.github/workflows/release.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,14 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Checkout Repo
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
2121

22-
- name: Setup Node.js 22
23-
uses: actions/setup-node@v4
22+
- name: Setup Node
23+
uses: actions/setup-node@v6
2424
with:
25-
node-version: 22
25+
node-version: 24
2626
cache: npm
2727

28-
- name: Update npm for OICD support
29-
run: npm install -g npm@latest
30-
3128
- name: Install Dependencies
3229
run: npm ci
3330

docs/api-reference/SpatialNavigation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ init(config?: {
6262
| ----------------------------------- | ---------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |
6363
| `debug` | `boolean` | `false` | Log navigation decisions to the browser console. |
6464
| `visualDebug` | `boolean` | `false` | Draw a canvas overlay showing component bounding boxes and navigation paths. |
65-
| `nativeMode` | `boolean` | `false` | Disable DOM key event listeners (for React Native). You must drive navigation manually. |
65+
| `nativeMode` | `boolean` | `false` | **Deprecated.** Disable DOM key event listeners (for React Native). You must drive navigation manually. |
6666
| `throttle` | `number` | `0` | Milliseconds to wait between processing repeated key presses. `0` means no throttle. |
6767
| `throttleKeypresses` | `boolean` | `false` | When `true` and `throttle > 0`, throttle key repeat events while a key is held down. |
6868
| `useGetBoundingClientRect` | `boolean` | `false` | Use `getBoundingClientRect()` instead of `offsetLeft/Top` for layout measurement. Use this when elements are CSS-transformed or scaled. |

packages/core/src/SpatialNavigation.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,10 @@ class SpatialNavigationService {
663663
init({
664664
debug = false,
665665
visualDebug = false,
666+
/**
667+
* @deprecated
668+
* Native mode will be removed in the next version
669+
*/
666670
nativeMode = false,
667671
throttle: throttleParam = 0,
668672
throttleKeypresses = false,
@@ -712,6 +716,10 @@ class SpatialNavigationService {
712716

713717
draw();
714718
}
719+
} else {
720+
console.warn(
721+
'nativeMode option is deprecated and will be removed in the next version.'
722+
);
715723
}
716724
}
717725
}
@@ -1765,6 +1773,10 @@ class SpatialNavigationService {
17651773
}
17661774
}
17671775

1776+
/**
1777+
* @deprecated
1778+
* Native mode will be removed in the next version
1779+
*/
17681780
isNativeMode() {
17691781
return this.nativeMode;
17701782
}

0 commit comments

Comments
 (0)