1. 3

    I’ve thought about opt-in analytics before: I’d like to have analytics on my site, but I don’t want to track my visitors without consent or give their data to third parties. The solution might be a please track my visit button.

    Is this not exactly what the Do Not Track header is for? It can also be checked with a Javascript attribute.

    1. 2

      That’s a very good question. It never crossed my mind.

      I’d think that most people would oppose tracking them if they knew what it is, so the absence of DNT might rather mean ignorance than opting in to tracking.

      But I will certainly think about this. Thanks!

      EDIT: Looking at the spec, DNT: 0 indeed indicates that the user has opted in to tracking (while the absence means nothing). I’ll probably see if any visitors have that turned on later. :)

    1. 4

      I expected this <opt-in-script> tag to be defined as a custom element but it’s just ignored by the browser and rendered as a p while there is some JS to turn it into a <script> tag on the button click. It’s actually a quite nice implementation that can be used for older browsers.

      1. 2

        Yeah. No need for anything fancy, the script is less than 500 bytes. IIRC unregistered custom tags used to cause issues in IE8. After that they’ve been handled as unstyled inline elements.

      1. 5

        Node / React / Nextjs if working with other devs.

        Clojure if working on my own (but not ClojureScript).

        1. 2

          Not cljs because you will not want to have any js? Or is there some other reason to avoid it?

          1. 3

            Haven’t had a great experience with the tooling. IME it was slow to build, unreliable reloads, and had complex build configs. Maybe need to give it another try since it’s been a few years though. I might have become spoiled by create-react-app too.

            Edit: also the JS community is a many orders of magnitude larger. If I need any lib I’m pretty sure it exists. The same isn’t true for cljs. I realize I can consume plain js from cljs but I don’t remember that being very fun either.

            1. 3

              Shadow-cljs is great (for working with npm packages and otherwise), but granted, the tooling has its rough edges. In my experience cljs is much better suited for React than es6.

              The small community is also a blessing at times: package maintainers tend to be passionate and eager to help. I attribute that to not having to cater for the masses as with more mainstream languages.

              1. 2

                Interesting. I have been thinking about converting my ES/React dashboard frontend for https://yetibot.com to cljs. Maybe time to give it another shot :)

          2. 2

            @dancek I am a bit torn tbh. I love the lang and agree sharing would be great. Up till now I haven’t had to do much client side on clj projects though so it didn’t matter.

            Are you using one of the React wrappers for cljs or do you consume it directly?

            1. 3

              We’re using reagent as the React wrapper, and re-frame for state management. Re-frame is similar to redux but has a better philosophy for some things. There are others but I have no experience with them; I imagine there have been some new ideas.

              If you happen to try the cljc approach I really recommend reitit for routing, both in the backend and frontend. We share the backend route tree with frontend and have spec-based validation in all http endpoints. Those are really awesome features compared to any other web technology I’ve tried.

              1. 1

                Cool. I’ve wanted to try that stack. When I last did cljs we used om.next which was very unfun, to say the least.

                Do you do any server side rendering with shared code (what they sometimes call isomorphic) or is it all on the client?

                1. 2

                  No, all the react runs in browser. We do generate a couple of html pages on server side with some hiccup renderer, I forget which one. The app is only for logged in users so we don’t need to consider crawlers.

                  1. 1

                    Got it. Seems reasonable. One thing I love about Nextjs is SSR everywhere, whether you need it or not.

          1. 1

            So, a candidate asks about what the current tech debt is, and they answer with a story of what the debt used to be? Smells a bit fishy…

            1. 2

              How do you answer that in practice, though? They were quite open about the current architecture in the article. If they don’t know of any major issues, only time will tell what the current technical debt is.

              Unless you mean an answer along the lines of “this code was written in the style popular in 2012 and the dependencies are old versions”.