s/preact/react/. Strip non-prod code from react-dates bundle. Import normally#12456
s/preact/react/. Strip non-prod code from react-dates bundle. Import normally#12456cvializ merged 3 commits intoampproject:masterfrom
Conversation
rsimha
left a comment
There was a problem hiding this comment.
package.json and yarn.lock changes LGTM!
| * @return {?Promise<!JsonObject|!Array<JsonObject>>} | ||
| */ | ||
| fetchSrcTemplates_() { | ||
| if (assertHttpsUrl(this.element.getAttribute('src'), this.element)) { |
There was a problem hiding this comment.
assertHttpsUrl is already called in fetchedBatchedJsonFor, so it was redundant here.
| * @param {?string} focusedInput | ||
| */ | ||
| onFocusChange(focusedInput) { | ||
| // TODO(cvializ): there is a bug in the react-dates library that |
There was a problem hiding this comment.
This bug only happened when using preact-compat with react-dates, so this workaround code isn't needed any more.
Surprising. I thought preact's value prop was significantly reduced size? |
|
No that is still true, but the way the PR decreases the size is using |
| @import '../../../node_modules/react-dates/lib/css/_datepicker.css'; | ||
|
|
||
| .DateInput_input { | ||
| font-size: 100%; |
There was a problem hiding this comment.
Prevents iOS from zooming in when tapping on the hidden input. The default was 11px. Anything less than 16px triggers auto-zooming on focus.
| @import '../../../node_modules/react-dates/lib/css/_datepicker.css'; | ||
|
|
||
| .DateInput_input { | ||
| font-size: 100%; |
521db22 to
b846749
Compare
…normally (ampproject#12456) * s/preact/react/. Strip non-prod code from react-dates bundle. Import normally * Fix deps * yarn.lock?
This decreases the amp-date-picker dist binary size and uses more normal import mechanisms.