Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
permissions:
contents: read
packages: write
id-token: write

jobs:
publish:
Expand Down Expand Up @@ -38,3 +39,12 @@ jobs:
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare Node.js environment for npm registry
uses: actions/setup-node@v6
Comment thread
frankieyan marked this conversation as resolved.
Comment thread
frankieyan marked this conversation as resolved.
with:
node-version-file: .node-version
registry-url: https://registry.npmjs.org/

- name: Publish package to npm registry
run: npm publish --access public --provenance
Comment thread
frankieyan marked this conversation as resolved.
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,3 @@ This file documents all notable changes, following the [Keep a Changelog](https:
### Features

* Port React Compiler tracker from todoist-web ([#6](https://github.com/Doist/react-compiler-tracker/issues/6)) ([8e8ec3b](https://github.com/Doist/react-compiler-tracker/commit/8e8ec3be05a9738aca7215d98f9d2e83ef59378c))

## [Unreleased]

-
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# React Compiler Tracker

While it's safe to opt out of using memoization hooks such as `useCallback` and `useMemo` in code optimized by the [React Compiler](https://react.dev/learn/react-compiler), it is easy to introduce violations that cause the compiler to bail out, leading to performance issues when values are not memoized.
[![npm version](https://img.shields.io/npm/v/@doist/react-compiler-tracker)](https://www.npmjs.com/package/@doist/react-compiler-tracker)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Node.js](https://img.shields.io/node/v/@doist/react-compiler-tracker)](https://nodejs.org/)

Designed to run as a part of Git hooks and CI, this tool helps prevent this and progressively adopt the React Compiler by tracking and warning against newly introduced compilation errors. It maintains a `.react-compiler-tracker.json` record file to track known compiler errors per file.
The [React Compiler](https://react.dev/learn/react-compiler) automatically memoizes your components, eliminating the need for `useCallback` and `useMemo`. However, certain code patterns cause the compiler to bail out. When this happens, your components lose automatic optimization, potentially causing performance regressions.

Inspired by [esplint](https://github.com/hjylewis/esplint) and [react-compiler-marker](https://github.com/blazejkustra/react-compiler-marker), this tool tracks compiler errors in a `.react-compiler-tracker.json` file and integrates with Git hooks and CI to prevent new violations from being introduced.

## Prerequisites

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@
},
"homepage": "https://github.com/Doist/react-compiler-tracker#readme",
"engines": {
"node": ">=22"
"node": "^22.22.0 || >=24.13.0"
},
"files": [
"dist",
"README.md",
"LICENSE"
"LICENSE",
"CHANGELOG.md"
],
"lint-staged": {
"*.{js,ts,mjs,mts,json,md}": "biome check --write --no-errors-on-unmatched"
Expand Down