codingjoe / codingjoe/esupgrade

Transformer: URL parsing/regex routing to URLPattern

Open
#140 0 comments 0 reactions 0 assignees View on GitHub
newly available
Dominant language
JavaScript
Stars
13
Forks
2
Avg merge
1d 5h
Merged PRs (30d)
6

Description

## Summary
Add a transformer that upgrades common URL regex/parsing routing patterns to `URLPattern`.
## Target transformation
Examples to support where safe:
- `new URL(u).pathname` + regex `.test/.exec` route checks -> `new URLPattern({ pathname: ... }).test/exec(...)`
- Manual host/path combination checks -> one `URLPattern` with `hostname` + `pathname`.
## Scope
- Baseline category: newly available (URLPattern became newly available in Sep 2025).
- Focus only on patterns that can be converted with high confidence.
## Acceptance criteria
- Add transformer implementation in `src/newlyAvailable/`.
- Export from `src/newlyAvailable.js`.
- Add comprehensive tests in `tests/newlyAvailable/`.
- Document in `README.md` with safe transformation constraints.
## Sources
- https://web.dev/blog/baseline-urlpattern
- https://web.dev/blog/baseline-digest-sep-2025

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.