MERGE! #13
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
javascript
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
thayen/portfolio-site!13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Code Review
This pull request introduces Biome as the project's linter and formatter, resulting in widespread formatting changes—primarily switching from spaces to tabs—across the codebase. It adds a
biome.jsonconfiguration file, updatespackage.jsonwith linting and formatting scripts, and includes the Biome VS Code extension recommendation. Review feedback highlights a significant issue insrc/components/keyword.astrowhere aresizeevent listener is added to thewindowobject every time a page loads, which will lead to memory leaks when using View Transitions. Additionally, thebiome.jsonfile contains incorrect configuration keys and non-standard glob patterns that require correction.The configuration key
includesis incorrect; Biome usesinclude(singular). Additionally, the!!prefix is not a standard way to exclude files in Biome globs. Exclusions should be defined in theignorefield. Note thatdistand.astroare typically ignored by default if they are listed in your.gitignoreandvcs.useIgnoreFileis enabled.This
resizeevent listener is being added to thewindowobject every timeinitKeywordsis called. BecauseinitKeywordsis triggered by theastro:page-loadevent (which fires on every navigation when using View Transitions), multiple redundant listeners will accumulate on thewindowobject. This leads to memory leaks and performance degradation.Furthermore,
initKeywordsis called both directly (line 152) and via the event listener (line 154), causing it to run twice on the initial page load.Additionally, line 145 uses spaces for indentation while the rest of the block uses tabs, which is inconsistent with the project's move to tabs.
Recommendation: Move the
windowresize listener outside of theinitKeywordsfunction so it is only registered once when the script module loads, and have it query the current keywords dynamically.