Skip to content
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

perf(index): convert unused capture group to non-capture group #330

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

Fdawgs
Copy link
Member

@Fdawgs Fdawgs commented Sep 15, 2023

  • Changed capture group (...) to non-capture group (?:...), as nothing is done with the captured text in this plugin, the regex engine is doing extra work capturing text only to end up not using it
  • Added the u unicode flag to every regex pattern, which acts as a strict mode for regex
  • Removed a redundant i case-insensitive flag from a pattern that had no word characters in it

Checklist

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit 70bdbc9 into master Sep 15, 2023
17 checks passed
@Fdawgs Fdawgs deleted the perf/regexp branch September 16, 2023 05:57
bodinsamuel referenced this pull request in specfy/specfy Nov 22, 2023
[![Mend Renovate logo
banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@fastify/autoload](https://github.com/fastify/fastify-autoload) |
[`5.7.1` ->
`5.8.0`](https://renovatebot.com/diffs/npm/@fastify%2fautoload/5.7.1/5.8.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@fastify%2fautoload/5.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@fastify%2fautoload/5.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@fastify%2fautoload/5.7.1/5.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@fastify%2fautoload/5.7.1/5.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>fastify/fastify-autoload (@&#8203;fastify/autoload)</summary>

###
[`v5.8.0`](https://github.com/fastify/fastify-autoload/releases/tag/v5.8.0)

[Compare
Source](https://github.com/fastify/fastify-autoload/compare/v5.7.2...v5.8.0)

**Full Changelog**:
fastify/fastify-autoload@v5.7.2...v5.8.0

###
[`v5.7.2`](https://github.com/fastify/fastify-autoload/releases/tag/v5.7.2)

[Compare
Source](https://github.com/fastify/fastify-autoload/compare/v5.7.1...v5.7.2)

#### What's Changed

- chore(deps-dev): bump esbuild from 0.16.17 to 0.17.0 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/fastify/fastify-autoload/pull/294](https://github.com/fastify/fastify-autoload/pull/294)
- chore(deps-dev): bump vitest from 0.26.3 to 0.27.1 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/fastify/fastify-autoload/pull/295](https://github.com/fastify/fastify-autoload/pull/295)
- chore(deps-dev): bump vitest from 0.27.3 to 0.28.3 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/fastify/fastify-autoload/pull/299](https://github.com/fastify/fastify-autoload/pull/299)
- chore(deps-dev): bump vitest from 0.28.5 to 0.29.1 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/fastify/fastify-autoload/pull/301](https://github.com/fastify/fastify-autoload/pull/301)
- chore(.gitignore): add bun lockfile by
[@&#8203;Fdawgs](https://github.com/Fdawgs) in
[https://github.com/fastify/fastify-autoload/pull/302](https://github.com/fastify/fastify-autoload/pull/302)
- chore(deps-dev): bump tsd from 0.25.0 to 0.28.0 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/fastify/fastify-autoload/pull/304](https://github.com/fastify/fastify-autoload/pull/304)
- chore(deps-dev): bump typescript from 4.9.5 to 5.0.2 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/fastify/fastify-autoload/pull/305](https://github.com/fastify/fastify-autoload/pull/305)
- chore(deps-dev): bump vitest from 0.29.8 to 0.30.1 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/fastify/fastify-autoload/pull/307](https://github.com/fastify/fastify-autoload/pull/307)
- ci: only trigger on pushes to main branches by
[@&#8203;Fdawgs](https://github.com/Fdawgs) in
[https://github.com/fastify/fastify-autoload/pull/308](https://github.com/fastify/fastify-autoload/pull/308)
- chore(deps-dev): bump
[@&#8203;types/node](https://github.com/types/node) from 18.16.5 to
20.1.0 by [@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/fastify/fastify-autoload/pull/310](https://github.com/fastify/fastify-autoload/pull/310)
- chore(deps-dev): bump vitest from 0.30.1 to 0.31.1 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/fastify/fastify-autoload/pull/312](https://github.com/fastify/fastify-autoload/pull/312)
- chore(deps-dev): bump esbuild from 0.17.19 to 0.18.0 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/fastify/fastify-autoload/pull/313](https://github.com/fastify/fastify-autoload/pull/313)
- chore(deps-dev): bump vitest from 0.31.4 to 0.32.0 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/fastify/fastify-autoload/pull/314](https://github.com/fastify/fastify-autoload/pull/314)
- refactor(index): convert unused capture groups to non-capture groups
by [@&#8203;Fdawgs](https://github.com/Fdawgs) in
[https://github.com/fastify/fastify-autoload/pull/318](https://github.com/fastify/fastify-autoload/pull/318)
- chore(deps-dev): bump vitest from 0.32.4 to 0.33.0 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/fastify/fastify-autoload/pull/319](https://github.com/fastify/fastify-autoload/pull/319)
- chore(deps-dev): bump vitest from 0.33.0 to 0.34.1 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/fastify/fastify-autoload/pull/321](https://github.com/fastify/fastify-autoload/pull/321)
- chore(deps-dev): bump esbuild from 0.18.20 to 0.19.2 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/fastify/fastify-autoload/pull/322](https://github.com/fastify/fastify-autoload/pull/322)
- chore(deps-dev): bump tsd from 0.28.1 to 0.29.0 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/fastify/fastify-autoload/pull/324](https://github.com/fastify/fastify-autoload/pull/324)
- perf: use `node:` prefix to bypass require.cache call for builtins by
[@&#8203;Fdawgs](https://github.com/Fdawgs) in
[https://github.com/fastify/fastify-autoload/pull/325](https://github.com/fastify/fastify-autoload/pull/325)
- feat: add FASTIFY_AUTOLOAD_TYPESCRIPT environment variable by
[@&#8203;Uzlopak](https://github.com/Uzlopak) in
[https://github.com/fastify/fastify-autoload/pull/327](https://github.com/fastify/fastify-autoload/pull/327)
- docs(readme): update typescript env variable section by
[@&#8203;Fdawgs](https://github.com/Fdawgs) in
[https://github.com/fastify/fastify-autoload/pull/328](https://github.com/fastify/fastify-autoload/pull/328)
- perf(index): convert unused capture group to non-capture group by
[@&#8203;Fdawgs](https://github.com/Fdawgs) in
[https://github.com/fastify/fastify-autoload/pull/330](https://github.com/fastify/fastify-autoload/pull/330)
- docs(readme): fix capitalization of typescript by
[@&#8203;Fdawgs](https://github.com/Fdawgs) in
[https://github.com/fastify/fastify-autoload/pull/333](https://github.com/fastify/fastify-autoload/pull/333)
- chore: add `.gitattributes` file by
[@&#8203;Fdawgs](https://github.com/Fdawgs) in
[https://github.com/fastify/fastify-autoload/pull/334](https://github.com/fastify/fastify-autoload/pull/334)
- test(commonjs): add missing `use strict` directives by
[@&#8203;Fdawgs](https://github.com/Fdawgs) in
[https://github.com/fastify/fastify-autoload/pull/336](https://github.com/fastify/fastify-autoload/pull/336)
- chore: remove `getPackageType` deps, fix for Bun by
[@&#8203;ObscuritySRL](https://github.com/ObscuritySRL) in
[https://github.com/fastify/fastify-autoload/pull/335](https://github.com/fastify/fastify-autoload/pull/335)

#### New Contributors

- [@&#8203;ObscuritySRL](https://github.com/ObscuritySRL) made their
first contribution in
[https://github.com/fastify/fastify-autoload/pull/335](https://github.com/fastify/fastify-autoload/pull/335)

**Full Changelog**:
fastify/fastify-autoload@v5.7.1...v5.7.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 4pm every weekday" in timezone
Europe/Paris, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/specfy/specfy).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6ImNob3JlL3Jlbm92YXRlQmFzZUJyYW5jaCJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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