formatjs / formatjs-old

The monorepo home to all of the FormatJS related libraries.
https://formatjs.io/
156 stars 53 forks source link

fix(babel-plugin-react-intl): ignore default message #536

Closed Ne3l closed 4 years ago

Ne3l commented 4 years ago

In the 5.0.0 release it was removed the option enforceDefaultMessage https://github.com/formatjs/formatjs/compare/babel-plugin-react-intl@4.3.0...babel-plugin-react-intl@5.0.0#diff-42d4e378cdd21405ca2ec126383c504bR432. With the current state the components like <FormattedMessage id="global.error" /> doesn't get extracted.

longlho commented 4 years ago

hmm looks like u need to change && to || here: https://github.com/formatjs/formatjs/blob/master/packages/babel-plugin-react-intl/src/index.ts#L430

Ne3l commented 4 years ago

A message without an ID is expected? i tought it was required https://github.com/formatjs/react-intl/blob/master/docs/Components.md#message-descriptor

longlho commented 4 years ago

It’s required at runtime but not build time

On Thu, Mar 5, 2020 at 5:40 AM Nacho López Sánchez notifications@github.com wrote:

A message without an ID is expected? i tought it was required https://github.com/formatjs/react-intl/blob/master/docs/Components.md#message-descriptor

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/formatjs/formatjs/pull/536?email_source=notifications&email_token=AABQM32H2ORCM5GSNVWEYN3RF56RNA5CNFSM4K4233D2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN4WRDA#issuecomment-595159180, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABQM34EV4QBFLSZ4BDEVKLRF56RNANCNFSM4K4233DQ .

donovanhiland commented 4 years ago

Anything I can do to help move this along?

longlho commented 4 years ago

https://github.com/formatjs/formatjs/pull/536#issuecomment-595016892 is what I think the fix is