Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Asko Soukka
    @datakurre
    I hope that us choosing the websocket approach makes this easy enough for this GSOC, because subscribing to websocket events should make this use case pretty similar to gatsby-source-filesystem subscribing file system events.
    Alok Kumar
    @iFlameing
    ok thanks for explaining all these things :)
    Alok Kumar
    @iFlameing
    @datakurre I read the documentation of Gatsby related to creating source plugin, gatsby node api, various action provided by Gatsby. I also read the plone Rest Api for better understanding how things are going on when we fetch the data from Plone CMS and converting them into Gatsby-Node. Just One problem I read the documentation of webhook but I don't understand it . What we get when webhook trigger? we will get only one message that something is changed or we get a specific url that is changed?. Can you explain the webhook addon. please!
    Asko Soukka
    @datakurre
    @iFlameing We can forget the webhook plugin. I should be able to add a Plone with websocket support into the gatsby-source-development environment, if not already next week, then after the first week of June.

    @iFlameing And for the websocket, we can define the protocol we need.

    Maybe a websocket message could be JSON encoded payload with something like {"event": "created", "id": "http://url/of/the/page", "uuid": "uuid of the page"}

    @iFlameing For development, it might still be good for you to develop trivial websocket server so that you can manually send websocket messages the plugin.
    Asko Soukka
    @datakurre

    @iFlameing For a development websocket server a minimal chat server could work https://socket.io/get-started/chat/

    Just create that chat example separately from gatsby-source-plone

    Next make gatsby-source-plone connect that server with websocket (believing that it is Plone)

    Finally use the chat client example to publish messages from browser to gatsby-source-plone through that websocket server.

    @iFlameing So even before I can provide a websocket supporting Plone server for you, you can simulate it with minimal nodejs websocket example.
    Asko Soukka
    @datakurre

    @iFlameing Something else you probably need to learn for this is using node debugger https://nodejs.org/en/docs/guides/debugging-getting-started/

    For example, you should be able to run gatsby develop with debugger with node --inspect node_modules/.bin/gatsby develop. With debugging mode you should be able to add "debugger" break points into the code and e.g. have interactive repl to figure things out when websocket connection gets a message.

    Asko Soukka
    @datakurre

    @iFlameing Please, try to transform the main tasks from your GSOC project plain into tasks or real issues into https://github.com/collective/gatsby-source-plone/projects/2

    I'm working on Docker image with Plone and websockets on next Tuesday, but it might still take another week for me to complete it. So you should probably start as you planned.

    Let's try to find a time when I would be available here every week so that we could prevent blocking issues. I am on UTC+3 so I assume that we could have that time around you Monday noon or aftertnoon. Something between 6am UTC and 8am UTC should fit for me.

    Yet, the best way to ask questions is either using GitHub issues or here. Remember to tag me so that I get notifications.

    Asko Soukka
    @datakurre

    @iFlameing Today is the start day of the coding phase.

    You should start by re-reading the rules on how to publish the results at the end of the GSOC:

    • Make your work visible by using GitHub project board tasks, GitHub issues and commit all your work into feature branches so that they could be discussed and merged with pull requests.

    • During the last years it has been ok to make the final report as GitHub Gist referring and explaining all the pull request done for the code.

    I'm sorry that the "community bonding period" was a bit tame, but luckily you already learned practices for both Plone and GatsbyJS communities before and during the application period.
    Asko Soukka
    @datakurre
    @iFlameing Please, try to also plan your summer by transforming your project proposal into issues (or just tasks).
    And if you manage to write test websocket server before I have a websocket Plone, that can also be included in gatsby-source-plone (in some custom folder) to make also that work visible.
    Alok Kumar
    @iFlameing
    @datakurre thank you very much for all these suggestion. I am thinking that I should start with the chat app and first publish message from browser to gatsby-source-plone throught websocket server. And also update the readme.md section and writing test for the added fetching private image part which you mentioned in the pull request.
    Asko Soukka
    @datakurre
    @iFlameing Looking good! Making a push into some branch at the end of the day would be a good practice. Even if the code is broken. Branches and be deleted / merged / rebased etc. and cost nothing. And from GSOC perspective that would make your work visible and easy to evaluate.
    Asko Soukka
    @datakurre

    @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.

    Alok Kumar
    @iFlameing
    @datakurre that's good. Just unclear about where should I add the boolean 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.
    Alok Kumar
    @iFlameing
    @datakurre Currently I am using make watch for testing with websocket. When I ran the command 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?
    Asko Soukka
    @datakurre
    @iFlameing "websocketUpdates" would go into gatsby-config.js and could then be included in gatsby-node.js next to the other options read from gatsby-config.js
    Asko Soukka
    @datakurre

    @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...

    I'm only familiar with the previous version of that debugger , so I'm not sure how that works, but I assume that the documentation explains.
    Asko Soukka
    @datakurre
    @iFlameing Now, I actually tried it:
    1. add "debugger" keyword into your code as breakpoints
    2. cd tests/gatsby-starter-plone
      node inspect node_modules/.bin/gatsby develop
    3. enter one time "c" to allow it to start
    4. you should see the execution being stopped at your "debugger" breakpoint
    5. enter "repl" to enter into interactive repl at the line of your "debugger" keyword
    I believe some IDEs support more interactive debugging (like adding breakpoints directly from the editor in-fly), but I don't have experience of those yet.
    Asko Soukka
    @datakurre
    @iFlameing Please note that the command above is node inspect (not --inspect).
    Asko Soukka
    @datakurre
    @iFlameing Btw, whenever during this GSOC, if you feel like being blocked with some issue and it takes time from me to respond or help, you could use the time for going back to study gatsby-source-filesystem as a reference implementation for source plugin with event based updates. I assume that it is easier to understand once you get more and more familiar with gatsby.
    Alok Kumar
    @iFlameing
    @datakurre ok
    Alok Kumar
    @iFlameing
    @datakurre I made changes to both the pr as you suggested and they are ready to merge. please take a look!
    Alok Kumar
    @iFlameing
    thanks for the debugging part I am able to do it now :)
    Asko Soukka
    @datakurre
    @iFlameing So good to hear you learned the debugger! If you ever end up using some IDE, there's probably more integrated support for that. For example, I'm subscribing PyCharm Professional, so I should be able to use its dedicated support https://www.jetbrains.com/help/pycharm/running-and-debugging-node-js.html (JetBrains have special student program https://www.jetbrains.com/student/ but sure you can also try some other IDEs.)
    Alok Kumar
    @iFlameing
    @datakurre thanks for the IDE suggestion but currently I am using VS Code and I successfully created Gatsby env for debugging. But still I am figuring out how I can properly use all the feature by VS Code IDE. Currently I am only able to just put break point and see the call stack.
    Asko Soukka
    @datakurre
    @iFlameing VS Code is OK, definitely simpler, and I'm sure there's plenty of tutorials somewhere how to make it work :)
    Asko Soukka
    @datakurre
    @iFlameing Btw, how do you feel about your GSOC now in general?
    Asko Soukka
    @datakurre
    @iFlameing I almost completed the new Plone docker image today, so I expect that next week you'll have it.
    Asko Soukka
    @datakurre

    @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 :)

    Alok Kumar
    @iFlameing
    @datakurre I am having a great time working on the project, learning new stuff everyday :)
    Alok Kumar
    @iFlameing
    @datakurre I try to connect with Plone baseUrl using websocket but I am unable to get any response.
    I ran the command make purge init-backend command and connect the socket with the baseUrl but didn't get any response.
    Alok Kumar
    @iFlameing
    @datakurre when I am checking connection as socket.connected it gives me false.
    Asko Soukka
    @datakurre
    @iFlameing I assume from your pull that you got the websocket connection working?
    Asko Soukka
    @datakurre
    @iFlameing When you were using baseUrl, did you remember to change the protocol (http:// or https://) to ws://?
    Alok Kumar
    @iFlameing
    @datakurre I did some research about the socket problem and found that it works little different than original websocket. Behind the scene it implement lot of function on top of original websocket. By ws npm I am able to connect to the websocket.
    Asko Soukka
    @datakurre

    @iFlameing Oh, sorry about that. I did't realize that. Actually I thought that it would be only useful for the mock server (to get a server build with minimal work), but forgot to say that aloud.

    Good that you were able to move to simpler library.

    Asko Soukka
    @datakurre

    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.

    Alok Kumar
    @iFlameing
    @datakurre No, I just update the token everyday and continue to development :)
    I think that current websocket is enough for gsoc as you said earlier.
    Asko Soukka
    @datakurre
    @iFlameing For me it seems that you may have MVP (minimal viable implementation) for add, modify and delete completed pretty soon. What would you prefer doing after that? I know the code could be refactored, but for a good practise you should try to write test before refactoring (so that the tests would prevent you from breaking anything during refactoring). All the data used in acceptance tests is there already in JSON format, so unit- and integration testing everything should be possible (though not necessary easy).
    Alternatively (or after testing) there are a couple of small or medium size issues available: refactoring logging and adding image size information into images within Plone document rich text fields.
    Finally, as a large stretch goal there is anything to help porting this plugin to TypeScript.
    Asko Soukka
    @datakurre
    @iFlameing Just think about what would you like to learn most during the rest of this GSOC to maximize the benefit of this time for your experience.