Skip to content

Resolve multiple bugs #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

istiak-tridip
Copy link
Contributor

@istiak-tridip istiak-tridip commented May 22, 2025

This PR fixes a few bugs & makes some refactors.

Bugs Fixed

  1. Handle route names that start with characters invalid for JavaScript identifiers
// Example
Route::get('/auth/2fa', TwoFactorAuthChallenge::class)->name('2fa.challenge');
  1. Handle invalid JS identifiers and reserved keywords in barrel file exports (fixes Use of reserved keywords if present in route name #71)
// Example
Route::get('/login', DefaultLogin::class)->name('default.login');
  1. Expanded the list of reserved JavaScript/TypeScript keywords to fix naming conflicts
// Example
Route::get('/protected/blog-post', TwoFactorAuthChallenge::class)->name('protected.post');
  1. Fixed JSDoc @see tags for invokable controller routes
// Example route
Route::get('/', HomePage::class)->name('home');
- * @see \App\Domains\Public\Pages\HomePage::home
+ * @see \App\Domains\Public\Pages\HomePage::__invoke

Refactors

  • Replaced the md5 hashing algorithm with the significantly faster xxh3
  • Refactored the conditions determining when generated route helpers are exported, as part of fixing the JSDoc issue for invokable routes.

P.S. Hey @joetannenbaum, a quick question regarding reserved route names like delete becoming deleteMethod. Given these are routes, I wondered if Route (e.g., deleteRoute) might be an alternative. Appreciate any insight!

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.

Use of reserved keywords if present in route name
2 participants