Closed JuhaS closed 6 years ago
@woodpig07 can you maybe give your ideas on what could be good approach.
Few notes:
Chopper edited collection entry "Test Entry"
.As a short term solution that targets the usecase where file-changes happen through jekyllpro-cms:
I agree on the use of socket.io to notify frontend about the modification to repo, but I believe it would act like a publish/subscribe service for the index document in mongodb, not directly triggered by user commits. Currently we only update the index in a passive way by refreshing the app page. I had built a webhook to update index incrementally based on commit data, I'd like very much to take advantage of that for a real-time (or near real-time) experiences.
Proposed work flow:
I had built a webhook to update index incrementally based on commit data, I'd like very much to take advantage of that for a real-time (or near real-time) experiences.
Is this already in the repo? Can @haishanh leverage that already?
About using GH webhook I think we should primarily design without requiring this since this will require manual setup from the user side. Instead I would recommend this:
index-refresh
task to be incremental:
index-refresh
index-refresh
@woodpig07 do you think this would be ok?
Talked with @haishanh
Technical approach (first steps):
collections
field to be an object with file path as a key.lastIndexedCommit
field to the database (per repo+branch)Next:
Sorry for delaying...
This issue is becoming very critical now, as the sbux website repo have over 360 entries. And it's extremely slow at displaying all content after new entry is added.
In this PR https://github.com/Wiredcraft/jekyllpro-cms/pull/61
I've added a new API endpoint /api/repository/updated-collections
, which will only return modified/removed entries if there are changes between 2 commits. The frontend will call this API every 8sec.
The Socket.IO feature is not implemented yet.
As this issue is becoming a blocker for the marketing team. I'd like to land the PR ASAP.
@JuhaS @woodpig07 Can you help review the PR?
@haishanh please go ahead merge your PR, I left a few suggestions there, hope that's helpful.
not relevant anymore