Closed nippur72 closed 8 years ago
react-native
architecture (split between react
and react-native
, see #170)0.29.0
as new target for react native (default is still 0.9.0
).Awesome. Any idea when this PR will be merged?
This PR now fixes #151 too.
Non breaking space appearing alone in a tag were trimmed out because the internal javascript String.prototype.trim()
also trims non breaking spaces.
I fixed it by writing a custom trim function that I use in place of the old one:
function trimHtmlText(text) {
return text.replace(/^[ \f\n\r\t\v\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+|[ \f\n\r\t\v\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+$/g, '');
}
This PR now fixes #152 too, checking that the only valid attributes for <rt-virtual>
are rt-if
, rt-scope
, rt-repeat
.
This PR now fixes #171 too, checking that rt-repeat
does not appear in a root node.
This PR now implements #146 too, introducing the --normalize-html-whitespace
CLI option.
When the option is turned on (default is off), all HTML text is passed thru normalize-html-whitespace, removing all repeating whitespaces and saving bytes on the JavaScript output.
Often the number of React.createElement()
calls is reduced too.
Whitespace removal is applied on all tags except <pre>
and <textarea>
or when the special rt-pre
attribute is specified.
Thank you for merging :smile:
The following issues related to this PR can be closed: #144, #157, #168.
These issues instead refer to other already merged PRs and can be closed too: #101, #111, #117.
This fixes #167.
The problem was
--modules
defaulting tonone
from the command line, so that the right side of||
was always ignored:Similarly for
--react-import-path
.The fix consists in avoiding the default values in
optionator
dependency, and managing them programmatically.It's backward compatible when
--native
is not specified. When specified, it adheres to the specs (requiresreact-native
and switches to commonjs).