Skip to content

chore!: refactor & cleanup#155

Merged
erisu merged 25 commits into
apache:masterfrom
erisu:chore/refactor
Jun 8, 2026
Merged

chore!: refactor & cleanup#155
erisu merged 25 commits into
apache:masterfrom
erisu:chore/refactor

Conversation

@erisu

@erisu erisu commented Apr 13, 2026

Copy link
Copy Markdown
Member

Platforms affected

n/a

Motivation and Context

Refactor & Cleanup

Description

  • Use arrow functions where possible
  • Use template literals where possible
  • Refactor selfEvents to events to remove the need of renaming the variable.
  • Cleanup require block and ordering
  • Remove unnecessary node shebang from files that not executable.
  • Add static method version to match with other platforms
  • Don't allow changing platform name when constructing new Api.
  • Add async to methods where needed
  • Converted Api to an ES6 class
    • Moved all static and non static Api methods to class
    • Converted prefixed _* methods to be private with #*

Testing

  • npm t
  • cordova platform add
  • cordova run

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@codecov-commenter

codecov-commenter commented Apr 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 26.47059% with 325 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.77%. Comparing base (bc68d15) to head (8012581).

Files with missing lines Patch % Lines
lib/Api.js 25.11% 322 Missing ⚠️
lib/browser_handler.js 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #155      +/-   ##
==========================================
- Coverage   44.00%   43.77%   -0.23%     
==========================================
  Files           4        4              
  Lines         800      795       -5     
==========================================
- Hits          352      348       -4     
+ Misses        448      447       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@erisu erisu force-pushed the chore/refactor branch from 4d6988c to 8012581 Compare June 7, 2026 04:22
@erisu erisu marked this pull request as ready for review June 7, 2026 04:28
@erisu erisu changed the title chore: refactor & cleanup chore!: refactor & cleanup Jun 8, 2026
@erisu erisu merged commit 4e4c0de into apache:master Jun 8, 2026
11 checks passed
@erisu erisu deleted the chore/refactor branch June 8, 2026 04:12
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.

3 participants