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

refactor(core): migrate momentjs functionality to luxon + date-fns #6604

Merged
merged 2 commits into from
Feb 25, 2019
Merged

refactor(core): migrate momentjs functionality to luxon + date-fns #6604

merged 2 commits into from
Feb 25, 2019

Conversation

anotherchrisberry
Copy link
Contributor

momentjs is being replaced by luxon, so we might as well start moving that way. We'll get some smaller bundles (I think moment + timezones is ~220kb minified; date-fns + luxon is ~60kb minified).

Unfortunately, luxon does not support the humanize function, so we need to pull in something for that; date-fns is pretty close to what moment does. It would be nice to just use date-fns; unfortunately, it does not support timezones, so we've got both here. It looks like date-fns is working on timezone support, so that might change. At least date-fns publishes functions on their own, so we're only bringing in what we need?

Worth considering

  • We're not getting rid of momentjs any time soon. It's a transitive dependency of chart.js (used by kayenta), and we have numerous dependencies in our internal build at Netflix (astrid, tvui-dashboard, react-date-range). So, really, we're just adding to our bundle for now.
  • The humanized text is slightly different in places, so if someone is depending on this for functional testing or screen scraping (I hope nobody is screen scraping duration text), they might have problems (beyond the fact that they're scraping that text for something)

Copy link
Member

@erikmunson erikmunson left a comment

Choose a reason for hiding this comment

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

🕙 🕥 lit 🕚 🕦

@@ -11,25 +11,44 @@ import { FilterModelService, ISortFilter } from 'core/filterModel';
import { Registry } from 'core/registry';

const boundaries = [
{ name: 'Today', after: () => moment().startOf('day') },
Copy link
Member

Choose a reason for hiding this comment

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

is Today intentionally omitted here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know what you're talking about.

Copy link
Member

Choose a reason for hiding this comment

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

nothing

@christopherthielen
Copy link
Contributor

nice, am happy about this. Were you able to do any find/replace or did you have to manually update everything?

@anotherchrisberry
Copy link
Contributor Author

@christopherthielen I was able to do some find, but not replace

luxon objects are immutable, so they are a little different to work with. It really wasn't bad.

@anotherchrisberry anotherchrisberry merged commit 3e75815 into spinnaker:master Feb 25, 2019
@anotherchrisberry anotherchrisberry deleted the luxon-date-fns branch February 25, 2019 22:45
erikmunson added a commit to erikmunson/deck that referenced this pull request Feb 25, 2019
3e75815 refactor(core): migrate momentjs functionality to luxon + date-fns (spinnaker#6604)
754c540 Merge branch 'master' into lb-is-loading
70fb404 fix(core/executions): Disable text selection when re-ordering pipelines (spinnaker#6603)
a35b4cb Merge branch 'master' into lb-is-loading
1d320d6 Merge branch 'master' into lb-is-loading
c026514 Merge branch 'master' into lb-is-loading
cf528dc fix(core): loading spinner for LBs not dismissed
erikmunson added a commit that referenced this pull request Feb 25, 2019
#6615)

* chore(core): Bump version to 0.0.339

3e75815 refactor(core): migrate momentjs functionality to luxon + date-fns (#6604)
754c540 Merge branch 'master' into lb-is-loading
70fb404 fix(core/executions): Disable text selection when re-ordering pipelines (#6603)
a35b4cb Merge branch 'master' into lb-is-loading
1d320d6 Merge branch 'master' into lb-is-loading
c026514 Merge branch 'master' into lb-is-loading
cf528dc fix(core): loading spinner for LBs not dismissed

* chore(amazon): Bump version to 0.0.177

510557f fix(amazon/serverGroup): Do not apply default AZs unless the user wants to usePreferredZones (#6609)

* chore(titus): Bump version to 0.0.77

5e77299 fix(titus): Help users with iam profile setting (#6552)
maggieneterval added a commit to maggieneterval/deck that referenced this pull request May 10, 2019
1ada021 feat(kubernetes): expose rendered helm template in execution details (spinnaker#6943)
d122749 feat(runJob/kubernetes): render external link (spinnaker#6930)
9e03e52 refactor(runJob/kubernetes): refactor exec details (spinnaker#6924)
98ca0ff refactor(runJob/kubernetes): use joblogviewer (spinnaker#6917)
6c5eed6 feat(provider/kubernetes): run job manifest artifacts (spinnaker#6902)
cd8780c fix(kubernetes): fix discrepancy between orca deploy stage model and artifacts rewrite stage model
d44be0c fix(kubernetes): hide manifest artifact selector in text mode
bd94593 feat(kubernetes): remove rollout strategies feature flag
0ec6a7e feat(kubernetes): validate text manifests when rollout strategies enabled
37e24d7 fix(kubernetes): safer lookups for deploy stage validators (spinnaker#6847)
478e326 feat(kubernetes): add rollout strategies to deploy manifest stage (spinnaker#6841)
e618548 feat(preconfiguredJob): logs for k8s jobs (spinnaker#6840)
c30058a feat(k8s): Exclude inline base 64 artifact editing in k8s manifest (spinnaker#6839)
5640431 fix(k8s): Fix deploy manifest (spinnaker#6833)
ee89a64 feat(kuberntes): v2 runJob (spinnaker#6831)
2d7f388 feat(kubernetes): feature-flagged support for kubernetes traffic management strategies (spinnaker#6816)
33ad914 chore(kubernetes): refactor BasicSettings component to be usable in stages (spinnaker#6820)
72e164d refactor(core): de-angularize ApplicationModelBuilder, fix project executions (spinnaker#6802)
d7f6fbd fix(kubernetes): show Deployment clusters in Find Artifacts from Resource stages (spinnaker#6794)
20d0d7a fix(kubernetes): safe lookups for apiVersion on patch manifest deploy status (spinnaker#6775)
bf13a3c fix(kubernetes): fix validation for Find Artifact from Resource stage (spinnaker#6777)
50b74f2 feat(gcb): add Google Cloud Build stage (spinnaker#6774)
5b03078 fix(kubernetes): fix copy manifest from infrastructure button (spinnaker#6719)
57c30b5 fix(kubernetes): Use apiGroup when looking up deploy status for CRDs (spinnaker#6691)
a5a54bd feat(kubernetes): add expression evaluation options to bake and deploy manifest stages (spinnaker#6696)
51eeba4 chore(core): upgrade the version to formik 1.4.1 (spinnaker#6705)
e2b4d8e refactor(*): remove unused local storage caches (spinnaker#6665)
5da2965 refactor(artifacts): Combine expected artifacts and trigger artifact constraints (spinnaker#6634)
0d37cb2 fix(kubernetes): only set manifestName in static mode manifest selector
79a0700 feat(kubernetes): add dynamic target selection to patch manifest stage
0abce66 fix(kubernetes): remove unnecessary delete manifest stage defaults
5bf6045 fix(kubernetes): allow text input for replicas in `Scale (Manifest)` stage (spinnaker#6630)
cbfcae4 feat(kubernetes): add label mode to manifest selector component to enable dynamic target selection in delete manifest stage (spinnaker#6628)
d828a53 chore(angularjs): Explicitly annotate directive controllers
3e75815 refactor(core): migrate momentjs functionality to luxon + date-fns (spinnaker#6604)
7d5fc34 chore(prettier): Just Use Prettier™ (spinnaker#6600)
04bb4a0 fix(html): Fix various invalid HTML (spinnaker#6599)
5cf6c79 chore(prettier): Just Use Prettier™
3ffa4fb chore(angularjs): Do not use .component('foo', new Foo())
4b91b36 refactor(core): move Ace Editor CSS to core module (spinnaker#6588)
cc52bee chore(angularjs): Remove all 'ngInject'; in favor of explicit DI annotation
b6bab1e chore(prettier): Just Use Prettier™
f3fd790 chore(angularjs): Explicitly annotate all AngularJS injection points
629613f fix(kubernetes): properly detect if autoscaler is attached to server groups (spinnaker#6578)
d72bc17 fix(eslint): Fix eslint warnings for @typescript-eslint/camelcase
maggieneterval added a commit that referenced this pull request May 10, 2019
1ada021 feat(kubernetes): expose rendered helm template in execution details (#6943)
d122749 feat(runJob/kubernetes): render external link (#6930)
9e03e52 refactor(runJob/kubernetes): refactor exec details (#6924)
98ca0ff refactor(runJob/kubernetes): use joblogviewer (#6917)
6c5eed6 feat(provider/kubernetes): run job manifest artifacts (#6902)
cd8780c fix(kubernetes): fix discrepancy between orca deploy stage model and artifacts rewrite stage model
d44be0c fix(kubernetes): hide manifest artifact selector in text mode
bd94593 feat(kubernetes): remove rollout strategies feature flag
0ec6a7e feat(kubernetes): validate text manifests when rollout strategies enabled
37e24d7 fix(kubernetes): safer lookups for deploy stage validators (#6847)
478e326 feat(kubernetes): add rollout strategies to deploy manifest stage (#6841)
e618548 feat(preconfiguredJob): logs for k8s jobs (#6840)
c30058a feat(k8s): Exclude inline base 64 artifact editing in k8s manifest (#6839)
5640431 fix(k8s): Fix deploy manifest (#6833)
ee89a64 feat(kuberntes): v2 runJob (#6831)
2d7f388 feat(kubernetes): feature-flagged support for kubernetes traffic management strategies (#6816)
33ad914 chore(kubernetes): refactor BasicSettings component to be usable in stages (#6820)
72e164d refactor(core): de-angularize ApplicationModelBuilder, fix project executions (#6802)
d7f6fbd fix(kubernetes): show Deployment clusters in Find Artifacts from Resource stages (#6794)
20d0d7a fix(kubernetes): safe lookups for apiVersion on patch manifest deploy status (#6775)
bf13a3c fix(kubernetes): fix validation for Find Artifact from Resource stage (#6777)
50b74f2 feat(gcb): add Google Cloud Build stage (#6774)
5b03078 fix(kubernetes): fix copy manifest from infrastructure button (#6719)
57c30b5 fix(kubernetes): Use apiGroup when looking up deploy status for CRDs (#6691)
a5a54bd feat(kubernetes): add expression evaluation options to bake and deploy manifest stages (#6696)
51eeba4 chore(core): upgrade the version to formik 1.4.1 (#6705)
e2b4d8e refactor(*): remove unused local storage caches (#6665)
5da2965 refactor(artifacts): Combine expected artifacts and trigger artifact constraints (#6634)
0d37cb2 fix(kubernetes): only set manifestName in static mode manifest selector
79a0700 feat(kubernetes): add dynamic target selection to patch manifest stage
0abce66 fix(kubernetes): remove unnecessary delete manifest stage defaults
5bf6045 fix(kubernetes): allow text input for replicas in `Scale (Manifest)` stage (#6630)
cbfcae4 feat(kubernetes): add label mode to manifest selector component to enable dynamic target selection in delete manifest stage (#6628)
d828a53 chore(angularjs): Explicitly annotate directive controllers
3e75815 refactor(core): migrate momentjs functionality to luxon + date-fns (#6604)
7d5fc34 chore(prettier): Just Use Prettier™ (#6600)
04bb4a0 fix(html): Fix various invalid HTML (#6599)
5cf6c79 chore(prettier): Just Use Prettier™
3ffa4fb chore(angularjs): Do not use .component('foo', new Foo())
4b91b36 refactor(core): move Ace Editor CSS to core module (#6588)
cc52bee chore(angularjs): Remove all 'ngInject'; in favor of explicit DI annotation
b6bab1e chore(prettier): Just Use Prettier™
f3fd790 chore(angularjs): Explicitly annotate all AngularJS injection points
629613f fix(kubernetes): properly detect if autoscaler is attached to server groups (#6578)
d72bc17 fix(eslint): Fix eslint warnings for @typescript-eslint/camelcase
christopherthielen added a commit to christopherthielen/deck that referenced this pull request Jun 5, 2019
243f530 feat(provdier/google): Display serviceAccount properties for firewall rules (spinnaker#6929)
0a5fd58 refactor(*): remove cache-clearing calls that do not do anything (spinnaker#6861)
297cd99 feat(provider/google): Support Shielded VM policies (spinnaker#6849)
728ddbe fix(google): revert "select all zones by default when deploying a regional gce server group (spinnaker#6751)" (spinnaker#6808)
bdcbc97 fix(google): GCE create server group and load balancer fixes (spinnaker#6806)
72e164d refactor(core): de-angularize ApplicationModelBuilder, fix project executions (spinnaker#6802)
0daec5b fix(google): fix autohealing health checks in deploy stages (spinnaker#6804)
ad2e222 fix(google): select all zones by default when deploying a regional gce server group (spinnaker#6751)
432e6e3 fix(google): add better help text around accelerators (spinnaker#6750)
eb7f661 feat(provider/gce): Moniker support for GCE server groups (spinnaker#6317)
e2b4d8e refactor(*): remove unused local storage caches (spinnaker#6665)
f0f4c0d fix(google): Only show authorized accounts during Server group creation (spinnaker#6625)
d828a53 chore(angularjs): Explicitly annotate directive controllers
3e75815 refactor(core): migrate momentjs functionality to luxon + date-fns (spinnaker#6604)
7d5fc34 chore(prettier): Just Use Prettier™ (spinnaker#6600)
04bb4a0 fix(html): Fix various invalid HTML (spinnaker#6599)
64fb489 fix(html): Fix various invalid HTML (spinnaker#6597)
5cf6c79 chore(prettier): Just Use Prettier™
3ffa4fb chore(angularjs): Do not use .component('foo', new Foo())
cc52bee chore(angularjs): Remove all 'ngInject'; in favor of explicit DI annotation
b6bab1e chore(prettier): Just Use Prettier™
f3fd790 chore(angularjs): Explicitly annotate all AngularJS injection points
78d0b68 fix(securityGroups): User `securityGroupName` for upsertSecurityGroupTask (spinnaker#6569)
ddbe208 fix(eslint): Fix eslint warnings for no-useless-escape
8cba7ac fix(eslint): Fix eslint warnings for no-case-declarations
christopherthielen added a commit that referenced this pull request Jun 5, 2019
243f530 feat(provdier/google): Display serviceAccount properties for firewall rules (#6929)
0a5fd58 refactor(*): remove cache-clearing calls that do not do anything (#6861)
297cd99 feat(provider/google): Support Shielded VM policies (#6849)
728ddbe fix(google): revert "select all zones by default when deploying a regional gce server group (#6751)" (#6808)
bdcbc97 fix(google): GCE create server group and load balancer fixes (#6806)
72e164d refactor(core): de-angularize ApplicationModelBuilder, fix project executions (#6802)
0daec5b fix(google): fix autohealing health checks in deploy stages (#6804)
ad2e222 fix(google): select all zones by default when deploying a regional gce server group (#6751)
432e6e3 fix(google): add better help text around accelerators (#6750)
eb7f661 feat(provider/gce): Moniker support for GCE server groups (#6317)
e2b4d8e refactor(*): remove unused local storage caches (#6665)
f0f4c0d fix(google): Only show authorized accounts during Server group creation (#6625)
d828a53 chore(angularjs): Explicitly annotate directive controllers
3e75815 refactor(core): migrate momentjs functionality to luxon + date-fns (#6604)
7d5fc34 chore(prettier): Just Use Prettier™ (#6600)
04bb4a0 fix(html): Fix various invalid HTML (#6599)
64fb489 fix(html): Fix various invalid HTML (#6597)
5cf6c79 chore(prettier): Just Use Prettier™
3ffa4fb chore(angularjs): Do not use .component('foo', new Foo())
cc52bee chore(angularjs): Remove all 'ngInject'; in favor of explicit DI annotation
b6bab1e chore(prettier): Just Use Prettier™
f3fd790 chore(angularjs): Explicitly annotate all AngularJS injection points
78d0b68 fix(securityGroups): User `securityGroupName` for upsertSecurityGroupTask (#6569)
ddbe208 fix(eslint): Fix eslint warnings for no-useless-escape
8cba7ac fix(eslint): Fix eslint warnings for no-case-declarations
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.

5 participants