Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use React.StrictMode and type-safe translation keys with i18next #708

Merged
merged 3 commits into from
Mar 8, 2023

Conversation

LukasKalbertodt
Copy link
Member

See commits.

@LukasKalbertodt LukasKalbertodt added the changelog:dev Changes primarily for developers label Feb 15, 2023
@LukasKalbertodt LukasKalbertodt marked this pull request as ready for review February 15, 2023 16:16
@LukasKalbertodt
Copy link
Member Author

TS2589: Type instantiation is excessively deep and possibly infinite.

Uh oh. I had that locally once but it disappeared. Mhpf, that would be a problem. Will look into it!

@github-actions github-actions bot added the status:conflicts This PR has conflicts that need to be resolved label Mar 6, 2023
@github-actions

This comment was marked as resolved.

Strict mode helps finding bugs early by doing a number of things during
development only (e.g. rendering each component twice). It required two
adjustments:

- The router would incorrectly dispose the initial route under strict 
  mode. A rather simple fix was used to make it work. It's still not 
  perfect, but at least it works.
- We now pass a ref directly to `Transition` to avoid it using 
  `findDOMNode` (deprecated) internally.
@github-actions github-actions bot removed the status:conflicts This PR has conflicts that need to be resolved label Mar 6, 2023
This unfortunately required quite a few other changes.
- ESlint needed to be configured to parse it as TS. This also meant that
  tsconfig needed to include the new TS file, otherwise eslint would
  error.
- Dealing with `constants.js` was very annoying as it's used by webpack
  and relay configs. Relay can't be typescript AFAIK. I couldn't figure
  out how to properly import it in both files so I decided to delete it
  and inline those constants. It's reaaaaally not a big deal. The only
  thing that is repeated is `src`. We won't ever change that folder.
- To even load a Typescript webpack config, `ts-node` needs to be
  installed.
Wrong translation keys will now cause a TS error. And most IDEs will
be able to suggest keys when typing.

As TS cannot load YAML directly, it needs a bit more setup code. And it
required a few adjustments in the code.
@github-actions github-actions bot temporarily deployed to test-deployment-pr708 March 6, 2023 18:16 Destroyed
Copy link
Member

@owi92 owi92 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@owi92 owi92 merged commit 218c80d into elan-ev:master Mar 8, 2023
@LukasKalbertodt LukasKalbertodt deleted the more-frontend-checking branch March 8, 2023 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:dev Changes primarily for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants