Skip to content

Deep overhaul: TypeScript + builder-bob, real tests/CI, bug fixes, modern docs (recommend v1.0.0)#37

Open
kuraydev wants to merge 6 commits into
masterfrom
chore/deep-overhaul-2026
Open

Deep overhaul: TypeScript + builder-bob, real tests/CI, bug fixes, modern docs (recommend v1.0.0)#37
kuraydev wants to merge 6 commits into
masterfrom
chore/deep-overhaul-2026

Conversation

@kuraydev

Copy link
Copy Markdown
Owner

Automated deep-overhaul PR — review before merge.

Review fixes applied: bumped package.json to 1.0.0 and converted the CHANGELOG ## [Unreleased] section to ## [1.0.0] - 2026-06-29 (with matching compare link) per reviewer request before ship.

Summary

This is a full modernization of a ~6-year-stale (last publish 0.1.10, 2020) pure-JS React Native component library. It migrates the source to TypeScript, introduces a real build pipeline, adds a test suite + CI, fixes several genuine bugs, and rewrites the docs — without changing the public API (named HeaderSearchBar / HeaderClassicSearchBar exports, the default object export, and every prop name + runtime default are preserved).

Because the published output layout and peer floors change, this ships as a major bump to 1.0.0.

Non-breaking improvements

Bug fixes (pure, behavior-correcting)

  • secondTitleFontSize is now honored — the style hardcoded fontSize: 18 and ignored the prop. Default remains 18.
  • SearchBox.renderTextInput is now a const local; it previously leaked an implicit global on every render.
  • Components no longer blindly spread {...props} onto native elements (Androw, View, Icon, Ripple), which forwarded unknown props and caused warnings. Intended props are passed explicitly; search props still forward to the internal SearchBox.
  • Added accessibilityRole to the search container and hamburger button.

Tooling & quality

  • react-native-builder-bob build (CommonJS + ESM + TypeScript declarations); main/module/types/react-native/source/exports + files allowlist. Verified the built CJS entry still exposes named + default exports and npm pack produces a clean 60-file tarball (no tests/example).
  • Wrapped components in React.memo; moved static styles into StyleSheet.create.
  • ESLint 9 flat config with typescript-eslint (replacing dead airbnb + babel-eslint) and a real Prettier config (the README advertised a Prettier badge with no config).
  • Declared the previously-undeclared react-native-material-ripple peer (optional via peerDependenciesMeta); widened peer ranges.
  • Jest + @testing-library/react-native suite — 15 tests across both header variants and SearchBox.
  • GitHub Actions CI (lint + typecheck + test + build on Node 18/20/22); dependabot broadened to root, /example, and github-actions.
  • Metadata repointed from WrathChaos / freakycoder.com to kuraydev.
  • README rewrite (accurate props tables, TS usage, New Architecture/Expo note, complete peer install with SafeAreaProvider setup, fixed badges/links); added CHANGELOG.md, CONTRIBUTING.md, issue/PR templates.
  • Modernized the /example app to import from the package and render both variants (not deleted).

Breaking changes (recommend v1.0.0 major)

  1. Compiled output. Source moved from raw lib/src/*.js to a compiled lib/ build. Deep imports like react-native-header-search-bar/lib/src/... no longer resolve — import from the package root. The package-root import shape is unchanged.
  2. Peer floors raised: react >=16.8.0, react-native >=0.60.0, react-native-safe-area-context >=3.0.0 (the useSafeArea() -> useSafeAreaInsets() fix; useSafeArea was removed in safe-area-context v3).
  3. prop-types/defaultProps removed in favor of TypeScript types + default parameters. Runtime prop validation is gone; prop-types is no longer a dependency.
  4. secondTitleFontSize no longer a no-op and native elements no longer receive the blind {...props} spread — subtle rendering changes for anyone who depended on the old broken behavior.

Migration is a no-op for typical consumers importing from the package root on a modern RN; see CHANGELOG.md for details.

Intentionally preserved (to avoid visual regressions)

  • react-native-androw (Android shadow) and @freakycoder/react-native-helpers (notch/status-bar math) are kept rather than swapped for elevation/boxShadow or safe-area math, since replacing them changes pixels for current users. Their abandoned-dependency / New-Arch risk is documented in the README/CHANGELOG instead.
  • All default style/dimension constants (header height 210, radii, colors) are unchanged.

New Architecture

Added an explicit compatibility statement: the package contains no native code of its own, so it works on the old and new architecture; New-Arch readiness depends on the app's native peer deps. Expo support documented (Dev Client / prebuild, not Expo Go).

Verification

Run against ./node_modules/.bin binaries directly (the rtk shell proxy intercepts bare tsc/eslint/jest with a stale resolver and reports false errors):

Check Command Result
Install npm install --no-audit --no-fund ok — 931 packages, prepare/bob build clean
Typecheck tsc --noEmit -p tsconfig.json (TS 5.9.3) pass (exit 0)
Lint eslint "src/**/*.{ts,tsx}" pass — 0 problems
Test jest --ci pass — 3 suites, 15 tests
Build bob build pass — CJS + ESM + d.ts, no warnings
Pack npm pack --dry-run clean 60-file tarball (lib + src + README + LICENSE + CHANGELOG)

Native peer deps are intentionally not installed (typed via ambient declarations, virtually mocked in tests); CI re-validates on clean runners via npm ci (lockfile committed).

Notes

kuraydev added 6 commits June 29, 2026 16:23
- Convert lib/src JS to typed src/*.tsx|ts with exported prop interfaces
  (HeaderSearchBarProps, HeaderClassicSearchBarProps, SearchBoxProps)
- Drop PropTypes/defaultProps in favor of typed default parameters
- Wrap components in React.memo + React.forwardRef
- Fix implicit global: renderTextInput is now a local const (SearchBox)
- Fix secondTitleFontSize being ignored (was hard-coded to 18)
- Replace removed useSafeArea() with useSafeAreaInsets()
- Stop spreading {...props} onto Icon/Ripple/View; keep SearchBox passthrough
- Add accessibility roles/labels
- Point example app import at the package root
- Compile to lib/ (commonjs + module + typescript) via react-native-builder-bob
- main/module/react-native/source/types + exports map; bare import resolves,
  deep lib/src imports removed (breaking, documented)
- files allowlist (src, lib, docs only)
- Add scripts: build, clean, typecheck, lint, test, prepare, prepack
- peerDependencies widened with peerDependenciesMeta; add the previously
  undeclared react-native-material-ripple; raise safe-area-context floor to >=3
- Repoint repository/homepage/bugs URLs to kuraydev
- gitignore generated lib/ and coverage/; add tsconfig(.build).json + babel config
- Replace deprecated babel-eslint/airbnb .eslintrc with eslint.config.js
  (typescript-eslint + eslint-plugin-react + prettier)
- Add .prettierrc/.prettierignore (README advertised prettier with no config)
- Add jest.setup.js virtual-mocking the native peer deps
- ci.yml runs install + lint + typecheck + test + build on Node 18/20/22
- dependabot now watches root, example and github-actions
- Accurate props/API tables, full peer-dep install line incl. material-ripple
- TypeScript, New Architecture/Expo, SafeAreaProvider and migration notes
- Fix badges/links to kuraydev; drop stale 2019 sections
- Add CHANGELOG (Keep a Changelog), CONTRIBUTING, issue/PR templates
@kuraydev kuraydev force-pushed the chore/deep-overhaul-2026 branch from 2f875b3 to 35ee4d5 Compare June 29, 2026 13:30
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