-
Notifications
You must be signed in to change notification settings - Fork 178
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kayhadrin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
FYI: this PR has been reverted in c4468bd |
@kayhadrin Without this fix I got the following error : Error trace
I'm using Next.Js with Typescript, if needed I can provide an example repository. |
When are you meeting this issue? I think this can be fixed by amending some configuration:
|
Option But now I'm getting the same error as #72 (comment) or #115 (comment) or #49 (comment) Do you know how to fix it ?
|
Glad it worked for you. Regarding that new error I'd suggest following up on #115 and adding a minimum repro repo for this. |
I am still having this issue when using FbtParam: Invalid option "__self". Only allowed: number, gender, name. |
@yrichard Did you ever find a more long-term solution to this? I've encountered the exact same issues with @jrwats Any chance this might be reopened and merged again soon? It wasn't clear why it had been reverted |
Hola, I'd like to bring this issue up again because the param usage still seems to be broken: <fbt desc="summary of selected items in POS">
Selected <fbt:param name="totalSelectedItems">{stats.totalSelectedItems}</fbt:param> items
for <fbt:param name="totalPrice">{stats.totalPrice}</fbt:param>
</fbt> Throws the following error:
Here is my Babel config: module.exports = {
presets: ['…'],
plugins: [
[
'babel-plugin-fbt',
{
extraOptions: {
__self: true,
__source: true,
},
},
],
'babel-plugin-fbt-runtime',
],
}; The most common {fbt(
`Selected ${fbt.param(
'totalSelectedItems',
stats.totalSelectedItems,
)} items for ${fbt.param('totalPrice', stats.totalPrice)}`,
'summary of selected items in POS',
)} But obviously, that's not ideal. Would you accept this PR again @jrwats? Or what was the issue with it? |
Created an issue for this #197 |
Summary
Recently, a bugfix went out for
babel-plugin-transform-react-jsx-self
that moves adding the__self
JSX attribute before the arrow function transform. This has the side effect of adding the__self
attribute before the fbt transform as well. This PR marks__self
as a passed through but purposefully ignored attribute so that this change does not cause fbt to throw because of an unknown attributeTest plan
I wrote a test to verify that the attribute is ignored. I also manually changed the code in the WWW repo and verified running the
self
transform in conjunction with this transform no longer throws an error.