Coder Social home page Coder Social logo

Comments (22)

mike-thompson-day8 avatar mike-thompson-day8 commented on August 17, 2024

@dparis That's excellent, thanks. I have no experience writing lein templates so this is welcome news.

But I do have a request (which is a pain, I'm sure). Could it be based on the todomvc example currently in develop? That example splits handlers and subscriptions into different files, etc.

https://github.com/Day8/re-frame/tree/develop/examples/todomvc

I'm imagining that most of the code can be removed to leave a shell.

I'm planning on releasing v0.2.0 within the next couple of days and this template would be icing on the cake whenever it arrives. On the other hand, I would certainly understand if this was unwanted additional work and you weren't up for it.

Regarding ownership, I'm very happy with either option, although probably happier for you to get the credit and simply link to it from re-frame docs.

from re-frame.

dparis avatar dparis commented on August 17, 2024

Yeah, that's no problem. In fact, I can offer one better, if you like: if there's a generic reference implementation you'd like to collaborate on that only includes base functionality (no todo app logic, no simple example logic, etc) once v0.2.0 comes out, I'd be happy to work on that with you.

The timing might work better for me in that case as well. I just finished two days of jury service and I need to catch up on my day-job work. I'll hold off on changing anything until I've caught up and you've released the next version. At that point we can touch base and make the template better, if you're up for it.

from re-frame.

mike-thompson-day8 avatar mike-thompson-day8 commented on August 17, 2024

@dparis if you are still up for it, we're now right to go on the lien template, I think. I'd like to use TodoMVC as the exemplar. See examples/todomvc. How should we do this?

from re-frame.

dparis avatar dparis commented on August 17, 2024

Ideally I was thinking something like https://github.com/reagent-project/reagent-template but which also sets up a barebones skeleton for the re-flow pattern within the template. Personally I think it would get tedious to have to go through and delete some example code from the emitted project code each time. As such, I didn't intend to include any functionality (todo app, or hello world type stuff, etc) in the final version, just some placeholder comments or function stubs, that sort of thing.

I'd be happy to base the template off the structure from the TodoMVC example, though, and maybe we could include an optional template parameter to have it generate the TodoMVC logic in the emitted project. That seem like the right approach?

As for ownership, I appreciate the sentiment. 😄 However, I'm not sure how much time I'll have to maintain the repo, and I wouldn't want a lack of maintenance to imply that the re-frame project itself is being neglected. Because of how lein automatically picks up templates from clojars, people won't see the dparis part of the repo when using it, just the lein new re-frame-template, and might reasonably assume it's an "official" part of the re-frame project. I'd still be happy to be a primary contributor to the project, but it might make more sense for you to hold stewardship over it in case I'm ever unable to keep working on it.

from re-frame.

gadfly361 avatar gadfly361 commented on August 17, 2024

Just as an aside, @mike-thompson-day8 check out this repo. Basically, it creates a lein-template automatically from a normal application and allows you to name the outputted template whatever you want.

The only catch is, when you name the template, it will do a global replace all for the original name (including in README, etc.) of the application and replace it with the new template name. So the following would probably work for you:

  1. $ lein new awesome-template
  2. Set up the template however you want it to look.
  3. $ lein create-template re-frame
  4. $ lein install and then push to clojars
  5. Now, everyone can enjoy the awesome template with $ lein new re-frame <name of app>

from re-frame.

mike-thompson-day8 avatar mike-thompson-day8 commented on August 17, 2024

@gadfly361 Thanks! that looks interesting. Have you used it successfully?

@dparis yes, I was imagining all the code stripped out of TodoMVC. I wanted to use it as a base because it had the right structure (files wise).
I'm happy to assume stewardship responsibility whenever you feel it is the right time.

from re-frame.

gadfly361 avatar gadfly361 commented on August 17, 2024

@mike-thompson-day8 Yup, works great :)

from re-frame.

dparis avatar dparis commented on August 17, 2024

@mike-thompson-day8 Sorry, got swamped a bit at work. Should hopefully have some time to get to this over the weekend.

@gadfly361 Cool tool! I'll have to check that out.

from re-frame.

dparis avatar dparis commented on August 17, 2024

Working on this right now, should hopefully have something later this afternoon.

FWIW, I'll be using the todomvc structure within a clean reagent-template project install as the template. This will provide both a clean base for re-frame template using todomvc's correct re-frame app structure as well as a turn-key installation of clj/cljs with client-side testing, figwheel for live-updates in the browser, and the ability to bundle a lein-ring standalone jar/war server.

from re-frame.

dparis avatar dparis commented on August 17, 2024

Alright, I've got a new branch up with my changes so far: https://github.com/dparis/re-frame-template/tree/update-re-frame-structure

@mike-thompson-day8 I've tried to leave in the stubs I thought were appropriate, and removed the rest of the todomvc logic. Everything seems to work great in my (admittedly minimal) initial testing. If you want to try it out, clone my repo and, from within the repo root, run lein new re-frame <project_name>. This will create emit a new re-frame project in the current directory, and it should behave similarly to a reagent-template project.

One minor gotcha is that the emitted init logic renders the project.views/project-app function, which by default is just some static markup. Since figwheel is not set up to re-init the app on code changes, attempting to change the value returned by project-app can give the false impression that the figwheel live reloading doesn't work.

You can work around this by setting up the template to initially render a wrapper div which contains a reactive element, at which point changing the content of that element will, well, cause the page to react. This is similar to what reagent-template does by default. However, it's not core to the structure required by re-frame, and might be undesirable as a default, so I deferred to the logic used by todomvc.

If there's anything you like to see added or changed, let me know.

from re-frame.

mike-thompson-day8 avatar mike-thompson-day8 commented on August 17, 2024

Sorry, I just realised I dropped the ball on this. Will have a look tomorrow.

from re-frame.

mike-thompson-day8 avatar mike-thompson-day8 commented on August 17, 2024

WIP happening here: https://github.com/Day8/re-frame-template/tree/update-re-frame-structure

I've written stuff, but not tested. Will generate a PR once I actually try to compile it. Will be another day.

from re-frame.

mike-thompson-day8 avatar mike-thompson-day8 commented on August 17, 2024

Latest: day8/re-frame-template#3

from re-frame.

dparis avatar dparis commented on August 17, 2024

Merged, thanks for the PR. I've opened a new PR which includes all of the changes so far to be merged into master: day8/re-frame-template#4

Let me know if there's anything else you'd like to see changed before that happens. Once that PR is out of the way, it might be a good time to hand off the project if you're willing, my March/April is starting to look pretty busy.

from re-frame.

yatesco avatar yatesco commented on August 17, 2024

Can I ask what the current recommended approach for getting started with re-agent is?

from re-frame.

mike-thompson-day8 avatar mike-thompson-day8 commented on August 17, 2024

@dparis As far as I can tell, this is completed. You just need to accept your own pull request, and announce. Is there anything else I can help with?

from re-frame.

dparis avatar dparis commented on August 17, 2024

@mike-thompson-day8 Sorry for the delay! I'll have some time intermittently this week to work on transferring the repo before I'll be travelling.

As far as I can tell, I can just use the GH repo transfer to hand the entire GH project (repo, issues, etc) over to you. Will that work for you? Is there anything you'd like to see completed before I do so?

from re-frame.

mike-thompson-day8 avatar mike-thompson-day8 commented on August 17, 2024

@dparis when you get a chance, I'm more than happy to take this over. And, yes, repo transfer seems like the way. Seems pretty much there as is. More instructions in the README maybe? Anyway, thanks for pushing it this far!

from re-frame.

dparis avatar dparis commented on August 17, 2024

I'll be in airports all day today, so I'll probably get to it tomorrow.
Great work on re-com, by the way, made use of it to knock out a quick ui
for a demo we gave yesterday. 😄

On Wed, Apr 15, 2015, 10:49 mike-thompson-day8 [email protected]
wrote:

@dparis https://github.com/dparis when you get a chance, I'm more than
happy to take this over. And, yes, repo transfer seems like the way. Seems
pretty much there as is. More instructions in the README maybe? Anyway,
thanks for pushing it this far!


Reply to this email directly or view it on GitHub
#15 (comment).

from re-frame.

mike-thompson-day8 avatar mike-thompson-day8 commented on August 17, 2024

Good to hear that re-com worked for you!!

We're aware that re-com has a smaller audience than re-frame (until this time next year when suddenly re-com will come into its own, I think). Perversely re-com has involved MUCH more work. So it is nice to hear of early success.

from re-frame.

mike-thompson-day8 avatar mike-thompson-day8 commented on August 17, 2024

@dparis Thanks for the transfer!! It now lives here: https://github.com/Day8/re-frame-template.

from re-frame.

dparis avatar dparis commented on August 17, 2024

You're welcome! Hope it is, and remains, useful. I'll be watching re-frame and the template, and I'll try to contribute when I can. Let me know if you need anything else. Cheers!

from re-frame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.