Skip to content

Extract react-i18n package#5496

Merged
aduth merged 5 commits intomainfrom
aduth-react-i18n
Oct 14, 2021
Merged

Extract react-i18n package#5496
aduth merged 5 commits intomainfrom
aduth-react-i18n

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Oct 13, 2021

Follows-up #5459

Why: To be able to support the use of React i18n functions outside the document-capture package (e.g. in the components package), and to better separate shared utilities and simplify the scope of the document-capture package.

It's planned to use this for LG-5213, where the BlockLink component will be moved to the components package, and requires translation.

**Why**: To be able to support the use of React i18n functions outside the document-capture package (e.g. in the components package), and to better separate shared utilities and simplify the scope of the document-capture package.
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

aduth added 2 commits October 13, 2021 16:54
**Why**: Avoid tedium of adding exceptions for all test strings
**why**: Some spec files may contain lingering references to unused or missing strings, which we'd want to be made aware of. The ones we don't care about are pretty isolated to these packages
tsconfig.json Outdated
"target": "ESNext"
},
"include": [
"spec/javascripts/spec_helper.d.ts",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally it'd be nice to limit this to be included only in the context of spec files, since it occurs to me that this would allow someone to add expect calls to application code without it being flagged.

We can do this with ESLint configuration to at least make expect be considered undefined by moving globals into the overrides section for spec files, which seems like a reasonable compromise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally it'd be nice to limit this to be included only in the context of spec files, since it occurs to me that this would allow someone to add expect calls to application code without it being flagged.

We can do this with ESLint configuration to at least make expect be considered undefined by moving globals into the overrides section for spec files, which seems like a reasonable compromise.

Updated in 51e6a7e.

aduth added 2 commits October 14, 2021 09:37
**Why**: So that a developer who tries to use expect in application code will encounter a failed build
@aduth aduth merged commit 2373d50 into main Oct 14, 2021
@aduth aduth deleted the aduth-react-i18n branch October 14, 2021 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants