Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ed9b43e
upgrade to React 19; add backwards compatibility test-site script
k-gerner Dec 5, 2025
124d35f
Automated update to THIRD-PARTY-NOTICES from github action's 3rd part…
github-actions[bot] Dec 5, 2025
1f1fbbe
try updating run-tests.yml
k-gerner Dec 5, 2025
8b6ecbf
codex: try fixing old react errors
k-gerner Dec 5, 2025
bc0836b
update storybook command from p -> port
k-gerner Dec 5, 2025
783029c
update types and fiddle with Mapbox pin code to pass storybook tests
k-gerner Dec 8, 2025
9e0eb74
wrap various tasts with act() to cut down on log warns
k-gerner Dec 8, 2025
7cff0e5
try to update storybook config to get tests to pass
k-gerner Dec 8, 2025
d516cad
Update snapshots
github-actions[bot] Dec 8, 2025
d72c04c
Update snapshots
github-actions[bot] Dec 8, 2025
4e9ed74
Update snapshots
github-actions[bot] Dec 8, 2025
d2412cd
Update snapshots
github-actions[bot] Dec 8, 2025
a6ca968
rerun npm i in test site
k-gerner Dec 8, 2025
93e7e80
slight code cleanup
k-gerner Dec 9, 2025
23058d1
Update snapshots
github-actions[bot] Dec 9, 2025
eb50094
Update snapshots
github-actions[bot] Dec 9, 2025
d5ba01c
Update snapshots
github-actions[bot] Dec 9, 2025
f040db3
Update snapshots
github-actions[bot] Dec 9, 2025
0d290f7
Update snapshots
github-actions[bot] Dec 9, 2025
5a0b9cb
Update snapshots
github-actions[bot] Dec 9, 2025
d30bd77
Update snapshots
github-actions[bot] Dec 9, 2025
de7d9da
nits
k-gerner Dec 10, 2025
720fafd
Update snapshots
github-actions[bot] Dec 10, 2025
11f3a58
Update snapshots
github-actions[bot] Dec 10, 2025
a27d729
update kill command in visual coverage
k-gerner Dec 10, 2025
13f07a4
Update snapshots
github-actions[bot] Dec 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,33 @@ name: Run Tests
on: [push, pull_request]

jobs:
call_run_tests-react-19:
uses: yext/slapshot-reusable-workflows/.github/workflows/run_tests.yml@v1
with:
build_script: |
npx playwright install
node_matrix: '["20.x"]'
secrets:
MAPBOX_API_KEY: ${{ secrets.MAPBOX_API_KEY }}

call_run_tests-react-18:
uses: yext/slapshot-reusable-workflows/.github/workflows/run_tests.yml@v1
with:
build_script: |
npm i \
react@^18.2.0 \
react-dom@^18.2.0
npm install --save-optional \
"@swc/core-linux-arm-gnueabihf" \
"@swc/core-linux-arm64-gnu" \
"@swc/core-linux-arm64-musl" \
"@swc/core-linux-x64-gnu" \
"@swc/core-linux-x64-musl" \
"@swc/core-win32-arm64-msvc" \
"@swc/core-win32-ia32-msvc" \
"@swc/core-win32-x64-msvc"
npx playwright install
npm run build
node_matrix: '["18.x"]'
secrets:
MAPBOX_API_KEY: ${{ secrets.MAPBOX_API_KEY }}
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ dist/
/coverage
/storybook-static

.npm-cache/
test-site/yext-search-ui-react-*.tgz

.env
test-site/.env
.idea/

# misc
.DS_Store
.DS_Store
77 changes: 55 additions & 22 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
// .storybook/main.ts
import type { StorybookConfig } from '@storybook/react-webpack5';
import React from 'react';
import path from 'path';

const reactMajorVersion = Number(React.version.split('.')[0]);
const isLegacyReact = Number.isNaN(reactMajorVersion) ? false : reactMajorVersion < 18;

const config: StorybookConfig = {
stories: [
'../tests/**/*.stories.tsx'
],
features: {
storyStoreV7: false,
},
addons: [
'@etchteam/storybook-addon-status',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-a11y',
{
name: '@storybook/addon-coverage',
options: {
istanbul: {
include: ['src/components/**']
}
}
},
// NOTE: not using @storybook/addon-coverage preset (it triggers import.meta.resolve)
],

framework: {
Expand All @@ -31,18 +26,56 @@ const config: StorybookConfig = {

staticDirs: ['./public'],

webpackFinal: async (config) => ({
...config,
resolve: {
...config.resolve,
alias: {
...config.resolve?.alias,
'./SearchCore': require.resolve('../tests/__fixtures__/core/SearchCore.ts'),
'../utils/location-operations': require.resolve('../tests/__fixtures__/utils/location-operations.ts')
webpackFinal: async (config) => {
const final = {
...config,
resolve: {
...config.resolve,
extensions: [
...(config.resolve?.extensions ?? []),
'.ts',
'.tsx',
],
alias: {
...config.resolve?.alias,
'./SearchCore': require.resolve('../tests/__fixtures__/core/SearchCore.ts'),
'../utils/location-operations': require.resolve('../tests/__fixtures__/utils/location-operations.ts')
},
},
...(isLegacyReact && { externals: ['react-dom/client'] }),
module: {
...config.module,
rules: [
...(config.module?.rules ?? []),
{
test: /\.(ts|tsx)$/,
exclude: /node_modules/,
use: [
{
loader: require.resolve('babel-loader'),
options: {
cacheDirectory: true,
presets: [
require.resolve('@babel/preset-env'),
require.resolve('@babel/preset-react'),
require.resolve('@babel/preset-typescript'),
],
// ALWAYS include babel-plugin-istanbul so coverage is available by default.
// This avoids requiring a runtime flag or env var.
plugins: [
require.resolve('babel-plugin-istanbul'),
],
},
},
],
},
// no istanbul-instrumenter-loader here (incompatible with webpack5)
],
},
},
...(!React.version.startsWith('18') && { externals: ["react-dom/client"] })
}),
};

return final;
},

env: (config) => {
const mapboxApiKey = process.env.MAPBOX_API_KEY || process.env.REACT_APP_MAPBOX_API_KEY;
Expand Down
5 changes: 3 additions & 2 deletions .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { addons } from '@storybook/addons';
import { addons } from '@storybook/manager-api';
import yextTheme from './yextTheme';

addons.setConfig({
theme: require('./yextTheme.ts')
theme: yextTheme,
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion .storybook/yextTheme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { create } from '@storybook/theming';

module.exports = create({
const yextTheme = create({
base: 'light',
colorPrimary: '#eeeff0',
colorSecondary: '#2563eb',
Expand Down Expand Up @@ -30,3 +30,5 @@ module.exports = create({
brandUrl: 'https://github.com/yext/search-ui-react',
brandImage: './logo.png'
});

export default yextTheme;
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,6 @@ import '@yext/search-ui-react/bundle.css'

## Compatibility Notes

This library and its dependencies use optional chaining and other modern TS syntax that is not inherently supported by Webpack <5 (e.g. via `create-react-app@4`). Additional Babel plugins are needed for transpiling if using legacy versions.
This library and its dependencies use optional chaining and other modern TS syntax that is not inherently supported by Webpack <5 (e.g. via `create-react-app@4`). Additional Babel plugins are needed for transpiling if using legacy versions.

If you need to verify this package against multiple major React releases while developing locally, follow the workflow in [guides/react-compatibility.md](./guides/react-compatibility.md) to install the library into the `test-site` the same way end users consume it.
Loading
Loading