Code-dot-mil / code.mil

An experiment in open source at the Department of Defense.
https://www.code.mil
MIT License
1.28k stars 122 forks source link

Issue #241 #249

Closed b-d055 closed 11 months ago

b-d055 commented 5 years ago

Issue: #241

Approach

I used plain React to build a simple ProjectList component that fetches and renders basic information from code.json file.

Please review and suggest changes, as this is my first pull request.

jordangov commented 5 years ago

Thanks @b-d055! Unfortunately I can't preview this because our content security policy blocks the links out to React. We'd need to pull those resources into local context.

Somewhat related though... I struggle to justify including all (most) of React for a single page that has no dynamically updating content. Seems like a simple fetch() and then build of the page elements would be pretty easy. Or even a server-side rendering of the page.

Curious to get @jgarber623-gov's thoughts.

b-d055 commented 5 years ago

Ah yes, I see that now. I'll try bringing those external resources in locally.

And I think you're right about including all of React. However, if this project wants to be more like code.gov, perhaps it'd be beneficial in the long term? I'm thinking this could be built upon to include a more dynamic search screen with filters and/or search boxes and other, more dynamic goodness in the future.

There's also https://preactjs.com/ as an alternative.

Just my initial (perhaps naive) thoughts!

jgarber623-gov commented 5 years ago

I'm with @jordangov on this one. There are a few ways that we could address #241 without introducing a hefty dependency like React:

  1. Use Jekyll's native data file processing to generate an inventory page when the site builds and deploys,
  2. Use Jekyll's plugin architecture to write a little bit of Ruby to do the same.