Elderjs / template

Elder.js template project. It is part template, part tutorial. Dive in!
https://elderjs.pages.dev/
MIT License
113 stars 32 forks source link

Feedback & suggestion: routes/hooks/route.js is pretty terse, adding a comment might help newbies #13

Closed andrew-j-roberts closed 4 years ago

andrew-j-roberts commented 4 years ago

Hi all,

I'm really happy with the documentation of this project, I spent the morning reading up and plan to use Elder.js for my personal developer site instead of Sapper.

I got the template up and running but at first I was very confused by the /hooks directory and its associated files.

E.g. https://github.com/Elderjs/template/blob/master/src/routes/hooks/route.js

I saw an import from @elderjs/elderjs and immediately assumed it was some automagical generation step, but I had noooo idea what this nested hooks directory was for.

https://elderjs.netlify.app/hooks 404s...

I figured it out and laughed after I did, but it took a little longer than I'd like to admit...

2020-09-13_11-44-34 2020-09-13_11-52-20

P.S. thanks for the awesome framework & this very functional template.

nickreese commented 4 years ago

@andrew-j-roberts I totally agree. For new comers this template needs work. Too much magic.

After v1 my goal is to have a super barebones template where everything is obvious and probably a video walkthrough / tutorial with it so that users can extend the template and understand the steps.

Then a separate blogging template with a bunch of magic and pre configs.

Always open to feedback or PRs if you see areas for improvement.

nickreese commented 4 years ago

@andrew-j-roberts Spent a bit of adding comments and documenting what is going on as a first start to help things easier to digest for beginners: https://github.com/Elderjs/template/commit/209b33b0c6e10ea8d08caf7d489d4ee7f3bf4ad9

Also:

  1. removed the data.js files as separate files as that was just confusing.
  2. documented what is going on in the plugin.
  3. added two hooks for users to try in the hooks.js.

Let me know if you have other ideas on how to improve.

andrew-j-roberts commented 4 years ago

Wow man you work quick — I read through your comments and I certainly think they help explain and demystify the data flow in Elder.js, which is where it shines. I'll be sure to let you know on here or Twitter if I have any feedback or ideas.