-
Notifications
You must be signed in to change notification settings - Fork 47k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update on "[compiler] Todo for fbt with multiple pronoun/plural"
--- (pasted from fixture comment) The root issue here is that fbt:plural/enum/pronoun read `.start` and `.end` from babel nodes to slice into source strings for some complex dedupe logic (see [_getStringVariationCombinations](https://github.com/facebook/fbt/blob/main/packages/babel-plugin-fbt/src/JSFbtBuilder.js#L297)) Since Forget does not add `.start` and `.end` for babel nodes it synthesizes, [getRawSource](https://github.com/facebook/fbt/blob/main/packages/babel-plugin-fbt/src/FbtUtil.js#L666-L673) simply returns the whole source code string. As a result, all fbt nodes dedupe together and _getStringVariationCombinations ends up early exiting (before adding valid candidate values). For fbt:plural tags specifically, the `count` node require that a `.start/.end` be attached (see [code in FbtPluralNode](https://github.com/facebook/fbt/blob/main/packages/babel-plugin-fbt/src/fbt-nodes/FbtPluralNode.js#L87-L90)). --- For now, let's just bail out :-) [ghstack-poisoned]
- Loading branch information
Showing
32 changed files
with
959 additions
and
569 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.