Edit. Here are the available templates so far:
Original Post:
Adding official “featured” templates for web frameworks has been discussed in a few places so far (tooling-thread, spago repo). They seem like a good way to achieve the following goals:
- Make the new-user experience as smooth as possible.
- Minimize maintenance effort.
What are your thoughts on how to proceed?
Here are some questions to consider:
- Should templates be featured on purescript.org? If so, what is the policy for adding and removing featured templates?
- Should templates be versioned?
- Where should template source code live?
- What should templates contain?
- Do any other policies need to be established?
Here’s one proposal:
- Templates shall be featured on purescript.org.
- Templates shall either live in the framework’s repo or an official org (purescript-contrib or purescript).
- Only one template per framework.
- Templates must be compatible with the latest compiler version. The latest commit before a compiler version bump must be tagged with it’s version.
- Broken templates shall be demoted.
- The “Featured” section shall contain a link to “Outdated Frameworks and Templates”.
- If a user encouters a broken template, they are encouraged to do one or more of the following depending on their ability and generosity:
- File an issue in the template repo.
- File a PR in the template repo to fix the template.
- File a PR in the homepage repo to demote the template.
- A link to the filed template issue must appear next to the demoted template listing. This ensures that the template maintainers were notified of this change of status, and that other users can quickly see what’s wrong with the template and whether it’s an easy fix.
- Homepage maintainers should approve these demotion requests as soon as possible to spare frustration for new users.
- Template maintainers are responsible for filing the PR that reverts the demotion in order to restore their template back to “featured” status, but anyone else is also welcome to help reinstate working templates.
This proposal expands the scope of duties for homepage maintainers, but I hope that having a clear policy minimizes the time and effort required to approve these demote/promote PRs.
Guidelines for template contents is subjective and depends on use case. I think beginners just want to see a minimal example of something interactive appear on screen that updates upon file changes.
To get the ball rolling, here are two opinionated templates that I think would be appropriate for new users.
The guide in each readme is intended to be approachable for users who may not have a strong background in either FP or web development. I’m assuming everyone already knows about the purescript book for learning the core language, but it may be worth linking to that too.
I’m debating whether to just suggest the “global toolchain” approach and making the “local versioned toolchain” content a separate guide. The react template describes both toolchain options, while the halogen template just suggests global tools. What do you think would be best for new users?
Also, please share any other suggestions, such as directory structure and choice of bundler (parcel
vs webpack
vs other).