You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 5 seems to indicate a group of people who may be of mixed gender
MIXED_SINGULAR: 5,
MIXED_PLURAL: 5,
NEUTER_SINGULAR: 6,
UNKNOWN_SINGULAR: 7,
FEMALE_PLURAL: 8,
MALE_PLURAL: 9,
NEUTER_PLURAL: 10,
UNKNOWN_PLURAL: 11,
};
Motivation
Going forward, it'd make sense to avoid having to write duplicate JS constants.
Some JS functions might even be shared in the future.
How to do it?
We should figure out a way to share some common constants between the node.js and client-side modules.
Maybe by having the fbt npm module become a peerDependency of babel-plugin-fbt?
Or by defining the shared JS code into a special folder that'd be accessible to both babel-plugin-fbt and fbt in Flow checks, and also bundled in these respective npm modules using some Gulp magic?
The text was updated successfully, but these errors were encountered:
馃殌 Feature Proposal
Currently, we have some JS constants that are defined twice on the clientside and Babel transform modules.
E.g. The Gender constant object that defines all the supported types of genders is defined in two places that need to be kept up to date manually.
fbt/runtime/nonfb/GenderConst.js
Lines 16 to 32 in a61a13b
fbt/packages/babel-plugin-fbt/Gender.js
Lines 12 to 29 in a61a13b
Motivation
Going forward, it'd make sense to avoid having to write duplicate JS constants.
Some JS functions might even be shared in the future.
How to do it?
We should figure out a way to share some common constants between the node.js and client-side modules.
Maybe by having the
fbt
npm module become a peerDependency ofbabel-plugin-fbt
?Or by defining the shared JS code into a special folder that'd be accessible to both
babel-plugin-fbt
andfbt
in Flow checks, and also bundled in these respective npm modules using some Gulp magic?The text was updated successfully, but these errors were encountered: