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

SceneryStack needs actual locale list for Locale type #1003

Open
jonathanolson opened this issue Dec 23, 2024 · 6 comments
Open

SceneryStack needs actual locale list for Locale type #1003

jonathanolson opened this issue Dec 23, 2024 · 6 comments

Comments

@jonathanolson
Copy link
Contributor

Otherwise manually specifying translation string keys for anything not in the "small example" list results in a type error.

@jonathanolson
Copy link
Contributor Author

@zepumph we should discuss this at some point, and decide how to clean up docs, or whether this is a mistake. Type checking is passing.

@zepumph
Copy link
Member

zepumph commented Jan 8, 2025

This makes me a bit worried. I remember that the "actual" solution was to use a calculated artifact directly from the babel list (ground truth), but we got rid of that because we didn't want to have the addition of a new babel locale without regeneration to break the type checker. Can you post a usage here? And note how you think this may influence maintenance if we just imported the babel json directly? Can't we import json in Typescript?

@jonathanolson
Copy link
Contributor Author

Image

Hmm, getting the typing DOES sound nice. SceneryStack is turning localeData into its own module. However our codebase I don't think supports importing json directly at the moment (we... used to do that with package.json, but I don't see it now?)

As a SECOND factor, for file-size we don't want to always import the FULL file (we'd need to keep it as a "import type" so it doesn't use a runtime dependency).

Thoughts?

@zepumph
Copy link
Member

zepumph commented Jan 16, 2025

What about a generated d.ts from localeData file for localeType that lives in babel?

@zepumph zepumph assigned jonathanolson and unassigned zepumph Jan 16, 2025
@jonathanolson
Copy link
Contributor Author

That works (it wouldn't auto-update, but it would be right next to the file we are updating, presumably that would be easier?)

Although then we would have sims depending on TS code in babel, which is a bit unprecedented. Imagine... linting issues across versions. I'm actually not convinced that is better (has more potential issues in the future).

@zepumph
Copy link
Member

zepumph commented Jan 16, 2025

Let's just have it be an output to updateLocaleInfo, live in that chipper directory, and have it run every night with daily grunt work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants