-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
scripts(i18n): support es modules in collect-strings #12741
Conversation
@@ -119,15 +118,13 @@ function saveLhlStrings(path, localeStrings) { | |||
* @param {string} dir | |||
* @return {Array<string>} | |||
*/ | |||
function collectAndBakeCtcStrings(dir) { | |||
export function collectAndBakeCtcStrings(dir) { |
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.
small change here... relativePath
was not necessary.
|
There needs to be some delay between starting and finishing since converting
Are you referring to how we're going to replace Besides bundling, what else in on your mind?
Supporting ES modules is really just a two line change. Would a comment on the relevant lines suffice? Otherwise, I can remove from this PR (and use the created
done |
@@ -730,8 +743,7 @@ if (require.main === module) { | |||
console.log('✨ Complete!'); | |||
} | |||
|
|||
module.exports = { |
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.
we may need to make a style call on when to use inline export
vs export
blocks :)
It's not necessarily a breaking change (our primary interface is async already and conditional exports are a good match for us since we're not a utility you import lightly), but FWIW this is exactly the kind of discussion I meant we should have :) I don't foresee us having a hard time converting our code. We purposefully don't push the boundaries of commonjs invariants, and where we have we've gotten burned in the past, so we do things like deep cloning even where not necessary :) Like these It's the tooling that is going to take more creative changes, and the code being in a mixture of module/commonjs states means a mixture of tooling states which is not going to be easy to reason about and it could hinder other work going on. All the different pieces aren't necessarily hard problems, but we don't really have a plan for some of them yet. I'd much rather we got all our ducks in a row, had a planned series of changes, then just had "esm week" (or days!) and knocked it all out at once.
I mean, my preferred approach would be putting off the ES modules transition until it can be done at relatively the same time, so either switching to dynamic |
word... i keep forgetting you can |
@adamraine ready for review |
ref #12689
Confirmed working by merging with #12702.
I added a temporary file, just for review,
tmp-esm-strings.js
. That along with some tweaks to the script to ignore errors will be removed before merging, only exist to show the script works with ES modules now.