ampproject / ampproject/amphtml

I2D: mode.isLocalDev

Open
#35,674 14 comments 2 reactions 1 assignee Claimed by @rcebulko View on GitHub
Stale
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

The code looks like this:
```javascript
export function isLocalDev(opt_win) {
if (isProd()) {
return false;
}

return !!self.AMP_CONFIG?.localDev || isTest(opt_win);
}
```

It's basically always used like `mode.isLocalDev(win) || mode.isTest(win)`
I can't think of any environment where `isProd()` is false that `isLocalDev` should also be false. This is causing challenges with testing/running Bento components, since `AMP_CONFIG` isn't available.

Can we drop this entirely and replace all calls with `!mode.isProd()`?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.