nodejs.dev icon indicating copy to clipboard operation
nodejs.dev copied to clipboard

Node.js calendar

Open benhalverson opened this issue 3 years ago • 21 comments

Description

re-Implementing the nodejs calendar that @lancemccluskey created.

benhalverson avatar May 02 '22 00:05 benhalverson

Please find a preview at: https://staging.nodejs.dev/2428/

github-actions[bot] avatar May 02 '22 00:05 github-actions[bot]

Codecov Report

Merging #2428 (1e34d57) into main (efbf7b9) will decrease coverage by 10.67%. The diff coverage is 15.15%.

@@             Coverage Diff             @@
##             main    #2428       +/-   ##
===========================================
- Coverage   90.38%   79.70%   -10.68%     
===========================================
  Files          87       90        +3     
  Lines         998     1163      +165     
  Branches      270      318       +48     
===========================================
+ Hits          902      927       +25     
- Misses         96      236      +140     
Impacted Files Coverage Δ
src/hooks/useGCalAPI.tsx 0.00% <0.00%> (ø)
src/util/gcalUtils.ts 0.00% <0.00%> (ø)
src/pages/calendar.tsx 54.34% <54.34%> (ø)

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 efbf7b9...1e34d57. Read the comment docs.

codecov-commenter avatar May 02 '22 00:05 codecov-commenter

The demo can be seen here. https://staging.nodejs.dev/2428/calendar/

benhalverson avatar May 02 '22 02:05 benhalverson

Hey there 👋 any screenshot of what this looks like? Curious about it! (Also, seems like the preview link is broken).

ovflowd avatar Jul 02 '22 18:07 ovflowd

Hey @ovflowd Yes after 60 days or so the Gcloud bucket that holds the preview code is deleted.

Monthly calendar Weekly weekly Daily day Agenda agenda

benhalverson avatar Jul 02 '22 19:07 benhalverson

Gotcha! Very interesting calendar, is this component supposed to be a standalone page, like, for Community events?

ovflowd avatar Jul 02 '22 19:07 ovflowd

yep it would replace nodejs.org/calendar so the new url would be nodejs.dev/calendar

benhalverson avatar Jul 02 '22 19:07 benhalverson

yep it would replace nodejs.org/calendar so the new url would be nodejs.dev/calendar

Coolio. I might have some feedback like maybe at least some margins between the header, but I believe that's a topic for another PR as we can always revisit the initial implementation of this :)

ovflowd avatar Jul 02 '22 19:07 ovflowd

Bump, just to figure things out, are there any other items that would need to be done for the calendar after this gets merged? (Eg.: description, CSS changes such as padding, adding this page to the navigation (footer))

I haven't gone through the code yet, so please disregard if my questions are irrelevant. But would we source/crawl the data from Google Calendar API? (Or whatever that is the source for the current nodejs.org/calendar -- seems to be G Calendar tho)

ovflowd avatar Jul 06 '22 16:07 ovflowd

Yes in this code we are hitting the google API directly and exposing the API key. It’s ok in this case because the API key is limited to only nodejs.dev. and is limited to the google calendar API A few ideas to fix this is Setup a proxy API with a serverless function Setup an express server as a proxy

benhalverson avatar Jul 06 '22 23:07 benhalverson

Hmmm! Interesting, doesn’t Gatsby supports APIs and is able to cache them? We could basically create an API endpoint that already maps the data that Frontend needs in the way the React components use, and basically set the API_KEY as an env value such as GOOGLE_MAPS_API_KEY

ovflowd avatar Jul 07 '22 01:07 ovflowd

@benhalverson should we create issues for these:

A few ideas to fix this is
Setup a proxy API with a serverless function
Setup an express server as a proxy

ovflowd avatar Jul 27 '22 14:07 ovflowd

I dont understand why this is failing in the PR.

ERR! Error: NormalModuleFactory.beforeResolve (IgnorePlugin) is no longer a waterfall hook, but a bailing hook instead. Do not return the passed object, but modify it instead. Returning false will ignore the request and results in no module created.

benhalverson avatar Jul 29 '22 11:07 benhalverson

@benhalverson, I believe there are some dependencies resolution having issues there, could you re-checkout your package-lock.json file from main and re-run npm install?

ovflowd avatar Jul 29 '22 21:07 ovflowd

@benhalverson also regarding this comment. Are those design changes incorporated into this PR?

Also, @joesepi commented on the original PR regarding some style changes here do you believe you would have the time to do them?

ovflowd avatar Jul 29 '22 22:07 ovflowd

Something feels wrong with the rebase, it's saying this PR has 90 commits?

Maybe you should squash the original calendar commits of this PR and drop all the other commits, and then rebase. It would make the whole process less painful, no?

ovflowd avatar Aug 06 '22 01:08 ovflowd

ya I tried to reset to when I started this PR rebased your changes then pulled in the calendar changes.

benhalverson avatar Aug 06 '22 01:08 benhalverson

Yeah, but still @benhalverson it looks like on the commits tab, the whole history is still here... If you want, I could try to fix the tree of this branch for you 😄

ovflowd avatar Aug 06 '22 10:08 ovflowd

And also regarding the peerDependencies conflict, you can use the overrides option of package.json. Something like:

{
  ....
  "overrides": {
    "react-big-calendar": {
      "react": "$react"
    }
  }
}

ovflowd avatar Aug 06 '22 10:08 ovflowd

If you want, I could try to fix the tree of this branch for you 😄

If you don't mind. I'm ok with it 👍🏻

benhalverson avatar Aug 08 '22 11:08 benhalverson

This pull request is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Sep 08 '22 02:09 github-actions[bot]

This pull request is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 09 '22 02:10 github-actions[bot]

I'm closing this PR in favour of https://github.com/nodejs/nodejs.dev/pull/2900

ovflowd avatar Oct 10 '22 09:10 ovflowd