spike-datocms icon indicating copy to clipboard operation
spike-datocms copied to clipboard

Changes to API

Open stefanoverna opened this issue 8 years ago • 4 comments

And here's an example of usage: https://github.com/stefanoverna/spike-datocms-example/blob/master/app.js

The main changes:

  • Remove the API parsing logic from spike-datocms, reuse the datocms-client ItemsRepo for that. This means that in the views you can access to every content stored in the DatoCMS backend as described in the documentation (https://docs.datocms.com/other/accessing-records.html and later chapters).
  • Change the way you declare single pages in app.js: https://github.com/stefanoverna/spike-datocms-example/blob/master/app.js#L29-L33
  • Introduce a dato-meta-tags directive that you can use in your views to populate the of your page (a similar thing should be made to generate favicon meta tags)

stefanoverna avatar Jul 15 '17 09:07 stefanoverna

@jescalan if you like the overall direction of the proposed changes, I can finalize things and write tests. Let me know if I can start :)

stefanoverna avatar Jul 19 '17 08:07 stefanoverna

@stefanoverna Yeah, I would say don't worry about the meta tags helper, I can take that section, but as far as the primary piece with using the client, I think this is good to start testing!

Interesting with the websockets though, this is really cool. I can also hook this up to the watcher, don't worry about that part.

jescalan avatar Jul 25 '17 00:07 jescalan

Hi @jescalan, we're receiving requests regarding this PR on our support chat.. looking forward to close it! 😃 I'm not very familiar with the internals of spike so I would really need some help of yours :)

screenshot 2017-08-29 12 30 27

stefanoverna avatar Aug 29 '17 10:08 stefanoverna

So, this is massively breaking and still has no tests at all, so I can't really merge it yet, it still needs a bunch of work. Also, what's being asked there can already be accomplished with the plugin as it exists - you're welcome to direct them here to the issues section in this repo with questions!

jescalan avatar Aug 31 '17 05:08 jescalan