dayjs icon indicating copy to clipboard operation
dayjs copied to clipboard

#1118 - Partial Locale update added

Open VigneshMurugan opened this issue 5 years ago • 11 comments

In case of Object we would be using Object.assign to enable partial update of the locale property. fixes #1118

VigneshMurugan avatar Oct 11 '20 11:10 VigneshMurugan

Codecov Report

Merging #1122 (ea62024) into dev (e2feb6b) will decrease coverage by 0.05%. The diff coverage is 90.90%.

Impacted file tree graph

@@             Coverage Diff             @@
##               dev    #1122      +/-   ##
===========================================
- Coverage   100.00%   99.94%   -0.06%     
===========================================
  Files          177      178       +1     
  Lines         1989     1999      +10     
  Branches       505      507       +2     
===========================================
+ Hits          1989     1998       +9     
- Misses           0        1       +1     
Impacted Files Coverage Δ
src/plugin/updateLocale/utils.js 90.00% <90.00%> (ø)
src/plugin/updateLocale/index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e2feb6b...ea62024. Read the comment docs.

codecov[bot] avatar Oct 11 '20 11:10 codecov[bot]

Thanks. It will be better not using Object.assign, cause babel will bundle a huge polyfill to make it work on old browsers.

iamkun avatar Oct 13 '20 03:10 iamkun

does spread add something in babel? eg.

{...localeConfig[c], ...customConfig[c]}

or do we need a helper function like:

function m(o1,o2){
    var o = {};
    for (var attrname in o1) { o[attrname] = o1[attrname]; }
    for (var attrname in o2) { o[attrname] = o2[attrname]; }
    return o;
}

or do we need those as recursive functions?

xvaara avatar Oct 25 '20 20:10 xvaara

It's not about the syntax itself, but the whole bundle size while compiling it to es5.

iamkun avatar Oct 26 '20 02:10 iamkun

@iamkun looking for review. I have replaced Object.assign with custom extend method

VigneshMurugan avatar Jan 31 '21 08:01 VigneshMurugan

Thanks, would you please move the utils function to the plugin file?

iamkun avatar Jan 31 '21 09:01 iamkun

Thanks, would you please move the utils function to the plugin file?

Done @iamkun

VigneshMurugan avatar Jan 31 '21 10:01 VigneshMurugan

sorry that I didn't make it clear, what I mean is to move the extend function to src/plugin/updateLocale/index.js or maybe src/plugin/updateLocale/utils.js

iamkun avatar Jan 31 '21 10:01 iamkun

sorry that I didn't make it clear, what I mean is to move the extend function to src/plugin/updateLocale/index.js or maybe src/plugin/updateLocale/utils.js

Done @iamkun

VigneshMurugan avatar Jan 31 '21 10:01 VigneshMurugan

LGTM, would you like to add some unit tests for this feature?

iamkun avatar Jan 31 '21 11:01 iamkun

@iamkun Not sure why this got away in my checklist. I have updated the unit test cases now.

VigneshMurugan avatar Aug 10 '21 09:08 VigneshMurugan