Hacker Newsnew | past | comments | ask | show | jobs | submit | straws's commentslogin

Would also recommend https://types.kitlangton.com/ as a companion — sometimes many examples can illustrate the point more succinctly than text.

Both ProseMirror and the newer version of CodeMirror have a pretty elegant solution to this: each modification to the document is modeled as a step that keeps track of indices instead of node/text identities, and uses a data structure called a "position map" that the buffered steps can be mapped through to create steps with updated positions, which are then applied to your document.

In practice, it works quite well. Here's more info:

https://marijnhaverbeke.nl/blog/collaborative-editing.html https://marijnhaverbeke.nl/blog/collaborative-editing-cm.htm...


Github's https://primer.style/product/getting-started/ does a good job of making a cohesive design language that works just as well for server-rendering Ruby views and "upgrading" parts of the ui to React views when you need more interactivity. That's a constraint that I wish more of the Rails ecosystem design tooling would attempt to solve for.


You're not alone. There's been an effort to transparently update the UI to a React implementation over the past year or two, and while I understand the benefits to that approach, they have introduced some flakiness in moving away from a the server-rendered pjax/html-pipeline/simple web components approach that was so cohesive and battle tested over the decade before it.


The convention on desktop and mobile is not to have a submission at all. If you click one of these "mercury" buttons, you can always have up-to-date state.

Forms and submissions are mostly a web convention. I too think that's more natural, but there are a lot of existing contexts like settings where the expectation is that making the selection doesn't require an explicit "save" step.


That's a bad excuse. There are plenty of widgets that need to deal with illegal states in an auto-saving form. For example, every text input that expects a numeric value needs to allow an empty string.

If you don't want to deal with validation logic in your app, you could just disable the last checkbox.


I like your last point.

Also in practice this state does not happen in “apps”. Before the user reaches the screen, you must have set a default. If you have default, then “deselect all” will eventually revert to that default.


I'm not very excited about the product itself, but if you are at all interested in spatial computing, it's worth reading through Apple's design and developer resources:

Designing for visionOS - https://developer.apple.com/design/human-interface-guideline...

Inputs: Eyes - https://developer.apple.com/design/human-interface-guideline...

Principles of spatial design - https://developer.apple.com/videos/play/wwdc2023/10072/

Create accessible spatial experiences - https://developer.apple.com/videos/play/wwdc2023/10034/

While I don't think there will be a mass adoption by people willing to put on goggles throughout the day, it's clear that a lot of Apple's ecosystem is being directed toward environmental and situational computing, and the SDK backs that up. Using gaze detection to focus on more than one device in a room, surfacing certain interactions in specific rooms, and low-lag screen mirroring from devices are all pretty high-cost investments that are likely to find uses in other products. I look forward to what kinds of "continuity" type features this tech introduces.


If you have one of the newer magsafe iPhones, you can attach one of these to the wall (front camera) or the back of your monitor (back cameras):

https://www.shopmoment.com/products/wall-mount-for-magsafe/s...


33 years, if you go by the patent. Lots more fun facts in Tim Hunkin's excellent Secret Life of Machines:

https://www.exploratorium.edu/ronh/SLOM/0301-The_FAX_Machine...


Tim Hunkin is recently making new videos!

https://www.youtube.com/c/timhunkin1


For instance, with Diagram Maker, application developers can enhance the experience for end customers by enabling them to intuitively and visually build cloud resources required by cloud services such as Workflow Engines (AWS Step Functions) or Infrastructure as Code (AWS CloudFormation) to get the relationships and hierarchies working.

Does this mean that Step Functions and CloudFormation will adopt this library? Both already have similar visualizations.


A number of years ago, I worked on a team (~20 engineers in total) that successfully carved off two relatively independent portions of a large Rails app using engines. I'm happy to see that Shopify is also using that strategy.

I'm curious to know more what sorts of challenges they have around managing dependencies across engines — I think what we were doing was fairly vanilla Rails, and we didn't have the opportunity to run into those sorts of issues.


The answer to that question could probably fill another blog post :D

Long story short, Rails and dependency inversion equals lots of friction. The whole framework is built on the assumption that it's OK to access everything from everywhere, and over the years we've built lots of tooling on top of those assumptions.

E.g. we heavily use https://github.com/Shopify/identity_cache with active record associations that cross component boundaries.

We also have a GraphQL implementation that is pretty closely coupled to the active record layer and _really_ wants to reach into all the components directly.

All of those problems can be overcome, but this is definitely an area where we have to working against "established" Rails culture, and our own assumptions from the past.


I hope to hear more in the future!

Do you envision any extension points to the way engines are implemented that could better enforce boundaries? In our engines, there was nothing that referenced another engine's resources, leaving the main application to handle route mapping and ActiveRecord associations between app models and engine's models.

I feel like the use-case for engines has long been around supporting framework like functionality (Devise, Spree, etc), but I wonder if there are changes to be made that better support modularization for large apps.


> extension points to the way engines are implemented that could better enforce boundaries

Can you expand on that? I'm not sure I follow.


What's the difference between "componentization+engines" and microservices?

From a deployment perspective are your engines deployed and scaled independently?


components are

- same database - same runtime - same deployment - same repository

That said, I don't think this is an either/or. It's a spectrum. you can have components within the same runtime and repository that have separate databases, or components that are using the same database but live in separate repos, etc.

From one monolithic app towards fully separated microservices is a spectrum, and I think developers should be enabled to move freely around that spectrum.


I think components are the better option. Because it allows for separation of concerns without introducing deployment ...or worse : political complexity.

I call them Micro-SDKs.


I worked on a large Rails monolith a few years back with a similarly-sized team and we took the "components+engines" approach too.... and it was a bit of a nightmare, honestly. It sort of felt like the worst of both worlds, relative to monoliths or microservices.

I strongly suspect, but cannot prove, that we would have been better off simply transitioning to "macroservices" -- breaking the monolith up into several (as opposed to dozens) of reasonably sized pieces.

• We were encouraged to componitize everything. When I left, we were up to a few dozen components, and the number was climbing rapidly. I'm not sure if the approach itself was the problem, or if the flux during the transition period was the real pain point.

• We had no real enforcement of interfaces between components. It was so easy to break things in other peoples' components.

• Theoretically that breakage would be caught by tests. But to catch that breakage, you needed to run the complete test suite (30-60 minutes) rather than simply testing your own component

• Essentially, it felt like we were suffering all the disadvantages of microservices, with the exception of coordinating deployments; from a devops perspective it was still just a single monolithic deployment

• We still had many of the problems associated with monoliths, such as slow deployments, long test suite times, and extremely high per-instance RAM usage

• Various small tooling and debugging issues related to using Rails but going too far "off the Rails"

I'm looking forward to digging into the linked article and learning how Shopify solved those issues. They seem to have quite a bit of engineering firepower at their disposal. Our management did not allow us to dedicate a lot of resources to internal engineering concerns like this.

(We essentially had one guy figuring it all out himself, and due to internal politics he was forbidden from considering a microservices or "macro services / multiple monoliths" approach. He was talented and did the best he could, considering)


> When I left, we were up to a few dozen components, and the number was climbing rapidly.

I should have included this in the blog post: The number of components _needs_ to be kept small. Shopify's main monolith is 2.8 million lines of code in 37 components, and I'd actually like to get that number _down_.

I like to compare this to the main navigation that we present to our merchants. It's useful if it has 8 entries. It's not useful if it has 400.

In a way, components are the main navigation to our code base. A developer should be able to look at what's in our "components" folder and get a general impression of what the system's capabilities are.


That's an excellent (and hard-earned, I'm sure!) insight. Thank you.

    I like to compare this to the main navigation that we 
    present to our merchants. It's useful if it has 8 
    entries. It's not useful if it has 400.
Yeah, we essentially wound up with a "junk drawer" of components. I could see a lot of companies, like ours, making that mistake -- turning all the things into components.

As you said in the article, one of the benefits of components for you was that it truly forced you to think about a proper separation of concerns. In hindsight, that's an area where we really missed the mark for a variety of reasons, some methodology-related.

We practiced a rather strict version of Scrum. Management paid a lot of attention to our velocity from week to week: we needed to rack up those story points.

But, outside of the tiny team dedicated to the component effort, there were no story points to be had for supporting that effort. Therefore we were in fact incentivized not to support it. I remember one sprint where I did some refactoring work in order to achieve a better separation of concerns. It negatively affected our velocity for the week and that was noticed.

So, we were receiving a schizophrenic message from management. We were all to support the component effort.... but on our own time, apparently?


This is tangental, but I want applaud the mindset that produces the phrase "the opportunity to run into those sorts of issues".


I meant it more as a testament to how far you can get with a Rails app before needing to consider using the power tools :^)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: