Comments (5)
date-fns
is both stable and cool for some time. It's lightweight, actively maintained and very much feature-parity with moment.js
. Second vote for that sturdy library.
from superset.
I think that belongs in the frontend too, ideally backend sends a utc stamp and frontend can show something even relative to now
that changes with timers and such. What's the new hot library to replace moment?
from superset.
Personally, I think doing this in the front end makes more sense, but it's probably debatable! That would make it easier to leverage in the myriad places we'll want to do so going forward.
One thing that's awkward here is the fact that moment.js
is no longer maintained. At some point we might want to migrate to date-fns
or whatever's cool/stable. To minimize the pain here, it might make sense to centralize the logic here as either a utility function in the codebase utils (get_humanized_time(datetime, {lang})
or perhaps a react component that renders a span
with the appropriate string.
As long as we adhere to the DRY principle and reduce/reuse/recycle logic so it's scalable/maintainable, I'm open to whatever works :) I'll just ping @michael-s-molina @dpgaspar @mistercrunch who might have different/additional opinions on the matter.
Thank you for offering to contribute a PR around this!
from superset.
Hm, I see moment.js being in maintaince mode as a separate Problem from what I described initially. I definitely see your arguments regarding phasing out moment but as of today, it is pretty deeply rooted within the frontend. Moment is a dependency not just for antd4 but also the echarts- and handlebars-plugins, as well as a few other legacy plugins.
Therefore I would stick with moment for now, instead of introducing yet another dependency.
I hope to submit a draft PR this week.
from superset.
It'd be good to dig deeper, but while moment is used in many places in the codebase (looks like about 30 files), I don't think we use much of the api surface there. I also remember fighting with it around the fact that it was bloating our bundles quite a bit. The fact it isn't maintained is always a risk too. Given all this it seems we should replace as opposed to putting more work on top of it.
from superset.
Related Issues (20)
- Remove `can csv upload`, `can excel upload`, `can columnar upload` in favour of just `can upload on Database`
- Slack API `files.upload` v1 deprecation HOT 6
- [SIP-130] Migrating from Mapbox to MapLibre
- MSSQL - ERROR: Could not load database driver: MssqlEngineSpec HOT 5
- superset-frontend proxy is not working when superset backend decides to use zstd encoding HOT 2
- "Can't contact LDAP server HOT 1
- SQL Lab hard fails with "'utf-8' codec can't decode byte 0xe6 in position 0: invalid continuation byte" when reading certain binary types HOT 3
- Installing error HOT 12
- [SIP-131] Superset Security Model Redesign HOT 5
- Superset ALERT & REPORTS not working HOT 11
- Missing translation for dynamic text HOT 2
- Table Chart - Line "totals" without tooltip to show the real/exact value HOT 1
- Outdated Links to Issue Codes (404 Not Found) HOT 1
- Installation error: Maximum recursion depth exceeded HOT 3
- ImportError: cannot import name 'StatsdStatsLogger' from 'superset.stats_logger' (/app/superset/stats_logger.py) HOT 10
- Remove CSV_UPLOAD_MAX_SIZE config
- Remove old CSS templates views and endpoints HOT 1
- Remove old Dashboard views and endpoints
- Remove old Database views and endpoints HOT 1
- Dragging a chart onto a top-level tab (not an in-dash tab set) makes the chart a new (broken) tab HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superset.