The compiler records warnings that nothing in a real build reads
StylesheetBuilder.addWarning accumulates three channels — properties, values, functions — reachable through compile(css).warnings(). In src/compiler/declarations.ts there are 47 addWarning("value", …) call sites feeding the values channel, plus 3 addWarning("property", …).
None of them reach anybody running expo start.
$ grep -rn "\.warnings()" src --include=*.ts --include=*.tsx | grep -v __tests__
src/compiler/compiler.ts:202: warnings: () => builder.getWarnings(),
src/jest/index.ts:46: warnings: compiled.warnings(),
compiler.ts:202 is the definition. src/jest/index.ts:46 is the only consumer, and it is behind a flag:
const debugDefault = Boolean(
process.env.REACT_NATIVE_CSS_TEST_DEBUG &&
typeof process.env.NODE_OPTIONS === "string" &&
process.env.NODE_OPTIONS.includes("--inspect"),
);
src/metro/metro-transformer.ts — the path every real build takes — calls .stylesheet() and nothing else:
const productionJS = compile(css, {
...config.reactNativeCSS,
filename: filePath,
projectRoot: projectRoot,
}).stylesheet();
So the observable behaviour of an unsupported declaration is: nothing happens, silently. The compiler knew, wrote it down, and threw the note away.
Why it matters
The values channel is where "this value has no React Native equivalent" is recorded. That is exactly the class of problem a developer cannot diagnose from the outside — the class name is present, the rule compiled, and one declaration quietly did nothing. A build-time log line is the difference between a five-minute fix and an afternoon.
Reproduction
import { compile } from "react-native-css/compiler";
console.log(compile(`.a { float: left; }`).warnings());
// { properties: [ 'float' ] }
Run the same CSS through Metro and nothing is printed; the file transforms successfully.
Not a regression, and not new
This is how the channel has always worked — I am not reporting a break. I hit it while adding a warning for a new drop in #411 and found the new entries were as unreachable as the existing 47.
Possible shapes
metro-transformer.ts calls .warnings() after .stylesheet() and logs a summary through Metro's reporter.
- The same, off by default behind a
reactNativeCSS option, so an existing project does not suddenly gain a wall of output.
- Nothing, if the channel is meant only as a compiler API for tooling — in which case it is worth saying so, because the call sites read as user-facing diagnostics.
Happy to do (1) or (2) if you have a preference. I did not fold it into #411 because it is orthogonal to that fix and predates it.
The compiler records warnings that nothing in a real build reads
StylesheetBuilder.addWarningaccumulates three channels —properties,values,functions— reachable throughcompile(css).warnings(). Insrc/compiler/declarations.tsthere are 47addWarning("value", …)call sites feeding thevalueschannel, plus 3addWarning("property", …).None of them reach anybody running
expo start.compiler.ts:202is the definition.src/jest/index.ts:46is the only consumer, and it is behind a flag:src/metro/metro-transformer.ts— the path every real build takes — calls.stylesheet()and nothing else:So the observable behaviour of an unsupported declaration is: nothing happens, silently. The compiler knew, wrote it down, and threw the note away.
Why it matters
The
valueschannel is where "this value has no React Native equivalent" is recorded. That is exactly the class of problem a developer cannot diagnose from the outside — the class name is present, the rule compiled, and one declaration quietly did nothing. A build-time log line is the difference between a five-minute fix and an afternoon.Reproduction
Run the same CSS through Metro and nothing is printed; the file transforms successfully.
Not a regression, and not new
This is how the channel has always worked — I am not reporting a break. I hit it while adding a warning for a new drop in #411 and found the new entries were as unreachable as the existing 47.
Possible shapes
metro-transformer.tscalls.warnings()after.stylesheet()and logs a summary through Metro's reporter.reactNativeCSSoption, so an existing project does not suddenly gain a wall of output.Happy to do (1) or (2) if you have a preference. I did not fold it into #411 because it is orthogonal to that fix and predates it.