Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 1, 2026

Compiler Adapter Improvements Plan

Addressing review comments from PR #213:

  • Replace any types with proper TypeScript types
    • Defined CompilerSource, CompilerFunction, and FilterCompilerConstructor types
    • Created CompilerModule interface for type safety
    • Removed all any usage
  • Remove top-level await to prevent import blocking
    • Wrapped dynamic imports in lazy initialization function (initializeCompiler)
    • Compiler loads on first use instead of module load time
    • Added singleton pattern with promise caching to prevent multiple simultaneous loads
  • Fix type compatibility issues between JSR and npm packages
    • Updated type exports with documentation about compatibility
    • Made getCompilerInfo() async to support lazy initialization
    • Exported getFilterCompiler() async function instead of direct export
  • Update documentation to reflect new async API
    • Updated COMPILER_INTEGRATION.md with async examples
    • Added note about lazy initialization design decision
  • Test the changes to ensure backward compatibility
  • Run linter and type checker

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
@github-actions github-actions bot added documentation Improvements or additions to documentation typescript rules-compiler configuration labels Jan 1, 2026
@jaypatrick jaypatrick marked this pull request as ready for review January 1, 2026 04:40
@jaypatrick jaypatrick merged commit f783c88 into refactoring-project Jan 1, 2026
1 check passed
@jaypatrick jaypatrick deleted the copilot/sub-pr-213 branch January 1, 2026 04:40
Copilot AI requested a review from jaypatrick January 1, 2026 04:40
jaypatrick added a commit that referenced this pull request Jan 1, 2026
* feat: integrate JSR @jk-com/adblock-compiler with npm fallback

- Add JSR package @jk-com/adblock-compiler@^0.6.0 as primary dependency
- Keep @adguard/hostlist-compiler as fallback
- Create compiler-adapter.ts for automatic fallback handling
- Update compiler.ts to use new adapter
- Logs which compiler is being used at runtime

Co-Authored-By: Warp <agent@warp.dev>

* docs: add compiler integration documentation

* [WIP] Integrate JSR @jk-com/adblock-compiler with fallback (#214)

* Initial plan

* refactor: Remove any types and top-level await from compiler-adapter

Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>

* Remove AdGuardTeam references, use jk-com/adblock-compiler exclusively (#215)

* Initial plan

* docs: remove all adguardteam references, use jk-com/adblock-compiler exclusively

Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>

* fix: update TypeScript source imports to use jk-com/adblock-compiler

Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>

* docs: update remaining documentation references to jk-com/adblock-compiler

Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>

* docs: remove adguard references from compiler READMEs

Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>

---------

Signed-off-by: Jayson Knight <jayson.knight@jaysonknight.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
Co-authored-by: Jayson Knight <jayson.knight@jaysonknight.com>

---------

Signed-off-by: Jayson Knight <jayson.knight@jaysonknight.com>
Co-authored-by: Warp <agent@warp.dev>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration documentation Improvements or additions to documentation rules-compiler typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants