Use block comment syntax for the multiline notes
CLAUDE.md reserves `//` for single-line comments. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -73,8 +73,10 @@ export function Outer({
|
|||||||
setIsOpen(false)
|
setIsOpen(false)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Nested rather than `&&`: React Compiler cannot lower a logical
|
/*
|
||||||
// expression in a test position inside a `try`.
|
* Nested rather than `&&`: React Compiler cannot lower a logical
|
||||||
|
* expression in a test position inside a `try`.
|
||||||
|
*/
|
||||||
if (cb) {
|
if (cb) {
|
||||||
if (typeof cb === 'function') {
|
if (typeof cb === 'function') {
|
||||||
// This timeout ensures that the callback runs at the same time as it would on native. I.e.
|
// This timeout ensures that the callback runs at the same time as it would on native. I.e.
|
||||||
|
|||||||
@@ -221,8 +221,10 @@ function DialogInner({
|
|||||||
const onPressSave = useCallback(async () => {
|
const onPressSave = useCallback(async () => {
|
||||||
setImageError('')
|
setImageError('')
|
||||||
setDisplayNameTooShort(false)
|
setDisplayNameTooShort(false)
|
||||||
// Hoisted above the `try`: React Compiler cannot lower a conditional
|
/*
|
||||||
// expression inside one.
|
* Hoisted above the `try`: React Compiler cannot lower a conditional
|
||||||
|
* expression inside one.
|
||||||
|
*/
|
||||||
const updatedMessage = isCurateList
|
const updatedMessage = isCurateList
|
||||||
? _(msg({message: 'User list updated', context: 'toast'}))
|
? _(msg({message: 'User list updated', context: 'toast'}))
|
||||||
: _(msg({message: 'Moderation list updated', context: 'toast'}))
|
: _(msg({message: 'Moderation list updated', context: 'toast'}))
|
||||||
|
|||||||
@@ -450,9 +450,11 @@ function DialogInner({
|
|||||||
const feedRkey = useMemo(() => new AtUri(info.uri).rkey, [info.uri])
|
const feedRkey = useMemo(() => new AtUri(info.uri).rkey, [info.uri])
|
||||||
|
|
||||||
const onToggleLiked = async () => {
|
const onToggleLiked = async () => {
|
||||||
// Hoisted out of the `try`: React Compiler cannot lower a logical
|
/*
|
||||||
// expression in a test position there, and the `else` below rules out
|
* Hoisted out of the `try`: React Compiler cannot lower a logical
|
||||||
// splitting this into nested ifs.
|
* expression in a test position there, and the `else` below rules out
|
||||||
|
* splitting this into nested ifs.
|
||||||
|
*/
|
||||||
const shouldUnlike = isLiked && likeUri
|
const shouldUnlike = isLiked && likeUri
|
||||||
try {
|
try {
|
||||||
playHaptic()
|
playHaptic()
|
||||||
|
|||||||
@@ -94,8 +94,10 @@ export function StepFinished() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hoisted above the `try`: React Compiler cannot lower these inside one, and
|
/*
|
||||||
// `listItems` is already settled by the earlier try/catch.
|
* Hoisted above the `try`: React Compiler cannot lower these inside one, and
|
||||||
|
* `listItems` is already settled by the earlier try/catch.
|
||||||
|
*/
|
||||||
const followDids = [
|
const followDids = [
|
||||||
BSKY_APP_ACCOUNT_DID,
|
BSKY_APP_ACCOUNT_DID,
|
||||||
...(listItems?.map(i => i.subject.did) ?? []),
|
...(listItems?.map(i => i.subject.did) ?? []),
|
||||||
|
|||||||
@@ -64,8 +64,10 @@ export function Header({
|
|||||||
const onTogglePinned = async () => {
|
const onTogglePinned = async () => {
|
||||||
playHaptic()
|
playHaptic()
|
||||||
|
|
||||||
// Hoisted above the `try`: inside it, `pinned` is `!savedFeedConfig.pinned`,
|
/*
|
||||||
// which is `!isPinned` on the branch that uses this.
|
* Hoisted above the `try`: inside it, `pinned` is `!savedFeedConfig.pinned`,
|
||||||
|
* which is `!isPinned` on the branch that uses this.
|
||||||
|
*/
|
||||||
const pinnedMessage = !isPinned
|
const pinnedMessage = !isPinned
|
||||||
? _(msg`Pinned to your feeds`)
|
? _(msg`Pinned to your feeds`)
|
||||||
: _(msg`Unpinned from your feeds`)
|
: _(msg`Unpinned from your feeds`)
|
||||||
|
|||||||
@@ -22,9 +22,11 @@ export function OpenCameraBtn({disabled, onAdd}: OpenCameraBtnProps) {
|
|||||||
const mediaGranted = mediaPermissionRes?.granted
|
const mediaGranted = mediaPermissionRes?.granted
|
||||||
const mediaCanAskAgain = mediaPermissionRes?.canAskAgain
|
const mediaCanAskAgain = mediaPermissionRes?.canAskAgain
|
||||||
|
|
||||||
// No useCallback: with the diagnostics above resolved this component compiles,
|
/*
|
||||||
// so React Compiler memoizes it, and the hand-written deps were what it could
|
* No useCallback: with the diagnostics above resolved this component compiles,
|
||||||
// not preserve.
|
* so React Compiler memoizes it, and the hand-written deps were what it could
|
||||||
|
* not preserve.
|
||||||
|
*/
|
||||||
const onPressTakePicture = async () => {
|
const onPressTakePicture = async () => {
|
||||||
try {
|
try {
|
||||||
if (!(await requestCameraAccessIfNeeded())) {
|
if (!(await requestCameraAccessIfNeeded())) {
|
||||||
|
|||||||
@@ -131,8 +131,10 @@ export function ComposerPrompt() {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
// Statement form rather than a ternary: React Compiler cannot lower a
|
/*
|
||||||
// conditional expression inside a `try`, and `imageUris` is built here.
|
* Statement form rather than a ternary: React Compiler cannot lower a
|
||||||
|
* conditional expression inside a `try`, and `imageUris` is built here.
|
||||||
|
*/
|
||||||
let nativeImageUris
|
let nativeImageUris
|
||||||
if (IS_NATIVE) {
|
if (IS_NATIVE) {
|
||||||
nativeImageUris = imageUris
|
nativeImageUris = imageUris
|
||||||
|
|||||||
@@ -79,9 +79,11 @@ export function UserBanner({
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (IS_NATIVE) {
|
if (IS_NATIVE) {
|
||||||
// Nested rather than `?.()`: React Compiler cannot lower an optional
|
/*
|
||||||
// call inside a `try`. Like `?.()`, this leaves the arguments
|
* Nested rather than `?.()`: React Compiler cannot lower an optional
|
||||||
// unevaluated when the callback is absent.
|
* call inside a `try`. Like `?.()`, this leaves the arguments
|
||||||
|
* unevaluated when the callback is absent.
|
||||||
|
*/
|
||||||
if (onSelectNewBanner) {
|
if (onSelectNewBanner) {
|
||||||
onSelectNewBanner(
|
onSelectNewBanner(
|
||||||
await compressIfNeeded(
|
await compressIfNeeded(
|
||||||
|
|||||||
Reference in New Issue
Block a user