Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rfc/issue 115 build time data access #269

Merged
merged 36 commits into from
Jan 29, 2020

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Jan 15, 2020

Related Issue

resolves #115

Summary of Changes

takes deep breath...

First of all, BIG shout out to @hutchgrant for the getting this going in #251, of which this PR was based off of. Will try and highlight all the relevant additions / modifications here, but there is a lot to go through so will do my best. Still a couple more TODO items and questions to go over, but this is it. We did it. 🏆

@greenwood/cli/data

Created this "alias" package to expose server, client, and cache.js files for the CLI and for consumers.

Main thing of note is that we wrap ApolloClient and determine where the data should come from.

Note: Bear in mind, this is being naively done. Should find a way to do it without the .catch handler

Server Side Rendering

One difference is now the data is being rendered server side. As the calls come into the GraphQL server, they will be written to uniquely-hashed named JSON files, and then during the serialize phase are written to index.html in window.___APOLLO_STATE. This implements a more traditional server side rendering technique and integrated it with the header

For example, while the code for the header is

<nav>
  <ul>
    ${navigation.map((item) => {
      return html`
        <li><a href="${item.link}" title="Click to visit the ${item.label} page">${item.label}</a></li>
      `;
    })}
  </ul>
</nav>

In the serialized HTML, we now see this! (which wasn't happening when it was being client side rendered)

<nav class="style-scope eve-header">
  <ul class="style-scope eve-header">
    <!---->
        <li class="style-scope eve-header"><a class="style-scope eve-header" href="/about/" title="Click to visit the About page"><!---->About<!----></a></li>
      <!---->
        <li class="style-scope eve-header"><a class="style-scope eve-header" href="/docs/" title="Click to visit the Docs page"><!---->Docs<!----></a></li>
      <!---->
        <li class="style-scope eve-header"><a class="style-scope eve-header" href="/getting-started/" title="Click to visit the Getting Started page"><!---->Getting Started<!----></a></li>
      <!---->
        <li class="style-scope eve-header"><a class="style-scope eve-header" href="/plugins/" title="Click to visit the Plugins page"><!---->Plugins<!----></a></li>
      <!---->
  </ul>
</nav>

The client the user consumes will be able to intelligently tell if the calls should be live (development mode, or read from cache / disk instead of over the wire)

GraphQL

To start things off, I have defined the CLI's graph as a type in GraphQL. I am using this to render the header and confirming that the Shelf would correctly get the data, but there is the issue of sorting though...

We are lucky that the navigation order in our header is already alpha-sorted. I think we will need to improve how we can query the graph in a more "declarative" way and / or customizable from a user perspective (e.g. providing a custom sort order). Will discuss more in the Follow Ups section.

I left console logging in for now to help with seeing this all working. Will remove before the PR is merged.

TODOs

  1. Production console.log from the shelf not display response data (though cache.json file is loading fine)
  2. Figure out a better way to detect "offline" mode other than fetch().catch()
  3. "Fully" define Page typeDef defintion based on internal graph object
  4. Add test cases for graphql (.json files, serialized output)
  5. Review docs, add links to examples in our own code?
  6. Review package.json dependencies, cleanup where applicable
    • using deepmerge since apparently deep merge is not a one-liner yet? 1, 2
  7. Confirm that not closing GraphQL server during serialize lifecycle isn't leaving behind a zombie process
  8. Review / address outstanding TODOs in the code
  9. Too much overlap with "cli" test? e.g. state.getAttribute('data-state')
  10. unit tests for resolvers (nice to have, make a ticket) - add unit tests for resolvers / schema #280
  11. Have this be the start of the release/0.5.0 branch and PR, tracking relevant issues

Follow Ups

  1. Make an issue to model Greenwood's config as part of the GraphQL schema (this would address <title> and ) (as part of 0.5.0 release). This will also need to figure out a way to merge resolvers / typeDefs in schema.js. - Made expose Greenwood configuration as data #270
  2. Support "declarative" queries, or some sort of sorting, so resolver's can be more flexible then returning everything in alphabetical order and thus not fixed to the filesystem. (as part of 0.5.0 release) - query results are not deterministic #271
  3. There are implicit contracts that could be very much improved here. Would be good to track individually:
  4. Make an issue to implement passing through arbitrary front matter data to the graph (like a date for a blog post) - support passing front matter from pages to graph (custom content metadata in markdown)  #274
  5. Should data access be part of the Getting Start guide? - yes, but as branch. Use the docs data page to demonstrate the graph.
  6. remove require calls from the shelf - add support for dynamic imports  #275
  7. Make an issue for tracking Browserslist: caniuse-lite is outdated. Please run next command yarn upgrade - update browserslist version #276
  8. Can we hot reload the graphql server like webpack-dev-server? - added to Trello for review / tracking after 0.5.0 release
  9. Need to confirm if we have sourcemaps implemented... - added to Trello for review / tracking after 0.5.0 release
  10. @greenwood/cli/data as its own package? - GraphQL (Apollo) data as its own package #278

@thescientist13 thescientist13 added RFC Proposal and changes to workflows, architecture, APIs, etc website Tasks related to the projects website / documentation documentation Greenwood specific docs labels Jan 15, 2020
@thescientist13 thescientist13 self-assigned this Jan 15, 2020
package.json Outdated
@@ -20,8 +20,8 @@
"build": "yarn clean && node . build",
"serve": "yarn build && cd ./public && ws",
"develop": "yarn clean && node . develop",
"test": "yarn clean && nyc mocha ./packages/**/test/**/**/*.spec.js --timeout 30000",
"test:tdd": "yarn clean && mocha --watch ./packages/**/test/**/**/*.spec.js --timeout 15000"
"test": "export BROWSERSLIST_IGNORE_OLD_DATA=true && yarn clean && nyc mocha ./packages/**/test/**/**/*.spec.js --timeout 30000",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had to do this to keep the browserslist message from interfering in our tests that were testing for stderr
browserslist/browserslist#361

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that in development mode as well.

Browserslist: caniuse-lite is outdated. Please run next command yarn upgrade``

Copy link
Member Author

@thescientist13 thescientist13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, got a good amount of test cases in now for data serialization, however, and I think this may more have to do with usage of JSON.stringify / JSON.parse not maintaining consistent ordering or keys (even when trying to use deep.equalInAnyOrder in the tests), but it further highlights the need why something like #271 needs to be implemented as part of any release that includes this RFC.

Essentially, if you look at the test for Blog Posts, because things aren't deterministic, the order of blog pages (/blog/first-post/ and /blog/second-post/) can come back in inconsistent order which is why I can't test the full title / link contents, and had to fallback to using .contain as opposed to .equal. In fact, while equalInAnyOrder makes testing easier, think of a user getting a different order of results potentially each time. Probably gonna have a bad time. ⛷

So not only should be users be able to specify an order if they want, but at the very least our default return order should always be consistent. I will include a comment to this effect in #271 and escalate its priority.

At least it's enough to finish the last few TODOs on my list though, which I will be able to clean up tonight.

Copy link
Member Author

@thescientist13 thescientist13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hutchgrant / @aholtzman
OK! I think this is ready to go now, please let me know if you have any feedback. I will plan on using this as the start of a release/0.5.0 branch with the set of issues to be included per our last meeting.

Phew, really excited to land this one! ✈️ 💪

Copy link
Member

@hutchgrant hutchgrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to see these changes coming and especially glad to see large improvements made on my initial idea to something much more stable, practical and polished. The rehydration issue with the client and the render issue of the cache on the server being fixed made me excited. I watched every improvement to this PR and am glad we're moving this forward to 0.5.0

On initial cursory review, I found that the sorting issue being fixed is a necessity for successful testing and in practise. Perhaps that can be added post-merge. As well I found tiny things you missed in your continued improvements(typo here, outdated info there)

I would like the cache reading/writing loop to be done asynchronously pre-merge with 0.5.0 release branch as I feel it shouldn't require that many changes and is necessary.

I'd like to go over the documentation first, along with these tiny changes, before I give full approval, but you already know how I feel about this 🎉

edit: your apollo wrapper(inspired by lit-apollo no doubt) solution, to handle the conditional rendering/fetching of the cache, is good, simple, logic 🥇

const pages = await glob.promise(path.join(publicDir, '**/**/index.html'));

pages.forEach((pagePath) => {
const contents = fs.readFileSync(pagePath, 'utf-8');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned this section needs to be asynchronous. Reading a file, merging a file, writing to file, and repeating that through however many pages. That's going to cause problems if not done asynchronously. For an RFC it's fine, but before release, that needs to be fixed. #277

`import` the query in your component
```render javascript
import client from '@greenwood/cli/data/client';
import ChildrenQuery from '@greenwood/cli/data/queries/cnildren';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'@greenwood/cli/data/queries/cnildren';

typo: /children

@@ -25,6 +28,25 @@ class shelf extends LitElement {
this.expandRoute(window.location.pathname);
}

async setupShelf(page) {
console.log('setupShelf for page =>', page);
Copy link
Member

@hutchgrant hutchgrant Jan 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize console.log is for debug of shelf and can be removed later I suppose with #275

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, we'll definitely want to catch. I did notice that in prod mode (at least) the shelf seems to load twice, even from the graph. I understand that it would load once for no route, then when the route is set, but it seems to do that twice? Something I'm keeping my eye on and will show on our next call. 👀

@@ -6,6 +6,7 @@ Greenwood understands the role of community in open source, technology, and lear
- [**puppeteer**](https://github.com/GoogleChrome/puppeteer) - Headless Chrome browser used for serializtion.
- [**WC Markdown Loader**](https://github.com/hutchgrant/wc-markdown-loader/) - A webpack plugin that transforms a markdown file into a Web Component! 🤯
- [**LitReduxRouter**](https://github.com/fernandopasik/lit-redux-router) - Declarative client side routing library.
- [**LitApollo**](https://www.npmjs.com/package/@apollo-elements/lit-apollo) - Base component class for connecting to Greenwood's build time GraphQL server.
Copy link
Member

@hutchgrant hutchgrant Jan 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer using lit-apollo

edit: but understandable if you wish to highlight the project because it inspired the apollo client wrapper.

Copy link
Member Author

@thescientist13 thescientist13 Jan 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, yeah. I ended up taking it out. If anything, the idea of the client wrapper is probably more inspired by the Proxy Pattern from the Gang of Four's design patterns.

```

### Internal Sources
Greenwood exposes a [GraphQL](https://graphql.org/) + [Apollo](https://www.apollographql.com/docs/apollo-server/) server locally when developing available at `localhost:4000` that can be used to get information about your local content like path, "slug", title and other useful information that will be dynamic to the content you have. Programmatic access to this data can provide the oppourtunirty to share your content with your users in a way that supports sorting, filter, organizing, and more!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oppourtunirty

typo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phew... where's my spell checker plugin at? 🙈 🤣

#### Schema
To kick things off, let's review what is availalble to you from. Currently, the main "API" is just a list of all pages in your _pages/_ directory, represented as a `Page` [type defintion](https://graphql.org/graphql-js/basic-types/). This is called Greenwood's `graph`.

This is that the schema looks like:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is that the schema looks like:

This is what the schema looks like


Below are the queries available:

#### Graph
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graph is a subheading of queries, but it shares the same font-size due to both being h4. What do you think about the organization here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose I can just add one extra # to each heading then. But maybe better to consider @data as it's own package, as since it will be such a key feature, it might make sense to make it its own navigation item, which would give these docs more opportunity to breath, as it were.

@thescientist13 thescientist13 changed the base branch from master to release/0.5.0 January 29, 2020 02:01
@thescientist13 thescientist13 force-pushed the rfc/issue-115-build-time-data-access branch from 47073c6 to 72560ee Compare January 29, 2020 02:26
@thescientist13 thescientist13 merged commit f51b836 into release/0.5.0 Jan 29, 2020
@thescientist13 thescientist13 deleted the rfc/issue-115-build-time-data-access branch January 29, 2020 02:35
thescientist13 added a commit that referenced this pull request Mar 2, 2020
* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes
thescientist13 added a commit that referenced this pull request Mar 2, 2020
* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes
thescientist13 added a commit that referenced this pull request Mar 2, 2020
* Rfc/issue 115 build time data access (#269)

* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes

* unit test data graph

* linting

* lint fix

* added ordered index tracking when serializing pages

* formatting

* document graph page ordering

* cli data graph unit tests and expand mocha spec globbing

* address missing hash in mock graph

* loosen graph test case asserts

* update graph tests to focus less on implementation details

* add back missing develop task
thescientist13 added a commit that referenced this pull request Mar 11, 2020
* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes
thescientist13 added a commit that referenced this pull request Mar 11, 2020
* Rfc/issue 115 build time data access (#269)

* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes

* unit test data graph

* linting

* lint fix

* added ordered index tracking when serializing pages

* formatting

* document graph page ordering

* cli data graph unit tests and expand mocha spec globbing

* address missing hash in mock graph

* loosen graph test case asserts

* update graph tests to focus less on implementation details

* add back missing develop task
thescientist13 added a commit that referenced this pull request Mar 15, 2020
* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes
thescientist13 added a commit that referenced this pull request Mar 15, 2020
* Rfc/issue 115 build time data access (#269)

* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes

* unit test data graph

* linting

* lint fix

* added ordered index tracking when serializing pages

* formatting

* document graph page ordering

* cli data graph unit tests and expand mocha spec globbing

* address missing hash in mock graph

* loosen graph test case asserts

* update graph tests to focus less on implementation details

* add back missing develop task
thescientist13 added a commit that referenced this pull request Mar 15, 2020
* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes
thescientist13 added a commit that referenced this pull request Mar 15, 2020
* Rfc/issue 115 build time data access (#269)

* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes

* hello and graph queries working together

* config def and resolvers

* use real config data

* flesh out config schema and query

* remove theme file from config

* delete hello query example

* config unit tests

* rename mock graph

* formatting

* documentation
thescientist13 added a commit that referenced this pull request Mar 15, 2020
* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes
thescientist13 added a commit that referenced this pull request Mar 15, 2020
* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes
thescientist13 added a commit that referenced this pull request Mar 18, 2020
* Rfc/issue 115 build time data access (#269)

* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes

* fix cache.json lookup for deep linking

* clean up from rebase

* clean up from rebase
thescientist13 added a commit that referenced this pull request Mar 22, 2020
* Rfc/issue 115 build time data access (#269)

* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes

* hello and graph queries working together

* config def and resolvers

* flesh out config schema and query

* remove theme file from config

* delete hello query example

* formatting

* documentation

* app template with config title from data

* page title with project title

* tests for custom page title

* cleanup console log

* docs
thescientist13 added a commit that referenced this pull request Mar 22, 2020
* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes
thescientist13 added a commit that referenced this pull request Mar 23, 2020
* Rfc/issue 115 build time data access (#269)

* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes

* hello and graph queries working together

* config def and resolvers

* flesh out config schema and query

* remove theme file from config

* delete hello query example

* formatting

* documentation

* app template with config title from data

* tests for custom page title

* refactoring meta to app-template and data instead of scaffolding and added tests

* update coverage config

* fix spelling mistake
thescientist13 added a commit that referenced this pull request Apr 22, 2020
* Rfc/issue 115 build time data access (#269)

* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes

* Bug/issue 271 determinism (#292)

* Rfc/issue 115 build time data access (#269)

* graphql server working

* apollo client connect to apollo server

* connected header example using lit apollo

* todo

* todos

* query and client + server refactor

* schema refactoring

* clean up console logging

* alias all @greenwood/cli/data module imports

* avoid paramater destructuring

* graphql example in the header

* multiple schemas

* internal data sources documentation

* shelf refactor and children query integration

* refactor out ApolloQuery

* ability to intercept client.query calls

* basic semi-working implementation

* remove extra config from server context

* have puppeteer wait for graphql requests before returning content

* fix and add test cases for apollo

* merged resolvers not actually working

* multiple queries support

* everything working

* todos

* TODO tracking

* fix fallback apollo client fetch handling

* full test suite

* cache json test cases

* stablize test due to inconsistent data results ordering

* clean up deps

* todo cleanup

* remove forced client call in SSG mode for client

* represent graph through the schema

* updated data docs

* typos and grammer

* typos and community link fixes

* unit test data graph

* linting

* lint fix

* added ordered index tracking when serializing pages

* formatting

* document graph page ordering

* cli data graph unit tests and expand mocha spec globbing

* address missing hash in mock graph

* loosen graph test case asserts

* update graph tests to focus less on implementation details

* add back missing develop task

* task: refactor into single menu query, enable menu filtering with markdown declarations

* fix shelf

* fix: shelf rendering collapse/expand

* test: update al related tests

* fix: remove debug

* task: basic sorting label/index

* fix: index sorting

* fix: remove debug

* fix: current tests

* test: amending tests, removing prev mock

* test: revert previous graphql test case

* test: remove hello query

* fix: remove deprecated .json files

* fix: refactor mock graph func

* test: adding sort/filter menu tests

* task: add documentation for menus

* fix: amend documentation

* fix: amend docs for route var

* fix: typo

* task: add headingLevel and route condition, remove hardcoded vars

* fix: non-pathname menus may want linkheadings children

* task: amend docs for child heading level

* fix: change linkheadings to integer, use for headingLevel

* docs: remove navigation query docs

* test: fix test

* task: revert stub generation code

* fix: update data sources doc

* fix: amend docs for route/linkheadings additions

* fix: update filter to use title instead of label

* fix: test

* task: update docs with linkheadings query result

Co-authored-by: Owen Buckley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content as Data documentation Greenwood specific docs RFC Proposal and changes to workflows, architecture, APIs, etc website Tasks related to the projects website / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants