Coder Social home page Coder Social logo

Daily Notes about athens HOT 11 CLOSED

athensresearch avatar athensresearch commented on May 5, 2024 1
Daily Notes

from athens.

Comments (11)

tangjeff0 avatar tangjeff0 commented on May 5, 2024 2

@Bardia95 love the research and see no reason why we can't move forward with your recommendation. Go for it!

This is a tangential reason, but juxt is also behind OpenCrux. Temporality is important to them so I believe this library will only get better over time! #9 (comment)

from athens.

tangjeff0 avatar tangjeff0 commented on May 5, 2024 1

@Bardia95 that's awesome — glad you are setting a deliverable for yourself! I'm personally more curious about how you two are mapping these scopes, and what scopes will be discovered and refactored over time. Please update this issue at various checkpoints so you can teach the rest of us :)

from athens.

jeroenvandijk avatar jeroenvandijk commented on May 5, 2024

TASKS

  • Core work: scrolling down and opening a new page (add onscroll event listener)
  • Add warning when title of date page is changed (possibly a regexp check on the page title is enough for this. Maybe no need to check if it is a special page)
  • Bonus: when you are in the Daily Notes view and time passes into the next day (in your timezone), a new day should be added. Could be done by triggering a re-render in X seconds via (setTimeout ...)
  • Bonus: to keep the app performant endless scrolling down should also clean up day views on top. With scrollup event these views would have to be added again

from athens.

Bardia95 avatar Bardia95 commented on May 5, 2024

Working on it with @pinned5th as part of ClojureFam, looking to get a working version by end of week!

from athens.

Bardia95 avatar Bardia95 commented on May 5, 2024

@tangjeff0 right now, the path is uncharted, my plan for today is to experiment with how we could accomplish this feature and update with any findings, and then once we've scoped out a bit will update with what we're each working on. We have planned a pair programming session once we've scoped out more granularly

from athens.

tangjeff0 avatar tangjeff0 commented on May 5, 2024

Sounds good, you may want to look into date libraries. We have Google Closure already available or cljs-time. Please tell us the tradeoffs between these two, other libs, or if we should roll our own, etc.


I think page creation has more discovered tasks.

Jeroen touches upon this here, but it assumes Athens is already open:

Bonus: when you are in the Daily Notes view and time passes into the next day (in your timezone), a new day should be added

What happens when Athens is first opened? What happens when a user doesn't log into Athens for a few days — are those dates not created? What happens when a user creates a date in the future, and then that date arrives? Roam has their own behavior for these cases, but I'm not certain these implementations are best or how we want to do it.

from athens.

Bardia95 avatar Bardia95 commented on May 5, 2024

Sounds good, you may want to look into date libraries. We have Google Closure already available or cljs-time. Please tell us the tradeoffs between these two, other libs, or if we should roll our own, etc.

Here are some notes I took:

  • CLJS
    • cljs-time
      • Imitates the API of the clj-time library
        • Not a drop-in replacement though
      • Leans on Google Closure goog.date library for basic date/time functionality
      • Date objects are mutable
        • But operations that alter a date object return a copy
        • Looking to move towards immutability
      • Limited timezone functionality (but that is a JS issue)
      • Good test coverage
      • Good for keeping a consistent API across client and server
        • But equality in goog.date and JS dates are not the same as in clj-time though, so you can use their own = operator
      • Can also serialize
      • Easy library to learn
  • CLJS / CLJ
    • juxt/tick
      • Replacement for clj-time
      • Runs on JVM and JS runtime
      • Alpha but ready to use
        • Expect minor changes
        • Not heavily documented
      • Built on top of cljc.java-time
        • Provides a single ns
        • Batteries-included
        • Power tools (interval algebra and scheduling)
  • JS
    • Luxon
      • Built by the guy who maintained moment.js but with immutable dates
      • Better time zone and API names according to author
      • Use directly or create wrappers
    • goog.date
      • Already included in the Closure library
      • Simplest solution
      • Use directly or create wrappers
      • Probably will require utility functions
    • date-fns
      • Uses existing native type and does not extend core objects
      • Functional programming submodule for composition
      • Pure functions
      • Immutable by default
    • moment.js
      • Defacto JS library
      • OOP APIs
      • Most powerful
      • Big bundle
    • day.js
      • Tiny replacement for moment.js
        • Same API

My first choice was cljs-time as I'm already familiar with cli-time, but I'm a little worried that the dates are mutable even though the functions return copies. Not sure what could happen but seems to go against Clojure's paradigm. The other thing that troubles me is that it mimics clj-time but is not compatible with the backend. I think juxt/tick could be a better solution, this is what the author wrote about the difference between using tick and using cljs-time and clj-time for a full-stack app:

Most Clojure applications use clj-time which is based on Joda Time. However, cljs-time objects are mutable goog.date objects which in turn wrap JavaScript Date objects.

This works OK as a proxy for Instant, but is not a great foundation for local dates etc.

The author of cljs-time, Andrew McVeigh, has said he would ideally move cljs-time off goog.date but is unlikely to do so at this point. For one thing, there could be more than a few current users relying on the JS Date nature of the cljs-time objects.

Taking a fresh look at the date/time landscape, we now have java.time (JSR-310) and implementations in both Java and Javascript and so it is possible to create tick, which combines the excellent JSR-310 with an expressive, cross-platform Clojure(Script) API.

For some use cases it is possible to write cross-platform code with clj/s-time, conditionally requiring clj-time or cljs-time in a cljc file. In our experience though, the fact that cljs-time doesn’t have complete fidelity with clj-time often comes to be a problem.

from athens.

Bardia95 avatar Bardia95 commented on May 5, 2024

It seems like juxt/tick is probably our best bet, what do you think? @jeroenvandijk @tangjeff0

from athens.

tangjeff0 avatar tangjeff0 commented on May 5, 2024

Working on it with @pinned5th as part of ClojureFam, looking to get a working version by end of week!

How are scopes progressing @Bardia95 ?

from athens.

Bardia95 avatar Bardia95 commented on May 5, 2024

Sorry I've been unexpectedly swamped with work from my job. But I'm focussing on the issue all day tomorrow and will have some commits to look over. I've made some notes of things that need to be considered in the mean time:

  • Create new page at 12:00 am (localized) (need to get location / timezone) every day with title being the date
    • Make sure you can't edit the title of this page
      • Show warning
    • Everything else is like a normal page
  • Display pages on Daily Notes page
    • Only show days from current day and before (no future dates)
  • Have the Daily Notes page update at 12:00 am when the new page is created
  • What happens when Athens is first opened?
    • Creates new page with the day
  • What happens when a user doesn't log into Athens for a few days — are those dates not created?
    • No, the daily notes is only created when on the app
      • On connect
        • Query db to see if page exists of today
          • (maybe make this every few seconds)
            • If so just update
            • If not create new page and update
  • What happens when a user creates a date in the future, and then that date arrives?
    • Covered in above

from athens.

Roc-kit avatar Roc-kit commented on May 5, 2024

Hi, Where's the calendar button? I can't find it 😂

from athens.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.