Skip to content

Commit 38ae554

Browse files
zaaackalfonsogarciacaro
authored andcommitted
Rename hybridView/hybridExec to isomorphicView/isomorphicExec
1 parent 8c5a7b9 commit 38ae554

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

Samples/SSRSample/src/Client/View.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ let view (model: Model) (dispatch) =
163163

164164
div [] [
165165
span [] [ str "Test js component:" ]
166-
hybridView jsComp jsCompServer { text="I'm rendered by a js Component!" }
166+
isomorphicView jsComp jsCompServer { text="I'm rendered by a js Component!" }
167167
]
168168

169169
div [] [

src/Fable.React/Fable.Helpers.Isomorphic.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ open Fable.Helpers.React
3333

3434
/// Isomorphic helper function for conditional executaion
3535
/// it will execute `clientFn model` in the client side and `serverFn model` in the server side
36-
let inline hybridExec clientFn serverFn model =
37-
ServerRenderingInternal.hybridExec clientFn serverFn model
36+
let inline isomorphicExec clientFn serverFn model =
37+
ServerRenderingInternal.isomorphicExec clientFn serverFn model
3838

39-
let hybridView (clientView: 'model -> ReactElement) (serverView: 'model -> ReactElement) (model: 'model) =
39+
let isomorphicView (clientView: 'model -> ReactElement) (serverView: 'model -> ReactElement) (model: 'model) =
4040
#if FABLE_COMPILER
4141
ofType<HybridComponent<_>, _, _> { clientView=clientView; serverView=serverView; model=model } []
4242
#else

src/Fable.React/Fable.Helpers.React.fs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ type ServerElementType =
769769
let [<Literal>] private ChildrenName = "children"
770770

771771
module ServerRenderingInternal =
772-
let inline hybridExec (clientFn: 'a -> 'b) (serverFn: 'a -> 'b) (input: 'a) =
772+
let inline isomorphicExec (clientFn: 'a -> 'b) (serverFn: 'a -> 'b) (input: 'a) =
773773
#if FABLE_COMPILER
774774
clientFn input
775775
#else
@@ -829,7 +829,7 @@ let inline ofType<'T,[<Pojo>]'P,[<Pojo>]'S when 'T :> Component<'P,'S>> (props:
829829
let inline serverRender () =
830830
createServerElement(typeof<'T>, props, children, ServerElementType.Component)
831831

832-
hybridExec clientRender serverRender ()
832+
isomorphicExec clientRender serverRender ()
833833

834834

835835

@@ -845,7 +845,7 @@ let inline com<'T,[<Pojo>]'P,[<Pojo>]'S when 'T :> Component<'P,'S>> (props: 'P)
845845
/// ofFunction Hello { name = "Maxime" } []
846846
/// ```
847847
let inline ofFunction<[<Pojo>]'P> (f: 'P -> ReactElement) (props: 'P) (children: ReactElement list): ReactElement =
848-
hybridExec createElement createServerElementByFn (f, props, children)
848+
isomorphicExec createElement createServerElementByFn (f, props, children)
849849

850850

851851
/// OBSOLETE: Use `ofFunction`
@@ -923,7 +923,7 @@ let inline domEl (tag: string) (props: IHTMLProp list) (children: ReactElement l
923923
let inline serverRender (tag, props, children) =
924924
createServerElement(tag, (props |> Seq.cast<IProp>), children, ServerElementType.Tag)
925925

926-
hybridExec clientRender serverRender (tag, props, children)
926+
isomorphicExec clientRender serverRender (tag, props, children)
927927

928928
/// Instantiate a DOM React element (void)
929929
let inline voidEl (tag: string) (props: IHTMLProp list) : ReactElement =
@@ -933,7 +933,7 @@ let inline voidEl (tag: string) (props: IHTMLProp list) : ReactElement =
933933
let inline serverRender (tag, props, children) =
934934
createServerElement(tag, (props |> Seq.cast<IProp>), children, ServerElementType.Tag)
935935

936-
hybridExec clientRender serverRender (tag, props, [])
936+
isomorphicExec clientRender serverRender (tag, props, [])
937937

938938
/// Instantiate an SVG React element
939939
let inline svgEl (tag: string) (props: IProp list) (children: ReactElement list): ReactElement =
@@ -942,7 +942,7 @@ let inline svgEl (tag: string) (props: IProp list) (children: ReactElement list)
942942
let inline serverRender (tag, props, children) =
943943
createServerElement(tag, (props |> Seq.cast<IProp>), children, ServerElementType.Tag)
944944

945-
hybridExec clientRender serverRender (tag, props, children)
945+
isomorphicExec clientRender serverRender (tag, props, children)
946946

947947
/// Instantiate a React fragment
948948
let inline fragment (props: IFragmentProp list) (children: ReactElement list): ReactElement =
@@ -951,7 +951,7 @@ let inline fragment (props: IFragmentProp list) (children: ReactElement list): R
951951
let inline serverRender () =
952952
createServerElement(typedefof<Fragment>, (props |> Seq.cast<IProp>), children, ServerElementType.Fragment)
953953

954-
hybridExec clientRender serverRender ()
954+
isomorphicExec clientRender serverRender ()
955955

956956
// Standard elements
957957
let inline a b c = domEl "a" b c

src/Fable.React/Fable.Helpers.ReactServer.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ open Fable.Helpers.React.Props
1111
// Adapted from https://github.com/emotion-js/emotion/blob/182e34bab2b2028c96d513b67ed86faee1b642b2/packages/emotion-utils/src/index.js#L13
1212
let private unitlessCssProps = set [ "animation-iteration-count"; "border-image-outset"; "border-image-slice"; "border-image-width"; "box-flex"; "box-flex-group"; "box-ordinal-group"; "column-count"; "columns"; "flex"; "flex-grow"; "flex-positive"; "flex-shrink"; "flex-negative"; "flex-order"; "grid-row"; "grid-row-end"; "grid-row-span"; "grid-row-start"; "grid-column"; "grid-column-end"; "grid-column-span"; "grid-column-start"; "font-weight"; "line-height"; "opacity"; "order"; "orphans"; "tab-size"; "widows"; "z-index"; "zoom"; "-webkit-line-clamp"; "fill-opacity"; "flood-opacity"; "stop-opacity"; "stroke-dasharray"; "stroke-dashoffset"; "stroke-miterlimit"; "stroke-opacity"; "stroke-width" ]
1313

14+
// Adapted from https://github.com/facebook/react/blob/37e4329bc81def4695211d6e3795a654ef4d84f5/packages/react-dom/src/server/escapeTextForBrowser.js#L49
1415
let escapeHtml (str: string) =
1516
let escaped = StringBuilder()
1617
let splits = str.Split('"', '\'', '&', '<', '>')

0 commit comments

Comments
 (0)