This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-02
Channels
- # announcements (2)
- # beginners (32)
- # boot (10)
- # calva (81)
- # cider (39)
- # clojure (56)
- # clojure-europe (8)
- # clojure-italy (7)
- # clojure-new-zealand (1)
- # clojure-nl (8)
- # clojure-poland (1)
- # clojure-spec (12)
- # clojure-uk (38)
- # clojurescript (5)
- # community-development (1)
- # core-async (55)
- # cursive (3)
- # datomic (44)
- # dirac (15)
- # emacs (20)
- # events (1)
- # fulcro (57)
- # hyperfiddle (2)
- # jobs (9)
- # juxt (9)
- # kaocha (1)
- # lein-figwheel (1)
- # off-topic (93)
- # pathom (2)
- # pedestal (3)
- # planck (3)
- # reitit (15)
- # ring (10)
- # shadow-cljs (25)
- # spacemacs (7)
- # sql (19)
- # tools-deps (8)
hello, everyone, I'm here for my weekly blind rage at React.js for not supporting custom synthetic events! why oh why must clojurescript use react.
oh, you want to use webcompponents that emit cusom events to compose pages? nope! sorry, react.js doesn't do synthetic events. oh! you want to do server side rendering by responding to turbolinks events to increase your SEO and make a lower friction path to migrating from vanilla JS? nope! sorry, React.js has not officially sanctioned that source of events, and new things scare us!
But, I didn’t know they didn’t support synthetic events. I’ve only used synthetic events once or twice, but never in a React context.
yeah, i mean thats the thing. React is good for doing what javascript has done for the last 5 years better. But because it doesn't allow for synthetic events, its totally missing out on what javascript can do now. because react is no longer the only player in the game that has figured out how to do web programming correctly
its like, blockchain events, turbolinks serverside rendering events, webcomponent events, appsync websocket events....
all things that can basically totally flip web programming on its head, and react.js just wont hear it
whereas Vue.js is just like "yeah man, chill chill chill. you throw whatever at us and we'll make it work"
Well, there are two reasons. the first one is probably something that unless you've experienced it, it probably wont sound right - the cljs community is protective of react. all the github issues and discussions in the channels are like "the cljs community has settled on react and were going to move forward from there" which makes sense from a pure time management perspective..
the second one, related to the first, is that all the good frameworks are based on react
in fact, I think react is considerably more of a framework, honestly. cljs has just wrapped it in such a way that it is useable as a render library
minor nitpick here: ClojureScript didn't choose React, in a way that it chose Google Closure. The ClojureScript community did seem to choose React, but that can be changed by anyone, by advocating other view libraries, by writing, using and/or maintaining libraries that choose something else, Vue, Lit-Element, you name it.
Perhaps even by starting threads to generate conversation around the topic in clojurians 😉
@idiomancy are you having issues using the custom webcomponent events / turbolinks events in general, or you wish you could use React’s event system to handle them?
yeah. the problem is that React added some additional layers on top (their own “Synthetic event” system) of the DOM events to account for browser differences
for custom events, you have to do some raw DOM stuff. but at least you only have to do it once in a wrapper component
hmm, I don't supposed you have a gist of that process do you? If you dont off hand, I can do the googling myself :D
I don’t, just going off of https://reactjs.org/docs/web-components.html
for turbolinks, I bet there is already an example, even a lib out there for interop with React
What are people using to test/monitor front-end performance? I want to capture/log (with high cardinality, if possible, a-la Honeycomb) how long do network requests take, how long do React renders take etc.
Check out http://logrocket.com. One of a spectrum of similar products
If you're already using Honeycomb -- https://docs.honeycomb.io/getting-data-in/javascript/browser-js/
I've just started playing with Honeycomb myself (but not yet in Clojure). Also wanted to ensure you've seen https://github.com/conormcd/clj-honeycomb. I'd love to hear about your experience with the product, especially relative to the alternatives -- I mostly have experience only with Datadog
Since getting frontend data into Honeycomb requires rolling a bunch of stuff yourself, you may also consider this https://github.com/elastic/apm-agent-rum-js (or just using pieces of it if they're helpful). I haven't found any other free/open-source JS agents (I haven't yet done any of the above, but it's the plan 🙂)
I found etaoin very nice, not the full package, but makes it easy to wirte code that integrates with the browser.
Does anyone have any good resources on Git best-practices? Branch management, commit squashing, merge / rebase. Things to bring me up to date with the current thinking of how to best use Git as part of a team, with issue tracking etc.
Git flow helps establish a pretty repeatable well understood pattern for collaborative git use @mattmorten
This looks like a great place to start. Thank you!
@mattmorten gitflow has come under a lot of criticism, I recommend https://hackernoon.com/how-the-creators-of-git-do-branches-e6fcc57270fb as a good read
thats really cool! I end up with inter-dependent branches more than I like to admit, and I don’t seem to have a proper strategy to build a (new) feature on two different already-existing-but-not-yet-merged feature
You can start with a merge of those two. But your getting a lot of merge commits that way. I really would like to work a lot more with rebase, with everybody in it's own fork when you need to cooperate.
yeah, at work we squash-merge, that keeps the commit log on staging clean, but makes it quite difficult finding where a change originated from. E.g. “this fairly large feature branch”.
I don't agree with squash merge, because a commit history on a branch can be curated to tell a story. That's what I do.
I think we agree, I prefer ordinary merging as long as the commit log doesnt become wip
…
although I feel a bit offended by GHs tendency to show force pushes nowadays :’)
That way I get the clean high level view of the project history, but I can dig into a branch if I need a fine-grained look at a particular feature.
This also allows me to merge master into a feature branch to resolve merge commits ahead of time, without risking gnarly destruction of the commit delta.
Which, of course, as I start reading the linked article I see that’s mentioned :man-facepalming::skin-tone-2:
The thing that I find most hard to deal with is having features 1.1
and 1.2
not merged (because waiting on a review), and then trying to work on 2.1
which depends on both 1.1
and 1.2
I can rebase 2.1
on top of 1.1
, but then I don’t have 1.2
, or vice versa
I can maintain an integration branch with both 1.1
and 1.2
, and base 2.1
on top of that, but then my diffs in GH are all messed up
What about creating 2.1
from the parent of 1.1
and 1.2
, then merging them both into 2.1
?
So long as you don’t rebase 1.1 or 1.2, you can merge any updates to them into 2.1 just fine
right, and if 1.1 and 1.2 get merged… wouldn’t you get like unneeded merge commits from 1.1 and 1.2 on the 2.1 branch that “contaminate” your history?
The only time I’ve experienced “commit contamination” was when someone took one branch and tried to turn it into multiple branches, rebasing and cherry-picking commits that were almost exactly the same but not quite.
This made it exceedingly difficult to understand which commits were “the right ones”, since they had almost-but-not-quite the same content.
I personally like merge commits, especially when they’re subject is more informative than “merging foo into bar”. Ideally, the merge commit will encapsulate why you’re merging. So at the beginning of a branch, it might be to say which work you’re basing off off. At the end of a branch, the merge commit between your topic and master/prod branch contains all of the information about what the topic branch does, and why you built that functionality.
git log —first-parent, then, will only show these high-level commits, allowing you to gloss over the implementation details until you need them
This helps with the day to day work, and also keeps potentially important information around if you ever have to dig into the nitty gritty of how/why particular pieces of code came about
yeah — I am dragging this on, I find it very interesting tho, because now that I am actually developing full time (a year and a half out of university) I am stumbling upon this branch-dependency issue more often
I'll likely be doing a deep evaluation tomorrow, so I'll try and remember to report back
yes please!
It seems that git is smart enough to handle rebased branches as long as you merge other features with the --no-ff branch. When I didn't have a merge commit, git couldn't handle that.
# gitworkflow test
Attempts at documenting what happens when X happens.
## Setup
* `mkdir github`
* `cd github`
* `git init`
* `git commit --allow-empty -m 'Root commit'`
* `cd ../`
* `git clone github dmc`
* `git clone github mal`
## Scenario 1
What happens if you "depend" on a feature branch which is later rebased.
Steps to repro:
* cd `dmc`
* `git checkout -b featureA`
* `echo foo >> file && git add file && git commit -m 'wip: update file'`
* `echo bar >> file && git add file && git commit -m 'update file'`
* `git checkout -b featureB master`
* `git merge --no-ff featureA`
* `echo 'BBBB' >> file && git add file && git commit -m 'featureB'`
* `git checkout featureA`
* `git rebase -i HEAD~2` (fixup into the wip commit)
* `git checkout master`
* `git merge --no-ff featureA`
Actions:
* `git merge --no-ff featureB` => Success!
Reading through man gitworkflow
seems to suggest you should never do a rebase on a branch which has downstream dependencies.
Once a branch is on next
, you must fix it with incremental patches, apparently 🙂
oh cool, so as long as you always have merge commits (also if it could have been fast forwarded), rebasing on a topic branch that depends on another topic branch is not an issue
I have come to decision today. To use Clojure 100%
welcome! :)
I think the culture is more experienced in computer science
on the other side, we got today a bit of a sad news...our R&D department is doing things in a too weird way (Clojure? Event Sourcing? What's that)
I guess there are both sides of the coin to niche ... sometimes for some management it just does not click
We are going to have something for charts, and need them in the front end the back-end. Might want to push Clojure for it.. It's really Java heavy though and they are al scared of things like GraphQL and event sourcing.. And that are just the developers, the architects haven't even heard about those things, well at least not about Clojure..
I found developers here don't get this - in my case I am part of the Architect team 😄
In that case you can just tell them to use those right? Maybe help them a little with a poc? We are working together to plan the next steps. But with both the other developers and the architects being rather stuck on 'proven' technology I don't have high hopes.
oh man that's so true, we have a fully fledged MVP done here (no POC anymore, already done that) and still people don't "trust" us...oh well I am venting out now 😉