@iFlameing I got an MVP for websocket notifications like defined in https://github.com/collective/gatsby-source-plone/pull/176#issuecomment-496275066 implemented, I did not get it dockerized yet. But most probably you will get a Docker image with these notifications in 1-2 weeks.
The first version requires no interaction nor authentication with the server.
Once I have automated Docker image building for that I'll add authentication (Authorization-token during websocket connect) and require some subscription call before notifications are being sent.
websocketUpdates
that we mention in the pull request collective/gatsby-source-plone#176. Currently I am working on sending json data from mock server to gatsby-plugin using setTimeout and setInterval, I will make a commit once I tested successfully.
node --inspect node_modules/.bin/gatsby develop
I am getting error module gatsby not found. when I downloaded the gatsby once again and I ran the command once again it shows me module react not found and other dependencies on subsequent run. What should I do now?
@iFlameing I'm sorry for not trying that --inspect beforehand.
It seems that must be run in ./tests/gatsby-starter-default to work.
So, you need to remember to:
cd tests/gatsby-starter-plone
node --inspect node_modules/.bin/gatsby develop
I should add a make target for that on some day...
cd tests/gatsby-starter-plone
node inspect node_modules/.bin/gatsby develop
@iFlameing gatsby-source-plone Master has now Plone with websocket events
Once you have pulled master or merged origin master into your branch
make purge init-backend
should switch the docker image
Currently simply opening websocket connection anywhere (e.g. baseUrl) at Plone will subscribe to those event. (There will be some handshake required and permissions checked later, but this should be already enough for you to be able to complete GSOC :)
Today I worked on Plone websocket design and implementation to allow restricting notifications by user permissions. I had progress, but was unable to complete the implementation today. So it probably takes another week until I can update the project with more production ready websocket support version.
Just tell me if it blocks your development that Plone sends notification for content that you don't have permissions. There is a manual workaround to make Plone publish all new content immediately.
@iFlameing Sounds good. So, after MVP, let's figure out a way to test all these before any cleanup refactoring.
tests for fetchUrl and fetchPlone provide an example how Plone could be mocked for testing https://github.com/collective/gatsby-source-plone/blob/master/src/__tests__/utils.tests.js#L90
At first, the use of http library should be parameterized so that any call to the library could be mocked with test fixture. This is already done for fetchUrl and fetchPlone, but not for any higher level functions.
Once it is possible to call more higher level functions with mock http interface, it should be possible to make that mock to serve the current JSON fixtures (from tests/gatsby-starter-default/fixture
But first things first. That is the MVP :)
As an almost unrelated thing, we just released the biggest GatsbyJS site so far: https://studyguide.jyu.fi/ (about 4000 pages)
There is no Plone content there yet (current content comes Hasura-enhanced PostgreSQL database), but the roadmap includes also CMS-content and Plone is the most probable solution to manage that.
As an almost unrelated thing, we just released the biggest GatsbyJS site so far: https://studyguide.jyu.fi/ (about 4000 pages)
This is great :)
@iFlameing Good news. You don't run out of work too soon.
I added a couple of new tickets related to MVP.
The first one is pretty easy and you can already simulate it by dropping the token.
It is a valid use case that fetching URL from Plone returns Unauthorized or Forbidden. In gatsby develop this should result in deleting that node if that exists (so that pages changed to private would be removed from the site).
The other one is trickier and needs more work. Currently Collection pages may "change" indirectly so there is no way to get update events for those from Plone. Updating those require scheduling (setTimeout) so that when ever there has been updates, after a small amount of time all known collections should be updated. (That means that whenever a new timeout is scheduled, the existing one should be cancelled so that update is run only once after a short period of time no more events from Plone).