Live data from Hacker News

Blueprint – A React UI toolkit for the web

blueprintjs.com

141–150 of 214 posts

Re: Blueprint – A React UI toolkit for the web

#141
It seems you may have to include the css for the whole library on every page[0]. I would have much preferred it if the css for each component is included on your page as you require the component.

Though I admit it is confusing since the "Let's Get Started" section of the homepage[1] does not mention including the global css.

[0] http://blueprintjs.com/docs/ [1] http://blueprintjs.com/

Re: Blueprint – A React UI toolkit for the web

#142
post #35

This looks really nice. However, what I really want for React is a style-agnostic component library that basically extends the regular set of HTML elements, but comes with no "visual" styling (other than really basic styling like the browser's default styling for , and the like). Only styling that is necessary for the component to function should be included. Of course, optional themes would be fine. Also, non-visual…

Styling is still "unsolved" with react IMO. Inline styles feel wrong, CSS alone isn't encapsulated enough to work with components correctly, CSS modules are TOO encapsulated which makes global styles and themes a royal pain, and adding another layer ala SASS or LESS feels like more of a "patch" vs a real solution. And none of them really solve style inheritance in any way that I'd call elegant. I end up using SASS an…

I know everyone has their own favorite method, but one that I'm extremely satisfied with is using webpack > sass-loader > extract-text[1] to `include Styles from './MyComponent.scss'` in each component file, and then it all gets bundled up into a single css file per target (also great for eliminating dead CSS!). I use "layouts" at the root of my react hierarchy (under stores and routers and whatnot) and put my global styles there.

I haven't run into a situation using this setup where I felt like I needed a dirty hack to make something work. It does add a layer of complexity to the build, but if you can get it working once you can just copy paste it into every new webpack config, and It feels very natural and tends to organize itself.

I am really not a fan of this new "css in your js" approach that the cool kids are using, but I guess I'm just getting old.

[1] output of the following config will be:

  dist/
  |_app/
    |_bundle.js
    |_bundle.css
  |_admin/
    |_bundle.js
    |_bundle.css
```

  const webpack = require("webpack");
  const ExtractTextPlugin = require("extract-text-webpack-plugin");
  const ExtractCSS = new ExtractTextPlugin("[name].css");

  module.exports = {
    entry: {
      "./dist/app/bundle": "./app.js",
      "./dist/admin/bundle": "./admin.js",
    },
    output: {
      path: __dirname,
      filename: "[name].js"
    },
    module: {
      loaders: {
        test: /\.scss$/,
        loader: ExtractCSS.extract(["css", "sass?sourceMap"])
      }, {
        test: /\.js$/,
        loader: 'babel',
        exclude: /node_modules/,
        include: __dirname
      },
    },
    sassLoader: {
      includePaths: "source/styles",
      sourceMap: true
    },
    plugins: [ ExtractCSS ]
  }
```

Re: Blueprint – A React UI toolkit for the web

#143
post #54

Not to sound like a bummer here, but I'm not sure what kind of computer is needed to open this webpage. Simply scrolling up and down that website causes my computer to almost freeze. Firefox 49.0 user here. I would profile it, but I'm afraid of having to restart the computer as a result. Edit: It looks amazing. (Still the performance issue is reproducible easily)

And the doc has 4.2MB of minified javascript. Jesus christ. Tooks 9 seconds to load the page. All credibility gone. Why would I use components made by people who don't see performance problems?

This makes me sad. I made a CSS library[1] some time ago and recently could fit the whole landing page into 10kb for the a-k-apart competition[2], which I've reverted ever since to about 15kb in total because there were some sacrifices that I didn't want to make. I'm totally surprised when I see those multi-MB Javascript files.

[1] Picnic CSS: http://picnicss.com/

[2] 10K Apart: http://a-k-apart.com/

Re: Blueprint – A React UI toolkit for the web

#144
post #115

Earlier quoted context omitted.

We're aware of this: https://github.com/palantir/blueprint/issues/39 Feel free to make a PR to improve things boubiyeah, we just haven't gotten to this issue yet.

> Feel free to make a PR to improve things boubiyeah What kind of answer is this? I don't think "boubiyeah" is working for you, nor has signed up for contributing to your project. When you publish something to a public forum, even if you it is an open-source project, you open yourself to criticism(actually criticism is a great tool to help you improve your project), so my suggestion would be to be open and positive a…

In my experience[1] the best way to get contributors is exactly the opposite, you have to leave the easy and cool parts for new people and do all the grunt work by yourself. Making a new feature is something fun that other contributors can try to do and learn a lot, while optimizing your website is something that mostly only saves you money (as contributors could do that virtually anywhere else and learn the same). See an example of what I mean: [2]

[1] http://github.com/franciscop/

[2] https://github.com/umbrellajs/umbrella/issues?utf8=%E2%9C%93...

Re: Blueprint – A React UI toolkit for the web

#145
post #142

Earlier quoted context omitted.

Styling is still "unsolved" with react IMO. Inline styles feel wrong, CSS alone isn't encapsulated enough to work with components correctly, CSS modules are TOO encapsulated which makes global styles and themes a royal pain, and adding another layer ala SASS or LESS feels like more of a "patch" vs a real solution. And none of them really solve style inheritance in any way that I'd call elegant. I end up using SASS an…

I know everyone has their own favorite method, but one that I'm extremely satisfied with is using webpack > sass-loader > extract-text[1] to `include Styles from './MyComponent.scss'` in each component file, and then it all gets bundled up into a single css file per target (also great for eliminating dead CSS!). I use "layouts" at the root of my react hierarchy (under stores and routers and whatnot) and put my global…

That is what we do as well, but if you use a UI toolkit that includes it's own styles, you'll need to override them. That's where the fun hacks like .button.button.button come in to override the included styles.

Re: Blueprint – A React UI toolkit for the web

#147
post #54

Not to sound like a bummer here, but I'm not sure what kind of computer is needed to open this webpage. Simply scrolling up and down that website causes my computer to almost freeze. Firefox 49.0 user here. I would profile it, but I'm afraid of having to restart the computer as a result. Edit: It looks amazing. (Still the performance issue is reproducible easily)

Hi folks, I'm one of the developers of this project -- we hear your perf concerns loud and clear and are tracking the issues :) As mentioned elsewhere in this thread, this page was released a little too early while we were still playing around with animations in the header. I've gone ahead and disabled them for now, so you should see leaner CPU utilization now. Thanks for your comments.

Even now, it's still pretty sluggish, all around. My machine is, I think, as big as can be expected (current gen i7, 16GB), though I am on a slow 4G network. But, as others note, it is gorgeous, and the API appears well thought-out, and very complete (or, at least, complete for the kinds of systems UIs I build).

Re: Blueprint – A React UI toolkit for the web

#148
Despite the sluggishness, there's a lot of really likeable stuff in here and it is beautiful (or, a lot more beautiful than I, or most developers, could ever come up with without a team and some pro designers on staff).

I particularly enjoyed the piano example: http://blueprintjs.com/docs/#components.hotkeys

Re: Blueprint – A React UI toolkit for the web

#149
post #142

Earlier quoted context omitted.

I know everyone has their own favorite method, but one that I'm extremely satisfied with is using webpack > sass-loader > extract-text[1] to `include Styles from './MyComponent.scss'` in each component file, and then it all gets bundled up into a single css file per target (also great for eliminating dead CSS!). I use "layouts" at the root of my react hierarchy (under stores and routers and whatnot) and put my global…

That is what we do as well, but if you use a UI toolkit that includes it's own styles, you'll need to override them. That's where the fun hacks like .button.button.button come in to override the included styles.

Oh yeah, I see what you're saying. I just don't bother with toolkits since I find that once you factor in said fun, you aren't really saving much time, and you might end up with a lot of jank. I just roll my own based on the needs of the project and keep my cascade very flat and specific. Sass makes this really easy using BEM style naming, where you can do this:

  .my-component {
    &_component-item {
      &--open {
      }
    }
  }
and you get a nice, flat output:

  .my-component {}
  .my-component_component-item {}
  .my-component_component-item--open {}
I wish framework authors would adopt this approach as it completely eliminates specificity conflicts.
Post reply on HN