Closed b-d055 closed 11 months 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.
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!
I'm with @jordangov on this one. There are a few ways that we could address #241 without introducing a hefty dependency like React:
Issue: #241
Approach
src/_includes/body.html
to make react available on jekyll pagesbody.html
insrc/_layouts/page.html
src/assets/js/react-compopnenets.js
to fetch code.mil/code.jsonI 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.