Posts

Showing posts from December 18, 2018

Split CSS in submodules and aggregate them with PHP or a precompiler

Image
up vote 0 down vote favorite I'm working on improving a Wordpress Theme. The CSS file is long 41500 lines, of which many selectors are not used, and nowaday Google has become very strict on waste of resources (old smartphones with 3G is the target). By reading the CSS code I've realized that there is just on huge CSS for all the styles which can be chosen in the backend Admin section of the theme: /* ------------------------------------------------------------------- Style 1 ---------------------------------------------------------------------- */ How should I proceed? I've read of Grunt, Webpack but I don't know them. Any suggestion? php css optimization share | improve this question ...

Rio São Lourenço

Image
Esta é uma página de desambiguação que lista os artigos que podem ser associados a um ou vários títulos. Se uma ligação interna o conduziu até aqui, sugerimos que a corrija para apontá-la diretamente ao artigo adequado. Rio São Lourenç pode referir-se a: Rio São Lourenço (América do Norte) Rio São Lourenço (Mato Grosso) Rio São Lourenço (Mato Grosso do Sul) Rio São Lourenço (Paraná) Rio São Lourenço (Rio Grande do Sul) Rio São Lourenço (São Paulo) Rio São Lourenço (litoral de São Paulo) This page is only for reference, If you need detailed information, please check here

Is Flow replace PropTypes?

Image
up vote 0 down vote favorite I'm using React with Flow. If I forgot to set some requiring props when rendering, Flow gives me error so I can prevent the problem. However Flow is not actually working on runtime. So if the value that I used were treated as number wasn't number, Flow can't catch this. For example, if the value was coming from somewhere else, like server side and if it was string, but Flow just treated as number so eventually I will get some errors in runtime. But PropTypes works in runtime, so in the same case I'll get the error message that PropType expected number but actually it was string. It's also possible to happen when the API were changed and returning data is different. It could undefined or whatever, possibly not actual value I expected. So I'm using Flow and PropTypes both ac...