Skip to content

feat(worker): offload browser search to web worker#88

Merged
adelpro merged 81 commits intoadelpro:developfrom
Vexxo-Dev:develop
Mar 16, 2026
Merged

feat(worker): offload browser search to web worker#88
adelpro merged 81 commits intoadelpro:developfrom
Vexxo-Dev:develop

Conversation

@Vexxo-Dev
Copy link
Copy Markdown
Contributor

@Vexxo-Dev Vexxo-Dev commented Mar 15, 2026

Closes #12

Summary

  • Add a dedicated search Web Worker that loads Quran data and indices off the main thread.
  • Introduce a typed worker client with requestId correlation and a main-thread fallback path.
  • Update React, Angular, and vanilla TS examples to use the worker when available, keeping synchronous search as a fallback.

Test plan

  • pnpm run lint
  • pnpm run test
  • pnpm run build

adelpro and others added 30 commits March 4, 2026 08:05
docs: Create Structured Documentation (adelpro#70)
feat(search): add optional regex query support (adelpro#71)
- Replace pnpm with yarn for package management and workspace setup
- Update CI workflows, documentation, and example scripts accordingly
- Add new GitHub workflows for security scanning and package manager detection
- Reorganize project files and update workspace configuration
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 15, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 17c6aae3-b7c3-4da5-9c30-7831854a21e9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can enforce grammar and style rules using `languagetool`.

Configure the reviews.tools.languagetool setting to enable/disable rules and categories. Refer to the LanguageTool Community to learn more.

Vexxo-Dev and others added 7 commits March 15, 2026 12:27
- Update worker support check to use globalThis for better compatibility.
- Refactor worker instantiation to handle unsupported environments gracefully.
- Declare worker globals (postMessage, self) in searchWorker.ts
- Use globalThis.Worker in searchWorkerClient.ts to fix no-undef
- Remove unused imports and fix types in english-to-arabic-builder.ts
- Remove unused parse import and type quranRows in word-level-transliteration.ts
- Add normalized_text to ayahData type in word-level-transliteration.ts
- validateLengths: use Record<string, unknown> for parsed
- main: use Record<string, unknown> for sourceData from JSON
- Import LRUCache from utils/lru-cache in searchWorker and searchWorkerClient
- Fix TS2322 by typing pending resolve as PendingResolve and asserting in initData/runSearch
@adelpro
Copy link
Copy Markdown
Owner

adelpro commented Mar 15, 2026

Salam @Vexxo-Dev, this is the most complete solution to the issue. Baraka Allahu fik. I need a bit more time to explore and analyze your implementation.

@Vexxo-Dev
Copy link
Copy Markdown
Contributor Author

و عليكم السلام ي هندسة @adelpro

مفيش اي مشكله خد وقتك و بارك الله ف وقتك ❤️

- Fix ESLint no-undef in worker files and switch LRUCache imports to utils/lru-cache
- Tighten types and remove remaining any in english-to-arabic-builder and word-level-transliteration
- Configure ESLint tsconfigRootDir in eslint.config.mjs to avoid multi-TSConfig parsing errors
@adelpro adelpro merged commit 0477000 into adelpro:develop Mar 16, 2026
7 checks passed
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.

5 participants