Live data from Hacker News

Show HN: ReactCSS – Inline Styles with Support for React, Redux and React Native

reactcss.com

21–30 of 48 posts

Re: Show HN: ReactCSS – Inline Styles with Support for React, Redux and React Native

#22

This is slightly off-topic, but... this simple website is made of a single, static page without any kind of user interaction. Why does it load a 2.8 Mb javascript, and why is javascript needed to render the page at all?

I don't think that's off-topic in the slightest and have been asking this question myself for ages.

Re: Show HN: ReactCSS – Inline Styles with Support for React, Redux and React Native

#23

This is very similar to https://github.com/Khan/aphrodite and https://github.com/rtsao/react-stylematic

One of the biggest differences between ReactCSS and other solutions is that all of the style merging is done in the style object and not in the HTML. This keeps the markup clean and puts all style and style logic in one place.

Re: Show HN: ReactCSS – Inline Styles with Support for React, Redux and React Native

#25

This is slightly off-topic, but... this simple website is made of a single, static page without any kind of user interaction. Why does it load a 2.8 Mb javascript, and why is javascript needed to render the page at all?

React. If it was a pretty complex and dynamic app it would be just a bit bigger.

The author either didn't do the best choice in writing his page, or has great plans for it.

Re: Show HN: ReactCSS – Inline Styles with Support for React, Redux and React Native

#26
post #3

What happened to the separation of concerns between CSS and JS? In my experience most developers dont want anything to do with CSS. They want a designer who can code to do that.

It's still separated, but they are near each other.

I personally like this way better, easier to find when need to fix something.

Re: Show HN: ReactCSS – Inline Styles with Support for React, Redux and React Native

#27

Is there any benefit to using this over CSS Modules in React? https://github.com/gajus/react-css-modules

React CSS Modules does not allow you to use props or state to style your component. Say you wanted to use a button you could map the color prop directly to CSS.

There is nothing preventing you from using (React) CSS modules & state/props. Use the allowMultiple option if you need more than one classname (base classname + modifier).

Re: Show HN: ReactCSS – Inline Styles with Support for React, Redux and React Native

#28
post #25

This is slightly off-topic, but... this simple website is made of a single, static page without any kind of user interaction. Why does it load a 2.8 Mb javascript, and why is javascript needed to render the page at all?

React. If it was a pretty complex and dynamic app it would be just a bit bigger. The author either didn't do the best choice in writing his page, or has great plans for it.

Yes! The static version of the site is an in-between, with more complex documentation coming soon!

Re: Show HN: ReactCSS – Inline Styles with Support for React, Redux and React Native

#29
post #19

This is slightly off-topic, but... this simple website is made of a single, static page without any kind of user interaction. Why does it load a 2.8 Mb javascript, and why is javascript needed to render the page at all?

I only see a ~800kb bundle.js, which could be smaller if minified, I think, but nothing strangely big.

I'm also getting a 2.8mb file, which the server is having trouble sending in a reasonable timeframe under the heavy load HN is putting it under right now.

http://i.imgur.com/OmFGf7D.png

Re: Show HN: ReactCSS – Inline Styles with Support for React, Redux and React Native

#30
post #19

This is slightly off-topic, but... this simple website is made of a single, static page without any kind of user interaction. Why does it load a 2.8 Mb javascript, and why is javascript needed to render the page at all?

I only see a ~800kb bundle.js, which could be smaller if minified, I think, but nothing strangely big.

The bundle is 2.8 Mb uncompressed, ~800Kb compressed.

Even if compressed and minified, that's still a huge amount of JS statements that the interpreter has to go through.

I'm getting about 2 seconds to DomContentLoaded on my iMac and a reasonably fast cable connection. Four seconds to visible content on my Nexus 5X on same connection.

This is the kind of crap that makes the web feel so lame and clunky on mobile (and on desktops too even sometimes).

Post reply on HN