Fork me on GitHub
#pedestal
<
2017-03-20
>
deg21:03:16

Awfully quiet today. 🙂 In the template .edn file, is it intentional that :db.install/_attribute :db.part/db is used in the example of a norm? I understand from the docs that this is no longer needed.

mtnygard21:03:53

That change in Datomic came more recently than the samples.

mtnygard21:03:12

The samples can be updated as long as we add a note about the minimum revision of Datomic supported.

deg21:03:47

Is the minimum version documented somewhere? I'm happy to add in this kind of thing as I'm learning/proofreading, but I've not yet found enough reference docs. The Vase docs still seem to be strongly example driven.

mtnygard21:03:14

Right now there isn't a minimum. You could use Vase on any release of Datomic ever.

deg21:03:19

Still, seems wrong to have the :db.install stuff in a beginner's doc. In trying to understand the .edn file, I had to browse through much too much of the Datomic Schema docs in order to just learn that I didn't need to pay attention to that line. 😞 (I had tried an exercise of rewriting the complex norm as a simple one, to ensure that I understood it completely. This line was a sticking point. FWIW, so was :unique vs :identity; also only answered by reading through the datomic docs)

mtnygard21:03:54

I think what we need to do is make two docs.

mtnygard21:03:20

"your_first_api.md" today is really meant to be "your first Vase API" for someone who already knows Pedestal and Datomic, but wants to learn Vase.

mtnygard21:03:36

I think you're aiming at something more like the Pedestal getting started guides.

deg21:03:21

That sounds right to me. Also, two .edn files. (See my #2 comment yesterday, about the awkwardness of being instructed to shorten a sample file)

mtnygard21:03:59

Not just two files. Two different directories.

mtnygard21:03:25

The minimum necessary for a Vase app is quite small. The template generates a more full-features, production-ready app... but that's not helpful to learn from.

deg21:03:20

Yup. I was blown away (in a very positive sense) by how little code was in my lein new vase foo.

deg21:03:37

It would make a lot of sense to have two templates.

mtnygard21:03:42

It's still more than I'd like. 😉

deg21:03:34

That's a great goal. As a newbie, I've found that one of the weaknesses in the Clojure client/server ecosystem is that it is evolving so quickly and so much knowledge is embedded in the codes generated by templates, that it is very hard to upgrade a project to take advantage of the changing landscape.

mtnygard21:03:07

I agree. It's not just frustrating for a newbie. Way too much capability is tied up in templates and build tool plugins.

deg21:03:17

I know I'm going to hit a learning curve in a few days when I try to introduce the client code into my toy Vase project.

mtnygard21:03:17

Do you mean front-end ClojureScript? Or do you mean call-outs to other services?

deg21:03:49

Until now, I've used the framework-like templates that put all the pieces together -- paying the price of manually upgrading each time the landscape improves -- so I don't really know how to hand-code all the goodness of figwheel + cider + production builds + etc. and Vase doesn't have this all rolled together. (for better and worse)

deg21:03:04

Front-end Clojurescript. I like the idea that Vase is client-agnostic; it's certainly the right way to go. But, I write my clients in CLJS, and it is very convenient having both sides started by the same template framework. I don't know the right answer.

mtnygard21:03:11

One thing I'd suggest is this: keep the client app and the Vase service separate. As in, different directories, different project.clj files.

mtnygard21:03:32

There's no need for them to occupy the same project and it just makes everything harder to configure and build.

mtnygard21:03:51

So for the front end, feel free to use a figwheel template app. It'll work just fine with Vase services.

mtnygard21:03:05

They just meet at the URLs.

mtnygard21:03:26

Once you get a ways down the road, consider creating a third directory, with .cljc files that describe the specs for your data interface.

mtnygard21:03:33

Then include that from both front and back end.

mtnygard21:03:58

There's a lot of power in creating a metadata driven contract between components.

deg21:03:08

Is there a standalone figwheel template? That does sound much more right. My last project was Luminus-based. It was very easy to get started, but I still have no friggin' clue what's going on in the project.clj.

mtnygard21:03:31

Yep. lein new figwheel hello-world

deg21:03:23

Thx. I'll take a look at that soon. I definitely like the idea of separate, understandable, projects.