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

core(build): add inline-fs bundling plugins #13275

Merged
merged 5 commits into from
Oct 28, 2021
Merged

Conversation

brendankenny
Copy link
Member

part of #13231

adds browserify and rollup plugins for inline-fs and uses them in our build pipelines.

I'll follow up with LH_ROOT and verify inlining modules and into modules works with to get rid of some our current workarounds (at least here and here)

@brendankenny brendankenny requested a review from a team as a code owner October 28, 2021 16:54
@brendankenny brendankenny requested review from connorjclark and removed request for a team October 28, 2021 16:54
@google-cla google-cla bot added the cla: yes label Oct 28, 2021
@brendankenny
Copy link
Member Author

🎆 🎆 thank you for your tireless efforts, @wardpeet/brfs 🎆 🎆

(cc the real @wardpeet :)

Comment on lines -24 to -26
let CANONICAL_LOCALES = ['__availableLocales__'];
// TODO: need brfs in gh-pages-app. For now, above is replaced, see build-i18n.module.js
if (fs.readdirSync) {
Copy link
Member Author

@brendankenny brendankenny Oct 28, 2021

Choose a reason for hiding this comment

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

This was the cause of the failing devtolls integration test.

I didn't look too far into why this was falsy with inline-fs (but not brfs) and so CANONICAL_LOCALES was kept as ['__availableLocales__'] in the devtools bundle, because it was easier just to remove the workaround since it's not needed anymore :)

Manually verified that swap locale in viewer is still working and DevTools can still switch LH locales

parserOpts: {ecmaVersion: 12},
})
// Transform `fs.readFileSync`, etc into inline strings.
.transform(inlineFs({verbose: false}))
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we set it to Boolean(process.env.DEBUG) ?

Copy link
Member Author

@brendankenny brendankenny Oct 28, 2021

Choose a reason for hiding this comment

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

sure

(for the record I don't endorse process.env.DEBUG debugging, but it's just as good as false for documenting the option is there if you run into a problem and need to see what's going on, and it may help anyone who does randomly append DEBUG=1 to their commands to see if anything useful might happen :)

edit: it's also slightly different, maybe you just want some logging but process.env.DEBUG is also going to turn off minification or whatever, but again, it's easy to see you can put in another boolean there

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

Successfully merging this pull request may close these issues.

3 participants