-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Let's ship v1! #9673
Comments
Wouldn't it be simpler to rename master to v0, and v1-beta to master? |
@mbrookes It's definitely simpler. But we will lose some contributors along the way. A tradeoff. I like the idea of trying. We need to keep the history too. I can't think of a smart approach. Your solution sounds good to me. |
Hmm, no, you're right that's important. I've no idea how you would go about merging v1 into master, but if it's possible, @nathanmarks will know the answer! In that case, we would simply need to copy master to v0 before merging. As for the rest of your proposal: 💯 |
@oliviertassinari Why are we going to loose contributors by renaming branches? |
@leMaik It's like Bitcoin vs Bitcoin Cash fork, you get the past transactions but not the futures. In our case, we lose the contributors that committed on the v0.x version since we forked to start v1. |
@oliviertassinari Ah, you loose the contributors from the contributors tab? What about forking material-ui to material-ui-legacy and keeping the legacy branch master there. That would mean that all contributors from 0.x would be kept as contributors in material-ui-legacy. (The stars would indeed reset, but are we really here for the stars? ⭐) Regarding the lab project: If we have more than one component in the lab but every component has another "hero" that started/maintains it, we get problems. What if material-ui has a breaking change and multiple lab components need to be updated? You may have to wait for every lab component to be updated. This wouldn't be an issue if every component is developed and released independently. |
@oliviertassinari - I like the lab/core idea. There's a pretty strong argument in my view to release v1 asap. Right now people are starting projects with v0.x which given the quality and stability of v1 they shouldn't be. They are just creating extra work for themselves as they will have to transition at some point. There are lots of us using v1 in production already with no problems and the odd breaking change is less hastle than upgrading from v0 to v1. And the labs/core designation might make this easier. Ie a core breaking change requires a semantic version change with a release train that departs once a month and a labs release train departs once a week. One downside of this might be dependencies between a core change and a labs component requiring that change. Is there a good pattern on how to handle that? |
If I can share my opinion, I really like the 'material-ui/core' setup it just seems very clean to me. It's funny, I have two other departments that are running the 0.x version while my group is building on the beta. I sat with a lead from one of these departments as he tried to make the upgrade, but then easily gave up after it threw errors on Autocomplete missing. He didn't want to waste the time filling in what used to come with 0.x. I'm like man, just get a package for that! 😖 |
@leMaik I'm glad you are asking. It's where a large chunk of the mono-repository value comes (#9614 (comment)). You save a lot of synchronization effort. You can migrate everything in one go. However, as the code base grows, it's taking more time. It's the same tradeoff behind monoliths vs micro-services architecture: inertia (weight) vs synchronization hell. However, your point is valid, we need to address the following problems:
So, I believe we need a third entity:
|
I <3 this idea! Eventually we could also provide a material-ui-x boilerplate for docs/tests/webpack, then it would be easier to transition them to lab at some point. |
@oliviertassinari I like the idea of the lab vs core package. Are you shipping it then as a separate package on |
@Serfenia Yes, having a separate package on npm is important. It's allowing two different lifecycles. |
I don't like it because:
- import TextField from 'material-ui/TextField';
+ import TextField from '@material-ui/core/TextField';
- import Paper from 'material-ui/Paper';
+ import Paper from '@material-ui/core/Paper';
- import { MenuItem } from 'material-ui/Menu';
+ import { MenuItem } from '@material-ui/core/Menu';
- import { withStyles } from 'material-ui/styles';
+ import { withStyles } from '@material-ui/core/styles'; You can tell me that modern IDE add Using Please be kind with your users, and think your API to make their lives easier, not harder. |
@fzaninotto why do you consider |
It was a step back in terms of usability. Adding style with JSS is ultra verbose: import { withStyles } from 'material-ui/styles';
const styles = {
div: {
color: 'red',
}
};
const MyComponent = ({ classes }) => (
<div className={classes.div}>
Hello, World!
</div>
);
export default withStyles(styles)(MyComponent); compare that with the previous version: const styles = {
div: {
color: 'red',
}
};
export default () => (
<div style={styles.div}>
Hello, World!
</div>
); I love CSS-in-JS, and I think it's a step forward because of all the features it offers. Having tried packages like glamorous and emotion, I can safely say that JSS is the worst of all in terms of developer usability and productivity. |
@fzaninotto I don't quite follow. Changing the name for existing code is just a find&replace. I did the same thing for the icons yesterday and took my like 5 minutes 🙂 Do you find it to long? Also, you don't have to use JSS. If you dont't like it use |
You might make a better argument if you gave comparisons to what things would look like using one of the other CSS-in-JS libraries and gave a comparison of the features. I've skimmed all 3 major libraries other than JSS and they all seem to have some fundamental flaw to them where some advanced feature is missing or once you go beyond basic examples it becomes even more verbose and messy to use them instead of JSS for what Material UI is doing and what I'm using |
I find it ultra painful to have to update my code at least once every week for the past year with no added value because mui breaks BC all the time. I've explained it in https://gist.github.com/fzaninotto/0a59220e0460134de321b415d1418e99 Also, I don't write
Oh yes I have to, if I want to keep the bundle size reasonable, because JSS will be bundled with material-ui anyway. Using Glamorous with material-ui would mean using two CSS-in-JS solutions. Besides, how can I use the theme in Glamorous?
I write code for a living. Every time I spend 30 seconds to add
I've already explained my concerns about making the entry barrier higher.
Of, that happens often, and in that case, adding import { connect } from 'react-redux';
const styles = {
div: {
color: 'red',
}
};
const Hello = ({ name }) => (
<div style={styles.div}>
Hello, {name}!
</div>
);
const mapStateToProps = state => ({
name: state.name,
});
export default connect(mapStateToProps)(Hello) to import { connect } from 'react-redux';
import { withStyles } from 'material-ui/styles';
import compose from 'recompose/compose';
const styles = {
div: {
color: 'red',
}
};
const Hello = ({ classes, name }) => (
<div className={classes.div}>
Hello, {name}!
</div>
);
const mapStateToProps = state => ({
name: state.name,
});
export default compose(
connect(mapStateToProps),
withStyles(styles)
)(Hello) And don't get me started on the need for the
Well, you may have needed it, but I've written large and complex apps that never made use if these functionality (cf admin-on-rest). Design choices must balance regular users and power users, IMO JSS gets in the way of normal users just for the benefit of a few power users.
OK, let's just make it a personal preference then. As for advertising flaws in other libraries, feel free to give examples, too. |
@fzaninotto there is nothing much stopping you continuing to use style={} in v1. A significant reason the library moved to a JSS solution rather than using style={} is to solve a whole bunch of performance issues with using style props with large numbers of elements in v0.x. Personally I find v1 much more powerful, consistent and easier to use than v0.x and the performance is far better. There have been quite a lot of breaking changes but @oliviertassinari has done a great job of noting these in the release notes. I was working on a few other things for a month or two and came back to update my codebase to the latest version of material-ui and found it only took an hour or two of working through all the releases to update the code base. I'd like to call out @oliviertassinari and @mbrookes and everyone else for doing an awesome job with the project - each of the changes (particularly things like variant being used consistently) make the library much easier to use. Thanks!! |
Sorry, if I didn't make any sense regarding the name change. I was talking about upgrading an existing 1.x-beta app to a stable 1.x release. I don't think there is any argument about migrating from 0.x to 1.x. It will not be super easy since the API changed a lot. I never personally used 0.x., but the majority of users seem very happy with the new API. Also, migrating 11k LOC in 20 hours seems very good to me. I don't think anyone could migrate an AngularJS app to Angular this fast 😅 I guess you already read it, but @oliviertassinari already wrote about (why the previous approach wasn't working anymore](https://github.com/mui-org/material-ui/blob/v1-beta/ROADMAP.md#summarizing-what-are-our-main-problems-with-css). When he started the rewrite for version 1. There wasn't really anything better than JSS. Depending on the properties you're looking for, JSS might be still be the best solution today. Regarding the composition of HOCs, I really don't like mixing visual components and component that have application logic. The folks from Atlassian have a good approach to solve this: they create a separate file/folder called One final note, I see that you're very disappointed in the path Material UI has taken. What I do not understand is why you chose this project if it doesn't match your requirements. There are plenty of other very good component libraries for React. After all this is an OS project and a lot of people have worked hard on it for more than a year. You're an OS contributor yourself, you now the drill 🙂 For what is worth, my company looked at EDIT: Whoops sorry, wrong button... |
Given that 1.0 offered less features than 0.9 at the time, I strongly disagree. That was pain without gain. I've explained that in my notes. Let's close the discussion on JSS - the decision was already made and there is no way to undo it. My personal opinion is that it's not the best choice today, even if it was probably the best choice when you made it. But there's no point in discussing it further, and I didn't want to start a flamewar in this thread. About the path material-ui has taken, I use to test tools before claiming that they fit my needs or not. Upgrading admin-on-rest to material-ui was a great way to test material-ui 1.0, and yes, we've chosen alternatives for our other projects after that. But I'm still stuck with material-ui for admin-on-rest. So I suffer every time you guys give me more work by breaking BC or making me type longer lines. Hence my message here, where I ask you to reconsider the renaming of the core package (and not all the changes you've already made!). I'm not very disappointed by material-ui in general - you guys deliver great code in the end, and apart JSS, I find it's a beautiful piece of work. The performance is definitely better. But your release process is broken, and that caused me too many headaches. Keep up the good work, but please remember the pain that your actions can cause. |
Why are you updating every week? It's beta and there will be breaking so lock your dependencies to a specific version. And if a new release doesn't offer any features you want to use, don't bother updating to it yet. Save the update for later when you can jump a few releases and do all the BC updates all at once.
I write code for a living too. Spending a few second typing out a few more characters is nothing, thinking about what to write and how to write it best takes longer. We're not typists. For that matter if there is something you write over and over, typing less characters will speed things up considerably for you, and you're the type to care about that. The solution to this is not making upstream libraries sacrifice key features in order to make things slightly more convenient for you. The traditional solution to this, are snippets! Every major editor has them Sublime, Atom, vscode, and others. If importing Material UI is a lot of typing and you do it regularly, then it should take no more keystrokes to get the boilerplate than
Skimming Glamorous it appears to be based entirely around a model where you define styles and tags together like emotion has no connection to the component at all, as a result all the css classes are things like glamorous and emotion appear to be designed around a merge the styles at the element/component method of handling overriding/composing user styles with library styles model. While JSS is based around a model of defining user and library styles separately (using css specificity for user overrides) and just passing classes to elements/components. The problem I see with the former in the MUI-like case is MUI doesn't define single elements so it doesn't fit in with those libraries' pattern of extending the component MUI defines. Instead the style composition has to happen inside the MUI component itself, from how I can understand these libraries being used this would result in either having to pass components instead of style objects to modify styles or MUI composing the styles internally but this resulting in hundreds of redundant css classes because each instance ends up needing its own classes and being unable to share them. emotion and styled appear to be based on the "write a block of css in a JS template string" model. Which is a non-starter. I've seen proponents of this model tout a few "advantages" of this model that quickly fall flat upon scrutiny. One or both of them may also support objects, but it's such an afterthought that it's only mentioned in a single page of the documentation. Every other example uses the css literal syntax.
These are just the issues I can think of from skimming them. I have a feeling that trying to actually use them to implement MUI would bring up more fundamental incompatibilities with how these libraries work and what MUI needs / what functionality we lose if MUI were to use them instead of JSS. |
Sorry, I don't understand your comments like
As for your experience with glamorous and emotion, I suggest you give them a try for real, and you'll see that most of your remarks are preconceptions that don't stand after real use. For instance:
You can specify the css
Not necessarily, see https://emotion.sh/docs/object-styles Again, this is not my intention, and this is not the place, to discuss CSS-in-JS specificities. Now for the important part:
Because the beta releases mix bugfixes and new features. I can't have one without the other. That's why I'm saying the release system is broken.
I don't pretend to tell what you are. I'm sharing my experience. I'm saying that my productivity decreased, and you're replying that I'm doing the wrong job? This doesn't make sense.
Again, more tooling. It's like the Java community, who can't code without a full-fledge IDE due to the complexity of the language / library design. That means that you're increasing the learning curve. That means that you're offloading the job of the library (being usable as is) on a third party (a code snippet) or the user directly. That's exactly what I am criticizing in this post. I'm sorry if I have offended anyone, it was not my intention to do so. I have voiced my opinion because this issue said "feedback welcome"; I didn't expect to get comments where people try to systematically prove that I am wrong :( I don't pretend to be right or wrong, I'm sharing my feedback based on my experience. It seems that we disagree, let's leave the conversation there as there is no progress. |
@fzaninotto We try to trade breaking changes with improvements every time. This way, we incentive people to keep up to date. What you are describing is the output we are expecting. You can't have both. Hopefully, people will keep up to date and the community will move as a single block. We want to reduce partitioning.
I think that readability (80%) should be much more a concern than the time it takes to write code (20%). I agree with you. I have been wondering for a long time if keeping
Yes, they are :) |
@sebald I'm all 💯 with you on this point. We decided to use redux-observables on our main app. But It doesn't mean we can't use sagas with react-admin. |
The codemod to automatically migrate from the current import path (nested) to the flatten one is ready: #11249. |
Two questions:
|
@olee I have closed the issue as the |
Excuse me if I miss something, but I don't understand the need for ps: for the discussion about styles, JSS is very good, it just still lack typings, but they should be added soon |
I’m confused, what about |
@oliviertassinari good idea of moving material-ui to npm orgs! 👍 I have an a related proposal - move material-ui-pickers to the org under |
@dmtrKovalenko Can we chat about it on Gitter? |
ah, I didn't realize I've read #7839, and I trust the team choice for making a good choice there, a webpack alias |
@dmtrKovalenko in the meantime, could we ask that you not use the Material-UI logo on your docs site? Thanks. |
@mbrookes. Ok, but I will be able to redeploy docs only after 27th of May because I’m on holidays now. I will change the logo asap |
Well, not yet. We need a plan for doing so. The v1 effort started 18 months ago. We have had some interesting discussion in #9388 and #9614.
Here are the problems I want to solve all at once:
I'm proposing the following plan, any feedback is welcomed.
If we follow it. I'm expecting the to see the first v1 stable release of our components in a month or two and to complete it in 6 months or so.
We take advantage of
@material-ui
npm scope nameEffectively people imports will change:
I have opened a poll on Twitter to collect some feedback.
Pros
Without, it's really tricky as some external libs might be relying on [email protected] while others on [email protected]. In this situation, people can't have both versions installed at the same time.
They only have one option. They do the migration in one go. This solves pain point n°1 and a bit of n°2.
Cons
Overall, the Babel blog on this topic is very interesting https://babeljs.io/blog/2017/12/27/nearing-the-7.0-release.
We create a lab package
The package can be named
@material-ui/lab
or@material-ui/denovo
as @rosskevin likes it.What's more important is that we can leverage this package.
Pros
Having a lab package is creating a clear contract. People know what they can expect from the components. It's solving problem n°2.
Cons
Overall, the Blueprint approach in interesting to have a look at http://blueprintjs.com/docs/#labs.
mono-repository ❤️
No matter what. I think that we should try very hard to keep the project in a single GitHub repository.
cc @mui-org/core-contributors
The text was updated successfully, but these errors were encountered: