Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

77 changes: 0 additions & 77 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These are supported funding model platforms

github: [wrathchaos]
github: [kuraydev]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
Expand Down
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Bug report
about: Report a problem with react-native-dynamic-search-bar
title: "[Bug] "
labels: bug
assignees: ""
---

## Describe the bug

A clear and concise description of what the bug is.

## Reproduction

Steps to reproduce the behavior, or a link to a minimal reproduction (Snack/repo):

1. Render `<SearchBar ... />`
2. ...
3. See error

## Expected behavior

What you expected to happen.

## Screenshots / video

If applicable, add screenshots or a screen recording.

## Environment

- `react-native-dynamic-search-bar` version:
- `react-native` version:
- `react` version:
- Platform: iOS / Android / Expo
- New Architecture enabled: yes / no
- Using the built-in `react-native-spinkit` spinner: yes / no

## Additional context

Add any other context about the problem here.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for react-native-dynamic-search-bar
title: "[Feature] "
labels: enhancement
assignees: ""
---

## Is your feature request related to a problem?

A clear and concise description of what the problem is.

## Describe the solution you'd like

A clear and concise description of what you want to happen, including any new
props or API surface.

## Describe alternatives you've considered

A clear and concise description of any alternative solutions or features.

## Additional context

Add any other context or screenshots about the feature request here.
23 changes: 23 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Summary

<!-- What does this PR change and why? -->

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing behavior to change)
- [ ] Documentation / tooling

## Checklist

- [ ] `npm run typecheck` passes
- [ ] `npm run lint` passes
- [ ] `npm test` passes
- [ ] `npm run build` passes
- [ ] I did not change public prop names or default values (or documented it as breaking)
- [ ] Commits follow Conventional Commits

## Related issues

<!-- e.g. Closes #108 -->
17 changes: 12 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
groups:
dev-dependencies:
dependency-type: development
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]

jobs:
build:
name: Lint, typecheck, test & build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install --legacy-peer-deps

- name: Typecheck
run: npm run typecheck

- name: Lint
run: npm run lint

- name: Test
run: npm test -- --ci

- name: Build
run: npm run build
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ buck-out/

# Bundle artifact
*.jsbundle

# Build output (react-native-builder-bob)
/lib/
coverage/
*.tsbuildinfo
4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

5 changes: 0 additions & 5 deletions .husky/pre-commit

This file was deleted.

8 changes: 0 additions & 8 deletions .npmignore

This file was deleted.

74 changes: 73 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,78 @@
# Changelog

## [2.0.0](https://github.com/WrathChaos/react-native-dynamic-search-bar/tree/2.0.0) (2020-10-18)
All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

> **Recommended next release: `3.0.0` (major).** This release modernizes the
> build, makes the native spinner optional, and fixes a duplicate event bug.
> See the migration notes below.

### Added

- Function-component rewrite with `forwardRef` + `useImperativeHandle`. A `ref`
now exposes `focus()`, `blur()`, `clear()`, and `getTextInput()` so you can
drive the input imperatively and read its value (closes #97).
- New `spinnerComponent` prop to supply a custom (JS-only) spinner — ideal for
Expo / New Architecture apps that avoid native modules (e.g.
`react-native-animated-spinkit`).
- **react-native-web support.** The component now bundles and renders on
react-native-web with `react-native-spinkit` not installed. The native
spinner is never imported statically or required on web (a `Platform.OS ===
"web"` guard short-circuits before the lazy `require`), and the spinner slot
falls back to React Native's cross-platform `ActivityIndicator` whenever
`react-native-spinkit` is absent — web, Expo, or native without the optional
package (closes #98, #102). On native this is an intentional behavior change:
a requested spinner (`spinnerVisibility`) previously rendered nothing when the
optional module was missing and now shows the `ActivityIndicator` fallback.
Installing `react-native-spinkit` keeps the native `<SpinKit/>` render
byte-for-byte identical.
- Accessibility roles/labels on the container, search icon (`Search`), clear
icon (`Clear search`), and a `search` role on the input.
- Real unit test suite (Jest + React Native Testing Library).
- GitHub Actions CI (lint, typecheck, test, build on a Node 18/20/22 matrix),
issue/PR templates, and a `CONTRIBUTING.md`.
- `react` and `react-native` are now declared as `peerDependencies`.
- ESM + CommonJS + TypeScript build outputs via `react-native-builder-bob`,
with a proper `exports` map, `module`, `react-native`, `sideEffects`, and a
`files` allowlist.

### Changed

- **BREAKING:** `react-native-spinkit` is now an **optional** peer dependency.
It is required lazily (and skipped entirely on web), so apps that never use
the built-in spinner, run on Expo Go, or target react-native-web no longer
fail to build (closes #98, #102). Install it explicitly only if you use the
built-in spinner with no `spinnerComponent`.
- **BREAKING:** Build output moved from `build/dist/SearchBar.js` to
`react-native-builder-bob` output under `lib/`. The default import
(`import SearchBar from "react-native-dynamic-search-bar"`) is unchanged.
- Source moved from `lib/` to `src/`; a named export `{ SearchBar }` and
exported types (`ISearchBarProps`, `ISource`, `SpinnerType`,
`SearchBarHandle`) are now available.

### Fixed

- **BREAKING (behavioral):** `onSubmitEditing` (and other `TextInputProps`) no
longer fire twice. Props are now split explicitly — touchable props go to the
outer container, `TextInputProps` go to the `TextInput` (closes #108).
- Replaced the dead `tslint` lint script with ESLint 9 flat config; fixed the
`format`/`version` scripts that targeted a non-existent `src/` glob.
- Tightened types: removed `any` from `ImageComponent`/`spinnerType`, typed
`spinnerType` as a `SpinnerType` union, replaced deprecated `React.ReactChild`
with `React.ReactNode`, and aligned `ISource` with `ImageSourcePropType`.

### Removed

- Dead/abandoned devDependencies: `tslint` (script only),
`react-native-typescript-transformer`, `@react-native-community/eslint-config`,
`eslint-config-airbnb`, `@types/react-native` (RN ships its own types),
`npm-post-install`, `prettier-format`.

## [2.0.0](https://github.com/kuraydev/react-native-dynamic-search-bar/tree/2.0.0) (2020-10-18)

[Full Changelog](https://github.com/WrathChaos/react-native-dynamic-search-bar/compare/1.3.1...2.0.0)

Expand Down
46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributing

Thanks for your interest in improving **react-native-dynamic-search-bar**! 🎉

## Development setup

This is a TypeScript React Native component library built with
[`react-native-builder-bob`](https://github.com/callstack/react-native-builder-bob).

```bash
git clone https://github.com/kuraydev/react-native-dynamic-search-bar.git
cd react-native-dynamic-search-bar
npm install --legacy-peer-deps
```

The library source lives in [`src/`](./src). The compiled output (`lib/`) is
generated by `npm run build` and is **not** committed.

## Scripts

| Script | Description |
| ------------------- | ---------------------------------------------------- |
| `npm run typecheck` | Type-check the source with `tsc --noEmit` |
| `npm run lint` | Lint with ESLint (flat config, `eslint.config.js`) |
| `npm test` | Run the Jest + React Native Testing Library suite |
| `npm run build` | Build CommonJS, ES Module and TypeScript definitions |
| `npm run format` | Format the source with Prettier |

Please make sure `typecheck`, `lint`, `test` and `build` all pass before
opening a pull request — CI runs the same steps on a Node 18/20/22 matrix.

## Commit messages

This repo follows [Conventional Commits](https://www.conventionalcommits.org/).
Use prefixes such as `feat:`, `fix:`, `docs:`, `chore:`, `refactor:`, `test:`.

## Backwards compatibility

This is a widely-installed published library. **Do not** change public prop
names or their default values, or remove the default export, without flagging
the change as breaking and proposing a major version bump.

## Reporting issues

Open an issue with a minimal reproduction (an Expo Snack or repo link is ideal)
and the environment details requested in the bug template.
Loading
Loading