dillon1000/react
Commit
Browse files JSXNamespacedName support
This is kind of a hack, but i think it's worth it given that JSXNamespacedName
is relatively uncommon. Adding a new InstructionValue variant to represent a
namespaced name is one option, but then that isn't a valid expression and can't
appear as an operand anywhere else. Instead, we lower namespaced names as a
primitive (string) as `${namespace}:${name}` — exploiting the fact the namespace
and name can't have a colon, and non-namespaced tagnames also can't have colons.
It's a bit of a hack but it's contained to the JSX processing code. If folks
have strong opinions on this i'm happy to change but this felt reasonable as a
quick and reliable way to unblock support.
NOTE: there is a larger question of what to do about compiling `fbt` tags.
Before we can do anything with them, though, we need to parse them.Changed paths6 files
First-parent comparisoncompiler/forget/src/HIR/BuildHIR.ts ModifiedM compiler/forget/src/ReactiveScopes/CodegenReactiveFunction.ts ModifiedM compiler/forget/src/__tests__/fixtures/compiler/error.todo-kitchensink.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/compiler/error.todo-kitchensink.js ModifiedA compiler/forget/src/__tests__/fixtures/compiler/jsx-namespaced-name.expect.md AddedA compiler/forget/src/__tests__/fixtures/compiler/jsx-namespaced-name.js AddedPatch
Files changed
Rendering syntax-highlighted changes…