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 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.
    Alok Kumar
    @iFlameing
    @datakurre One feature is still left in MVP i.e Delete which I will try to implement as soon as possible. I am following your words taking each week as sprint and try to implement a feature in a week.I do not believe that I am completing a feature in a week. I am totally inspire by you, you said that you can provide me websocket on first week of june and you made a pull request on Tuesday night as you said. I am devoting lots of hour in learning code, understanding the gatsby-source-filesystem and Plone. After achieving the MVP, I think that I should write test for all the implemented feature i.e (add, modify and delete). I have some experience with jest and enzyme but not with other framework. But currently I am focusing on the MVP :)
    Asko Soukka
    @datakurre

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

    Asko Soukka
    @datakurre

    Good that you manage with the TOKEN environment variable. I got good progress with adding security for the websocket support, but still more work to do.

    But this week I will have more time later, so I really hope this to be done by the next week.

    Alok Kumar
    @iFlameing

    As an almost unrelated thing, we just released the biggest GatsbyJS site so far: https://studyguide.jyu.fi/ (about 4000 pages)

    This is great :)

    Asko Soukka
    @datakurre

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

    Alok Kumar
    @iFlameing
    @datakurre I have submitted the form of first evaluation :)
    Nilesh
    @nileshgulia1
    Hey @iFlameing , Congrats on first evaluation!
    Keep up the good work!
    Alok Kumar
    @iFlameing
    @nileshgulia1 thanks!
    @datakurre Since all the issue related to MVP is closed now, I am thinking that MVP is done now :tada: :tada: .
    Asko Soukka
    @datakurre
    @iFlameing Yes. Congratulations!
    So, what should you do next...
    Alok Kumar
    @iFlameing
    @datakurre I should start writing test for the added feature as we discuss earlier.
    can you guide me?
    How I can get started with it?
    Asko Soukka
    @datakurre
    @iFlameing Could you start by going through a few popular/official GatsbyJS source plugins to learn how they do their testing?
    I would guess that plugins they support for GatsbyJS Preview should be good quality enough to have some tests https://www.gatsbyjs.com/docs/#using-gatsby-preview
    Or maybe Wordpress one.
    All of those probably live inside the main GatsbyJS repository.
    Currently we have only a few simple unit tests for utils.js.
    Alok Kumar
    @iFlameing
    @datakurre ok!
    Asko Soukka
    @datakurre
    We are using jest https://jestjs.io/docs/en/getting-started but at least currently not snapshot tests. Just regular asserts.