[
https://issues.apache.org/jira/browse/METRON-1796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16643242#comment-16643242
]
ASF GitHub Bot commented on METRON-1796:
----------------------------------------
Github user ruffle1986 commented on a diff in the pull request:
https://github.com/apache/metron/pull/1219#discussion_r223676139
--- Diff: metron-interface/metron-alerts/package.json ---
@@ -22,17 +22,17 @@
"@angular/platform-browser": "^6.1.6",
"@angular/platform-browser-dynamic": "^6.1.6",
"@angular/router": "^6.1.6",
+ "@ruffle1986/pikaday-time": "^1.6.1",
"@types/bootstrap": "^4.1.1",
"@types/jquery": "^3.3.4",
"ace-builds": "^1.2.6",
"ajv": "^6.5.1",
"angular-confirmation-popover": "^4.2.0",
"bootstrap": "4.0.0-alpha.6",
"core-js": "^2.4.1",
+ "date-fns": "^1.29.0",
"font-awesome": "^4.7.0",
- "moment": "^2.22.2",
"ng2-dragula": "^1.5.0",
- "pikaday-time": "^1.6.1",
--- End diff --
> A, simply remove the time picker component
If it's not important to let the user choose a time beside the date, then
yes, we can get rid of `pikaday-time` and just use `pikaday`. Unfortunately
there's a **but** here. :(
In order to eliminate moment, we still have to fork pikaday. Here's why:
[This](https://github.com/dbushell/Pikaday/pull/721) is a PR against
Pikaday's master about removing moment.js from the dependencies. It's already
merged but as it turned out, it's not published yet on npm. If you install the
latest pikaday from npm, you will get moment as well. :( It's very difficult to
follow and chaotic. This is a good example of choosing a 3rd party without
proper investigation. And this is also the dangerous part of relying on 3rd
party open source modules.
[Here's](https://github.com/dbushell/Pikaday/issues/805) an issue to push
it, but no answers since 6th of September
> B, add a separate one that isn't part of pikaday
This would be the best imho because of the chaotic nature of pikaday. But
it's hard to find a solution out there I could confidently rely on. The modules
I trust are the [bootstrap
datepicker](https://ng-bootstrap.github.io/#/components/datepicker/overview) or
the [one by material
design](https://material.angular.io/components/datepicker/overview). But I have
my concerns about these. These are new dependencies and it has to be discussed
which one should be picked. Also, introducing a datepicker by angular material
would be weird imho, since it's very different from our current design and it
wouldn't feel like a cohesive whole. But I'm not in the position to decide.
C, simply bring the relevant code into Metron so that if we need to
maintain it or make changes we can feely do so?
This is why I've forked pikaday-time
> [UI] Migrate off moment.js
> --------------------------
>
> Key: METRON-1796
> URL: https://issues.apache.org/jira/browse/METRON-1796
> Project: Metron
> Issue Type: Improvement
> Reporter: Tamas Fodor
> Assignee: Tamas Fodor
> Priority: Minor
>
> Remove Moment.js and replace with another smaller library.
> Moment.js requires us to import the entire library vs. a few necessary
> modules.
> Moment.js can prevent bundlers from supporting tree-shaking.
> By removing Moment.js, we can decrease our overall bundle size and prevent
> issues with tree-shaking in the future.
> Here you can find the discussion on the mailing list:
> https://lists.apache.org/thread.html/2e4fafa4256ce14ebcd4433420974e24962884204418ade51f0e3bfb@%3Cdev.metron.apache.org%3E
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)