New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why are interactions and custom elements global? #128
Comments
Hi, nice that you like it.
The contract in Cycle should be that selectors are not queried globally because they shouldn't inspect inside a custom element. It also doesn't select from the window as a parent, it selects scoped to the
There is a reason why events are not handled in the "view". View should only be concerned with rendering, i.e. how things look. Event handling is how it works. Read more here. On the other hand, after #116 is ready, it will be possible to make a React adapter which works like you want. But I recommend first thinking why do you say something is impractical, and why is the other way better. For instance inline styles are often seen as a bad idea, but vjeux explained to the community that sometimes such as in the Virtual DOM case it might make more sense, and might be better.
This will change with #116, custom elements will not be registered globally with a mutable API, but they still will be specified at the top-most level, and given down through the view hierarchy. If you think it is inferior, please explain why. And again, with #116 it will be possible to have a React adapter and do this the way you want. |
I wonder how do they propose to style nested tags with this "inline styles" approach? Anyone knows? CSS works how it does (everything is global) because it allows you to traverse into component and change it's inner styles from your app stylesheet. |
You can give styles as props, for instance. |
That's the thing. Your only way to style nested tag without global CSS is to implement an extremely clunky namespacing solution on your own. I doubt anyone will succeed here for anything bigger than hello-div. Most web components (in broad terms) contains tenths of nested tags. <div class="clockworkOrange">
<div>
<div>
..
</div>
</div>
</div> Did I miss the moment restyling of 3-rd party components had become uneeded? I guess no. How to do this through props? In app: <ClockWorkOrange
firstDivFromTheTopStyle={firstDivFromTheTopStyle}
secondDivFromTheTopFourthSiblingStyle={secondDivFromTheTopFourthSiblingStyle}
...omg/> And in library: <div>
<div style={firstDivFromTheTopStyle}>
...
<div style={secondDivFromTheTopFourthSiblingStyle}>
...
</div>
</div>
<div/> This is still not gonna work for repeating items... 😞 Because React native does support only local styles? That's their limitation. Desktop limitation. Same thing with Webpack CSS "local scopes". They are worthless in practice. I dunno... maybe there are so many technologies today that people are just starting to loose the track of what they do. |
@ivan-kleshnin If you haven't found a way to make something work, it doesn't make it "worthless". People including me have built, and are building large apps that don't treat CSS globally and rely on props for everything. It works surprisingly well if you embrace the component mentality and create smaller components. In fact you'd rarely, if ever, need to pass explicit styles, and instead control most of the appearance via vanilla props. Encapsulation is a win, nothing clunky about it. For off the shelf components, if you need that custom rendering, a better idea is to let you provide renderItem method like fixed-data-table does. |
@gaearon so you just verified there is no other way except props 😞 I don't believe this is how the future should look like.
are just marketing words. In reality most of the people still use jQuery because it's the only way to have file loaders and other huge libraries available for them. Not every company has a budget and time to just stop everything and begin to reimplement every library they need in React. People use Angular not because it's better. Because it's more production ready and have all that matherial design libraries already developed and ready-to-use. "Small components" hype is the same thing as "small modules" hype.
Everyone will need that at some moment. That's the problem.
Web is about sharing and restyling. How many props would be enough for video player to
Of course it doesn't. That's why I'm asking people how to solve my problems. |
I'm not selling you anything and I don't care about hype. I'm sharing the experience I gained building a complex webapp with complex styles and UI in a team together with a designer in React. What I'm saying is, if you approach components as large templates, like people usually do Backbone views, you're going to have the problems you described above. If you make smaller components and use composition more, you'll find that the
It's a trick question. This is “smart and dumb components” all over again. “Video player”-like stock components made sense in jQuery land, but I don't think they make any sense in React land. With React, you probably want a On the other side of the spectrum are stock components whose only point is to provide style, not functionality. Think “Material design” components. For them, it doesn't make any sense to override the styles because the only reason you'd use them is for their consistent styling. So yes, “restyling” a component that tangles functionality and styling is hard. But that's a strawman because such components don't make sense in React. Create PS If you'd like to continue this argument, please create a Gist so we don't spam the Cycle issue tracker. |
Imagine that you are a developer and business tells you to integrate this shiny new video player they've just purchased into their site. They require you to be "pixel-perfect". That player is built from small components just as guru teach us. <VideoPlayer>
<VideoPlayerHeader>
...
</VideoPlayerHeader>
<VideoPlayerFooter>
...
</VideoPlayerFooter>
</VideoPlayer> And then you're starting to tweak it... <VideoPlayer margin={50} fontFamily="Roboto" lineHeight=...>
<VideoPlayerHeader pauseIconColorBackground="yellow"...>
...
</VideoPlayerHeader>
<VideoPlayerFooter ...>
...
</VideoPlayerFooter>
</VideoPlayer> I wish you good luck doing that. Don't you extrapolate your specific one-project experience to all cases of all people in the world? Did you use 3-rd party components? What were your styleguides? Did you fallback to global styles every time you met a problem I described and just considered that "edge-cases"? There is an enterprise world. Like Facebook where they may create everything they need. Even Immutable library instead of Mori. Because of infinite budget. Or take Google+ created just for fun. That's ok. There is also a world of a small and medium business. Which does have limitations. And that is ok again. Problems appear when people start to disguise a strictly enterprise solution for a "normal", "standard" or "definitely better".
What are Web Components then? They may be implemented in a "revealing" style for "better control". <Container><Item/></Container> vs <Component/> In any case, that does not provide a 1% of the flexibility you have with CSS stylesheets.
Are you talking about React or about your own vision of React?
I don't think this is a spam. This is important and is related to Cycle components to the same matter as to React. I want to receive more feedback from people about local styles. If you don't have arguments, that's normal. You can unsubscribe from this thread if you're bullet-proof in your opinion. |
I just feel the urge to mention, that I extremely appreciate to read the opinion of you both, @ivan-kleshnin and @gaearon. There is no need at all to attack of feel being attacked. It's all about solutions and many ways lead to rome. Actually I were thinking about on how to handle CSS best in Cycle these days. Thanks again for this discussion, it is interesting and related, so stay and keep it going right here ;) |
Styling third-party component with custom global CSS is an escape hatch. Escape hatches are cool for solving the problem you described (you are given a black box with bad API and you are ordered to use it). Another example of a similar escape hatch is monkeypatching. Nobody likes monkeypatching but it's essential for some use cases when you're given something that doesn't work exactly like you want, and offers no extension points. But this doesn't mean monkeypatching should be the primary means of extending something. Overriding third-party CSS is conceptually the same thing as monkeypatching. Suitable in some situations but you should try to avoid it if possible.
We had no styleguides. Our designer worked directly on the components. The styleguide was to use that component palette. This ensured consistency. Sometimes we used “pre-React” third-party components that had their own styling. Yes, we falled back to patching global styles for them, but wrapped them into React components that encapsulated this implementation detail and had a declarative API. The rest of the codebase would then use React components. When we had time, we'd reimplement these components in React. We never needed to use third-party React components with built-in styling. I never found them valuable. To have consistent styling, we needed to use our own component palette (that includes our
WCs don't solve my problems. I don't know.
This is an interesting argument, I'm just not sure if it matches what the thread was originally about. |
I see the Say I have a datepicker (which I really do, check out https://www.npmjs.com/package/react-date-picker). I will add both a autogenerated className and a component className. I illustract this with some code: :local(.picker)
//picker styles
.inner
//picker inner styles var ClassName = require('./index.styl')
var DatePicker = React.createClass({
render(){
var className="date-picker " + ClassName.picker
return <div className={className}>
<div className="inner">
//....
</div>
</div>
}
}) In this way, I am certain that my component styles are really isolated (since all my selectors are nested inside the autogenerated/prefixed one), and people can also customize whatever they want (since I also add the static "date-picker" class. I see this as a very good mix. What's your opinion. PS: I also use inline-styles quite a lot :) |
I think Pete is getting closer, but @ivan-kleshnin is right about the style issue with tags. This is a problem with inline style encapsulation. In my experience (writing a UI framework) I ended up having to "tag" all of my inner elements and have a syntax for people to style them, for example, say a <div {...props()}>
<h1 {...props('title')}>Title</h1>
</div> And then built a mixin of sorts that resolves these if you pass in a <Post styles={{ self: { background: 'black' }, title: { fontSize: 20 } }} /> Because even in small components you would lose this power. Now, given it's a UI kit it's on the extreme. But I think this is important. If I want to borrow any visual component from any npm library right now in React, unknown how I'll be able to style it... props, import CSS, some custom library. I think this is a big gap in React (it's supposed to be the View right?), and Pete's example actually illustrates it. Now, my hack is not great either. You have to explicitly use a method, it's inconsistent, and more. Now, this sounds off topic but is related: why are we using <post>
<title>Title</title>
</post> And have a standardized way for that to be styled. With small components you can easily have everything unique. If you need to use semantic tags like Just thoughts from experience and experiments in this area. |
I just can't see “styling” as something separate from “generating markup”. What's the point in being able to attach styles to a Thus
becomes
And the answer is: use the stock components that let you inject the rendering. No? |
I totally agree to using props as render/factory functions. It provides people with the flexibility they need to either change styling or bring in a totally new markup! |
The view layer should handle style. If it did that properly there would be no argument, I could use anyone's logic and markup, something made with love (and accessibility, browser support, etc) and still style every piece of it I need. If I want to use a really well designed Button and change one color or tweak the font size, I should be able to, no? |
A well-designed As for the font size or family, a well designed If particular styles are important to component (such as Finally, as the ultimate escape hatch, component may accept <SuperFlexibleVideoPlayer styles={{
pauseButton: { backgroundColor: 'yellow' },
container: { display: 'flex' },
...
}} /> |
I can see that point, though I see no downside in a component system that let you style any element inside a component you import. Only upsides, potentially pretty big just from personal experience. What if I want to add a inner shadow to the Button? Or round some of the edges based on where I put it? It seems there are a thousand little ways I may want to style it, and to make the authors have consider them all puts the burden in the wrong place. In other words, a let's make it really easy to have a well-designed Button. It should just get the logic right and the markup. If I like how it works I should be able to use it any way I like, without having to inspect if it's "well designed" enough for me to style it or not. Edit: (made some edits / added last paragraph after publishing) |
@ArnoBuschmann I just took a walk yesterday and was striked by the thought about local styles.
Yes. Pete Hunt is always aware how to make our lifes better. Even when against our wills.
I believe bad API is exactly what you're defending. Component API that exposes styling through attributes is bad. Global CSS is fundamental. I'll give you one example. There is a popular organizer service Trello.com. You can't even dream of turning off annoying icons in OSX or recoloring them unless Apple will be so kind to allow you to do it. And all this is possible thankfully to the global CSS. Another fundamental reason. Let's be fair, most of the 3-rd party components are broken to some degree. The are either mobile unfriendly or have some issues with older browsers. This approach of "hardcoding" styles and letting them go "encapsulated" is so overconfident...
@radubrehar If you expose class names that is a classic solution with global CSS. You leave the chance to fix your errors to us. The question is how to achieve the same effect with local styling only?
CSS has it's limitations, that's true, but it evolves. All that wrapping issues are mostly coming from the broken padding / margin calculations from the early ages of the web. From the broken box model before I mean... people created a great tool for us. CSS. It's still underestimated and unexplored in power.
You can have default styles now, thank gods to Webpack. This styles should be in a separate file. We're starting to mix two things here. There are TWO approaches I criticise: Local styling (you-don't-need-styles)This is Evil. I already put my arguments against. Zero styling & Zero markip (don't-provide-css-and-html-just-inject-render)This approach is ok for a lot of cases. But still. Time is money. I want to use Matherial Design. I want to have both behavior and styles available from the start. Because both are extremely hard to get right for all use-cases (which are growing). Demands are growing as well. And I also want to be able to tweak it and to be able to fix what is wrong about visual aspect. Because design is the most specific thing you have. You basically never repeat it. If all that are "corner cases" then the world is built from them. And I believe Future is about customization of everything. |
It's up to you as component author to decide on the granularity of the style overriding that you think makes sense for your component. Maybe the user will be satisfied with tweaking styles for particular DOM elements so you “tag” them and let user provide Or maybe you'll anticipate that the user wants to change a lot of stuff, so you export
The whole point of having a consistent UI is not to have a thousand ways to style the same thing. Of course creating arbitrarily styled components is not very convenient. But generally you'll want to have a single |
Exactly. If your site has a module size (line height) of 16px you do want to override every your component to look the same. Set correct font family. Repeat border radius. I have a good imagination and still can't imagine how to replicate all this through props. This approach works only if the web is built from granular, perfect, production ready, polished kits of elements. Nothing like I see around. There are a bunch of matherial design implementations. Bunch of Bootstrap-like clones. One of them has buttons you need. Other – dropdowns. |
I'm not idealistic. Do this in your “reset” stylesheet once for your whole website. (As well as setting the root font size.)
All your components may |
@gaearon seems like you are defending that there couldn't exist a better way to handle styles than there is in React? I think all @ivan-kleshnin (or at least I am) saying is there could be a better way and that would be something interesting to discuss. There are some 18 CSS-in-JS libraries for React now. Plus hundreds of others all doing things inconsistently. It's an area React doesn't handle, which is totally fine (it makes it very flexible). But Cycle could handle it in some way, and I would argue that could dramatically improve how people share components. |
These are three different approaches:
The first approach works best for products with an established brand and identity. (Can you imagine Facebook or Airbnb using stock visual components?) React's encapsulation model works great here. The second approach is as easy. If you build an internal dashboard, just use Bootstrap. No need for customization. Again, React's encapsulation model works great. The third approach is “I want to have my cake and eat it too”. CSS and global styles kinda solve this problem, but in return you get all the drawbacks of wanting to both reuse and extremely customize something. You have harder versioning, things breaking other things for no apparent reason, complex overrides, etc, but get what you want in return. It's a tradeoff you choose. All approaches are valid. There is no single “future”. Either you choose encapsulation (first two approaches), or you choose fragile flexibility (third approach). You can even mix them. Of course, I prefer the first approach, but I can see why people might choose the second or the third one. It's just wrong IMO to say “style encapsulation doesn't work!” because it's up to you to choose your tradeoffs. That's probably all I wanted to say in this thread. |
Ok, that's good. But what about people saying "forgot about global CSS"? I have already meet them.
Wait. A few posts ago you've said styles are excessive, props are enough. How to pass styles to some nested tag without some mad namespacing solutions, again? I believe everything is about fallbacks. @gaearon is right that sometimes CSS is not enough and you do want to replace HTML. But should we base our conclusions on special cases or on common cases. I believe common ones are better. I have nothing against replacing "render" functions if it's required. Ideal solution (I mean all of this should be at the same time):
What's wrong?
You forgot to put "rigid" adjective before "encapsulation" noun. |
No. I just don't see how this is a problem about styles, or about React. The way I see it, it is a problem about passing parameters in the functions, or letting functions read global variables instead for extra customization. |
That's because you're mixing visual and behavior paradigms. Visual is more variable in the orders of magnitude. That is like passing 100 arguments to each function. I bet you will choose globals than. |
I think working with a designer who found a way to create a few basic components with a few custom props that were used throughout the app really changed the way I see it. Customization may be great, but it's good to put a rigid facade in front of it so the rest of the app doesn't care. |
Default doesn't mean you can't override it. Default just means “exceptional cases look exceptional”. When you need a global style, do this explicitly. I think local-by-default is sane because it keeps everyone more aware of what is global, make globals visible in code reviews, so they are less dangerous and likely to bite. Whatever's default, people will use the most, and in most cases (not the styling-stock-component case which isn't very common in a large app compared to styling internal components), the locals are better. |
Thanks for responding.
I don't think this is reasonable in the context of web technologies. We operate on the DOM, not on pixels. The DOM has interactive behaviour intrinsically tied to its elements, whereas pixels do not. Working with existing component structures (e.g. React elements) is a reality for anyone who wants to make something based on real life requirements, as opposed to toy examples. If I use a 3rd party Grid component, and I need to respond to a cell selection, I want to use a high level event, which is part of the component's API. I cannot imagine trying to figure out a selector to reliably identify cells, and then somehow map click events back to the data they represent. Even if you can pull that off, bug-free, good luck maintaining it one year from now.
I haven't. I will watch it before making any more comments. |
Well, the documentation isn't clear on how to work with events. Let's say you have a grid component like this: <Grid onCellSelected={...} /> In the latest Cycle.js (not Cycle-React), you will subscribe events like this: function app({dom}) {
// '.jsevent-' is just a convention for the key of event mapping
var cellSelectedObservable$ = dom.get('.jsevent-grid', 'onCellSelected');
// ...
return {
dom: stateObservable$.map(state => <Grid className="jsevent-grid" />)
};
} So, you can use the high level event from the component, and it doesn't break as long as you don't change the element's className. Many people have questioned about the usage of className. And Staltz has explained why he took className for events. |
I share @peterjoel's concerns over separating intent definition from the view. My complaint is mainly that it isn't ergonomic for the developer. Declaring a button in one place, and what happens when it's pressed in another feels disjointed. I know you want to treat the user as a function, but users don't take arguments or have return values. They just generate anonymous UI events. We have to label these events and give them context in order to affect the user's intent. Like it or not, web developers have done this inline with the declaration of UI since 1995. That may violate the principles that you set out to build Cycle with, but I'm not sure it really violates the principle of reactivity. If a View module outputs DOM with event listeners attached and those event listeners interactively change the Model; that's not reactive, but if all the event listeners do is trigger specific action events with context data then the Model can listen for those and react. I suppose you wouldn't want to couple the Model to specific DOM events, but if you think of DOM events like the Observables you'd otherwise be returning from the Intent layer, it's not that different architecturally. It just kinda cuts the User function out of the equation. |
Yes they do and in my presentation I explicitly denotated those arguments. Input argument is an Observable of VTree, and return value is an Observable of DOM events (what you called "anonymous UI events").
The events are well labeled. It's a pair of selector and eventType. Instead of naming event channels, you just name the container element which emits that event, and you name the event itself. There isn't much difference other than taste/preference.
The User function is there no matter what. Cycle is a framework that acknowledges that instead of using a different abstraction. |
I still think that most developers are going to prefer to label the events in the place where they originate, and not after they occur. Especially entry level developers who are often the ones working on the View layer. |
I'm going to repeat my core argument I mentioned in this thread:
Cycle.js already has a learning curve and that's RxJS. This isn't a framework that beginners will pick up easily. And that's the disadvantage of this framework. Other frameworks such as Ractive.js are focused on beginner-friendliness. RxJS is all about a mindset change. Once you overcome the paradigm shift, everything starts to make sense. And the selector-based intent events handling is one of these paradigm shifting challenges. The issue itself isn't hard or complex, it's just the mindset change which is hard because people are used to thinking in a certain way. Cycle.js is already a paradigm shift, making this change won't remove that, but it will water down the purpose and goals of the framework. |
I appreciate your idealism, seriously :-) |
I think discussing learning curves is a distraction. There is a shift happening towards FRP and functional style in general, so this will become less of a problem. The ideas aren't hard, they're just different from what people are used to. Let people make wrappers and adapters if they are concerned about that, but don't compromise the core ideas now. |
There are rules like
The important problem, totally not solved at this moment, is how to pass variables between CSS layer and JS layer. A set of a component styles more often than not contains a derivative of a whole site styling. Border radius of component "panel" should repeat the common (global) border radius to give you an example. Possible approaches are:
This project uses "revealing components" pattern I described above. +1 for a real example of it. Components may be customizable through props if some argument should influence HTML + CSS and there are solid reasons against further revealing (splitting to subcomponents). P.S. Same thing with NPM package name. It's global and it's an obvious candidate for "conventional" className prefix. |
Hah, I'd classify them as hacks - if everyone has to write * { anything } then it probably should be the default... But even still - using local style doesn't prevent you from using those features of css... You could still define a global class and assign it to a bunch of html elements. But the main argument for local style is that more often than not this will come back to haunt you and should generally be considered bad practice. |
If CSS is broken this is rather a fix... If you stylize every paragraph through local styles your designer becomes unable to make live experiments. He needs to make N changes to replace font family in the whole visible area of the screen. My designer needs only 1...
How about Facebook team saying "global CSS is a bug"?
"Bad practice" is a bad term. Some parts of web app (or page) like text styling are naturally global and so are better described by global styles, and some parts like unique widgets are probably better described by local styles. The question is how to pass constants / variables from one layer to another. |
It can be a component. And often you don't want a "heading number 4", but a It would even be better for your designer and your markup, as you would be free to use any h* with the semantics without having to take care not to break another places where that h* is used. In most projects that helped me and the designers. |
+1 @hugobessaa - once you think in components with your whole UI, local styling makes a lot more sense. Global css could be considered a bug because the cons of using it far outweigh the benefits. |
@haustraliaer it can led to bugs. But as global states in JS apps, they can be useful at some point. But surely is a beast waiting to bite you. |
In my experience (and not only mine) the problem is exactly the opposite. The problem is that any long-developed site has 100+ shades of gray, 100+ variants of margins etc. And the question is how to unify them, how to reduce them to minimal set of global settings. Not how to pile one more variation of each. And the funniest thing of all. This was precisely the Facebook problem. Read how Nicole Sullivan optimized their site along with Yahoo if you care.
"Once you think how God loves you, whole life makes a lot more sense..." |
That's a very wrong assertion. I suggest it's a matter of experience. Professional developers have been doing their best for years to avoid the problems of global CSS - specificity wars, code bloat, indeterministic style resolution, non-debuggability, silent clashing of styles, dead code, etc. Local styles merely codify the best practices professionals were already using. These practices weren't created by Facebook and they weren't written in the Bible. They solve a real problem. The experience of many is that this approach works. I can't imagine going back to global CSS and specificity wars, just like I can't imagine going back to two-way binding and templates. |
Of course you should take care to not create 100+ shades of gray. There are a number of ways, different than global definitions, to share consistency. Variables are an example. @ivan-kleshnin there is an infinite number of ways to solve different problems. Not every one has the same problems. On my blog I use global styles like your h4 example, and on other websites I use the one I said before. As I think you said, there is many solutions. I'm with you when you say global CSS shouldn't be considered a bug. Global vars in JS are quite useful sometimes too. |
And when using a module system in JS - you can access the global vars fairly easily by specifying
Gimme a break, we're talking about building websites not faith in some higher |
@haustraliaer, ok I have this code to style a list of alerts .index-alert {
position: fixed;
z-index: @zindex-modal;
&.top-right {
top: @line-height-computed / 2;
right: @line-height-computed;
}
&.top-left {
top: @line-height-computed / 2;
left: @line-height-computed;
}
&.bottom-left {
bottom: @line-height-computed / 2;
left: @line-height-computed;
}
&.bottom-right {
bottom: @line-height-computed / 2;
right: @line-height-computed;
}
.item {
position: relative;
margin: @line-height-computed / 2;
}
} It can't be placed or passed to This variables are going from (or derive from) Bootstrap variables @line-height-computed: floor((@font-size-base * @line-height-base)); and depend on global settings like font size or line height. Now all mainstream frameworks we have being it Bootsrap or Foundation or SemanticUI are built by the same principle. They require a looong list of LESS or SASS variables to be defined. How exactly do you propose to reorganize it with local styles? |
@ivan-kleshnin take a look at some "global" styles and variables in JavaScript that I have in RxMarbles: https://github.com/staltz/rxmarbles/tree/master/src/styles |
@staltz this is the "built everything from scratch" kind of solution. Pretty ok when you have no forms and limited number of pages and widgets. Is there any way to generalize it to combine with existing ecosystem and libraries? |
You mean integration with this e.g.?
|
Yeah. Imagine I'm talking to my boss that we need to refactor our CSS with local styles. I show him an article "Global CSS is dead". He says "ok but is it compatible with Bootstrap or any existing framework? How much time is it going it take? What budget should we reserve for it?" What should I answer him? |
"Bootstrap and similar frameworks are incompatible with new best practices (refer to article), hence if we refactor/rework Bootstrap to convert it to JavaScript styles, we will benefit in the long-run (refer to article)" |
That's what I'm talking about.
Personally, I admit it may be "better" or even "best". But engineering is all about practice so we need proofs and success stories from common people. Only a few (2-3) people shared their positive experience but without details and with the "we're right, you're wrong" aplomb. How this should decrease my skepticism? It's obvious that such dramatic change will bring a lot of drawbacks.
|
@ivan-kleshnin I can't add much to this discussion other than vjeux's presentation about CSS problems, which I think covers everything technical. You're asking more from the social or dev community perspective, and I don't know what to say about that. |
So imagine you live in a hypothetical world where dozens of developers are working on a Cycle.js single page app. Every event is globally scoped and all event selectors are just global CSS selectors. Let's say there's a bug in the app. All your unit tests are green, but it's behaving erratically, but only in a few contexts. How easy would it be to debug this, to discover that, uh oh, it's a simple namespace collision is causing it to pick up unrelated events from other elements that only appear on some pages? Do you think you'd pick that up immediately? Or after many hours pouring over everything trying to duplicate and isolate the collision? |
@benoneal If you are referring to That said, I am starting to bet on hierarchical MVI, a new approach where selectors are locally scoped. In any case, these two approaches are not the same as global selection bugs that you typically see in large jQuery-spaghetti SPAs. |
I just started playing with Cycle and it looks really cool!
To me, two things immediately surprised me, so I was wondering if I'm missing something.
The text was updated successfully, but these errors were encountered: