Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
[version]
0.270.0
0.307.1

[ignore]
.*/malformed_package_json/.*
<PROJECT_ROOT>/.*/__tests__/.*

[include]

[declarations]
.*/node_modules/.*

[options]
casting_syntax=as
component_syntax=true
module.name_mapper='^react-strict-dom$' -> '<PROJECT_ROOT>/packages/react-strict-dom/dist/native/index.js.flow'
module.system.node.resolve_dirname=flow_modules
module.system.node.resolve_dirname=node_modules
react.runtime=automatic
suppress_type=$FlowIssue
suppress_type=$FlowFixMe

experimental.ts_utility_syntax=true
experimental.deprecated_utilities='$ReadOnlyArray' -> '<PROJECT_ROOT>/'
experimental.deprecated_utilities='$NonMaybeType' -> '<PROJECT_ROOT>/'
experimental.deprecated_utilities='$ReadOnly' -> '<PROJECT_ROOT>/'
experimental.deprecated_utilities='mixed' -> '<PROJECT_ROOT>/'
experimental.deprecated_utilities='$ReadOnlyMap' -> '<PROJECT_ROOT>/'
experimental.deprecated_utilities='$ReadOnlySet' -> '<PROJECT_ROOT>/'
experimental.deprecated_utilities='$Keys' -> '<PROJECT_ROOT>/'
experimental.deprecated_utilities='$Values' -> '<PROJECT_ROOT>/'
experimental.deprecated_colon_extends=<PROJECT_ROOT>/

[strict]
nonstrict-import
Expand Down
40 changes: 36 additions & 4 deletions apps/platform-tests/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ScrollView } from 'react-native';
import { css, html } from 'react-strict-dom';
import { tokens, themeColors, systemColors } from './tokens.css.js';

type ExampleBlockProps = $ReadOnly<{
type ExampleBlockProps = Readonly<{
title: string,
children: React.Node
}>;
Expand Down Expand Up @@ -71,24 +71,30 @@ const themedStyles = css.create({

function ThemeExample() {
return (
// $FlowFixMe[incompatible-type]
<html.div style={themedStyles.container}>
{/* default theme */}
{/* $FlowFixMe[incompatible-type] */}
<html.div style={themedStyles.square} />
{/* redblue theme */}
<html.div style={redBlueTheme}>
{/* $FlowFixMe[incompatible-type] */}
<html.div style={themedStyles.square} />
</html.div>
{/* purpleyellow theme */}
<html.div style={purpleYellowTheme}>
{/* $FlowFixMe[incompatible-type] */}
<html.div style={themedStyles.square} />
</html.div>
{/* greenpink theme */}
<html.div style={greenPinkTheme}>
{/* $FlowFixMe[incompatible-type] */}
<html.div style={themedStyles.square} />
</html.div>
{/* nested theme */}
<html.div style={redBlueTheme}>
<html.div style={greenPinkTheme}>
{/* $FlowFixMe[incompatible-type] */}
<html.div style={themedStyles.square} />
</html.div>
</html.div>
Expand Down Expand Up @@ -152,6 +158,7 @@ function Shell(): React.MixedElement {
<html.div>dfadsafdsfadsf inside div (kind of) works</html.div>
<html.span>
span inside div inside span...
{/* $FlowFixMe[incompatible-type] */}
<html.div style={styles.textAncestorTest}>
<html.span>works</html.span>
</html.div>
Expand Down Expand Up @@ -212,6 +219,7 @@ function Shell(): React.MixedElement {
console.log(e.type, e);
}}
src="http://placehold.jp/150x150.png"
// $FlowFixMe[incompatible-type]
style={styles.objContain}
width={150}
/>
Expand Down Expand Up @@ -290,8 +298,11 @@ function Shell(): React.MixedElement {

{/* flex row undoes block layout emulation and correct flex child layout */}
<html.p>display:flex defaults and children</html.p>
{/* $FlowFixMe[incompatible-type] */}
<html.div style={styles.row}>
{/* $FlowFixMe[incompatible-type] */}
<html.div style={[styles.square, styles.w1000]} />
{/* $FlowFixMe[incompatible-type] */}
<html.div style={[styles.square, styles.blueSquare]}>
<html.div style={styles.whiteBox}>
<html.p>Back to block</html.p>
Expand All @@ -303,6 +314,7 @@ function Shell(): React.MixedElement {

<html.p>display:block resets flex properties</html.p>
{/* display block undoes row layout and emulates block again */}
{/* $FlowFixMe[incompatible-type] */}
<html.div style={[styles.row, styles.blockW300]}>
<html.div style={styles.square} />
<html.div style={[styles.square, styles.bgBlue]} />
Expand All @@ -328,31 +340,40 @@ function Shell(): React.MixedElement {
{/* logical styles emulation */}
<ExampleBlock title="CSS Logical">
<html.div>
{/* $FlowFixMe[incompatible-type] */}
<html.div style={styles.logicalPadding} />
{/* $FlowFixMe[incompatible-type] */}
<html.div style={styles.logicalMargin} />
{/* $FlowFixMe[incompatible-type] */}
<html.div style={styles.logicalBorder} />
</html.div>
</ExampleBlock>

{/* CSS positioning (static by default) */}
<ExampleBlock title="CSS Position">
{/* $FlowFixMe[incompatible-type] */}
<html.div style={[styles.p50, styles.relative]}>
<html.div style={styles.p50}>
{/* $FlowFixMe[incompatible-type] */}
<html.div style={[styles.square, styles.absTopLeft]} />
</html.div>
{/* $FlowFixMe[incompatible-type] */}
<html.div style={[styles.relative, styles.p50]}>
{/* $FlowFixMe[incompatible-type] */}
<html.div style={[styles.square, styles.absTopLeft]} />
</html.div>
</html.div>
</ExampleBlock>

{/* CSS text */}
<ExampleBlock title="CSS Text styles">
{/* $FlowFixMe[incompatible-type] */}
<html.div style={styles.lineHeightUnitless}>
<html.span style={styles.text}>
<html.span style={styles.text}>test</html.span> (unitless)
</html.span>
</html.div>
{/* $FlowFixMe[incompatible-type] */}
<html.div style={styles.lineHeightEm}>
<html.span style={styles.text}>test (em)</html.span>
</html.div>
Expand Down Expand Up @@ -462,6 +483,7 @@ function Shell(): React.MixedElement {
</html.button>
<html.p>Transform + Opacity</html.p>
<html.div
// $FlowFixMe[incompatible-type]
style={[
styles.square,
styles.transitionAll,
Expand All @@ -478,9 +500,13 @@ function Shell(): React.MixedElement {

{/* visibility */}
<ExampleBlock title="CSS Visibility">
{/* $FlowFixMe[incompatible-type] */}
<html.div style={styles.flex}>
{/* $FlowFixMe[incompatible-type] */}
<html.div style={[styles.square, styles.visibilityCollapse]} />
{/* $FlowFixMe[incompatible-type] */}
<html.div style={[styles.square, styles.visibilityHidden]} />
{/* $FlowFixMe[incompatible-type] */}
<html.div style={[styles.square, styles.visibilityVisible]} />
</html.div>
</ExampleBlock>
Expand All @@ -491,7 +517,7 @@ function Shell(): React.MixedElement {
<html.div style={styles.square} />
<html.input
placeholder="input type:text"
// $FlowFixMe
// $FlowFixMe[incompatible-type]
style={styles.input}
type="text"
/>
Expand All @@ -511,7 +537,7 @@ function Shell(): React.MixedElement {
<html.div style={styles.square} />
<html.input
placeholder="input type:text"
// $FlowFixMe
// $FlowFixMe[incompatible-type]
style={styles.input}
type="text"
/>
Expand All @@ -523,7 +549,7 @@ function Shell(): React.MixedElement {
<html.div style={styles.square} />
<html.input
placeholder="input type:text"
// $FlowFixMe
// $FlowFixMe[incompatible-type]
style={styles.input}
type="text"
/>
Expand All @@ -535,6 +561,7 @@ function Shell(): React.MixedElement {

{/* hover */}
<ExampleBlock title="CSS :hover, :focus, :active">
{/* $FlowFixMe[incompatible-type] */}
<html.textarea style={styles.pseudoStates} />
</ExampleBlock>

Expand Down Expand Up @@ -581,7 +608,9 @@ function Shell(): React.MixedElement {
style={[styles.h100, styles.dynamicBg(clickData.color)]}
>
<html.span style={styles.bgWhite}>{clickData.text}</html.span>
{/* $FlowFixMe[incompatible-type] */}
<html.div style={styles.flex}>
{/* $FlowFixMe[incompatible-type] */}
<html.div style={[styles.flex, styles.flexGrow]}>
<html.div>
<html.span>
Expand All @@ -604,6 +633,7 @@ function Shell(): React.MixedElement {
</html.span>
</html.div>
</html.div>
{/* $FlowFixMe[incompatible-type] */}
<html.div style={[styles.flex, styles.flexGrow]}>
<html.div>
<html.span>button: {clickEventData.button}</html.span>
Expand All @@ -624,6 +654,7 @@ function Shell(): React.MixedElement {
setImageLoadText(`${e.type}: loaded`);
}}
src="http://placehold.jp/150x150.png"
// $FlowFixMe[incompatible-type]
style={styles.objContain}
width={150}
/>
Expand All @@ -634,6 +665,7 @@ function Shell(): React.MixedElement {
setImageErrorText(`${e.type}: errored`);
}}
src="http://error"
// $FlowFixMe[incompatible-type]
style={styles.objContain}
width={150}
/>
Expand Down
6 changes: 3 additions & 3 deletions apps/platform-tests/src/components/tokens.css.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { StyleVars } from 'react-strict-dom';
import { css } from 'react-strict-dom';

export const tokens: StyleVars<
$ReadOnly<{
Readonly<{
squareColor: string,
textColor: string,
inputColor: string,
Expand All @@ -29,7 +29,7 @@ export const tokens: StyleVars<
});

export const themeColors: StyleVars<
$ReadOnly<{
Readonly<{
primary100: string,
primary200: string
}>
Expand All @@ -39,7 +39,7 @@ export const themeColors: StyleVars<
});

export const systemColors: StyleVars<
$ReadOnly<{
Readonly<{
squareColor: string,
outlineColor: string
}>
Expand Down
Loading
Loading