Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Hosting option for new users #124

Closed
wants to merge 1 commit into from

Conversation

geelen
Copy link

@geelen geelen commented Jul 15, 2020

TL;DR:

  • A user on GitHub (<username>) creates a public Foam repo name foam-notes (or something standardised)
  • The URL <username>.foam.website (or something similar) is immediately available as a public view of their notes!

Copy link
Contributor

@mathieudutour mathieudutour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the proposal.

It does sounds like a fun thing to work on!

This is the way I'd like to build it, but it's not the only approach:

* A static-site generator could be part of the Foam workspace example (as it sorta is now). People can publish using GitHub pages or Netlify (or Linc & Cloudflare, too).
* ❌ Needs users to register a separate account with another service (assuming GitHub pages isn't sufficient)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's fair to count it as a cons. Why would GH pages be less sufficient than the new service?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah sorry I wrote that before I remembered that GH pages would "just work" then edited and it doesn't really apply any more :)

* A static-site generator could be part of the Foam workspace example (as it sorta is now). People can publish using GitHub pages or Netlify (or Linc & Cloudflare, too).
* ❌ Needs users to register a separate account with another service (assuming GitHub pages isn't sufficient)
* ✅ A user's repo is wholly self-contained
* ❌ Having the SSG bundled means it will gradually diverge between users, which might make new features harder for people to adopt, and make it less possible for people to share ideas.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can have the SSG bundled and still get some updates: for example in https://github.com/mathieudutour/foam-gatsby-template, it depends on gatsby-theme-garden which can be updated separately using semver. People using it got the graph visualization for free.

But yeah, we need some way to sync with a template (that's true even without the SSG bundled for now because of Foam because a setting file in .vscode 😄 )

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works for a central maintainer pushing updates, but doesn't let people try out someone else's renderer with their content without pulling/forking/copying etc, so I think it'd be less of an enticement for exploration.

A central authority releasing updates to the .vscode directory does make a fair bit of sense though, since that's kind of what Foam is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't let people try out someone else's renderer with their content without pulling/forking/copying etc, so I think it'd be less of an enticement for exploration

Possibly, but getting your renderer on the service would also be a lot more difficult than just pushing a template on GH and so the barrier would be a lot higher?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mayyyybe? But the idea that <any-github-username>.my-fork-of-foam-renderer.com could be made to work means that you could try anything out you like?

Forking the renderer code and deploying it would be a little bit more work than using GH pages, sure, but basically the same number as steps as setting up any Netlify site.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forking the renderer code and deploying it would be a little bit more work than using GH pages, sure, but basically the same number as steps as setting up any Netlify site

Is it really? I mean I guess it depends how the renderer works but imagine I'm creating a shiny new framework in rust and implement a foam renderer with it. How do I plug it in?

* ❌ Needs users to register a separate account with another service (assuming GitHub pages isn't sufficient)
* ✅ A user's repo is wholly self-contained
* ❌ Having the SSG bundled means it will gradually diverge between users, which might make new features harder for people to adopt, and make it less possible for people to share ideas.
* ❌ Delay between pushing and publishing isn't great, but isn't bad for simple sites
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing with some "clever caching" it can be as fast as the new service?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe? I'm only aware of Gatsby's hosted service or Vercel's revalidation stuff that could push content without rebuilding the whole site?

Both of these processes lend themselves to a "serve stale" approach:

* The edge renderer _always_ responds with the current version in-cache, so responses are always fast (after the very first requests).
* Periodically (ideally, once every ~5-10 seconds) GitHub is checked to see if there have been updates. If there have been, the cache is refreshed and new requests will get the updated content. **This means the time between pushing new content and it being visible could be as low as 5 seconds**.
Copy link
Contributor

@mathieudutour mathieudutour Jul 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There could be an hybrid approach for "advanced" users where you ask them to add a webhook on their repo which ping the service when they push. That way you don't have to poll all of the repos and GH is happier.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep definitely, I have a caching model in mind for the polling that would make it pretty minimal on GH, but you could definitely move to a push model. I still think the idea that there's zero configuration required on the author's part (and you still get sub-10-second caching) is the most interesting thing though.

It also means that it's not just Foam that this would work for, but any crawlable collection of Markdown files...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think the idea that there's zero configuration required on the author's part is the most interesting thing though

Yep agreed. I was more thinking about the next step if someone wants even more real time updates

@digiguru
Copy link
Contributor

Given the cost involved in this solution, id suggest it's a good strategy to have monitization, otherwise it risks strangling a fledgling open source project.

Foam is opensource, but Hosted Foam can be used to sponsor the opensource development. People would be paying for the easy setup process, themeing options, vanity URLs and caching rather than the effort in maintaining build processes and Jekyll (even if it is a couple of lines in a config file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants