$ mol: 4 Jahre spΓ€ter

Nano


Hallo, mein Name ist Dmitry Karlovsky und ich ... liebe es, gegen den Wind zu spucken. Wischen Sie sich ab und spucken Sie erneut. Ich habe so ein Hobby. Und alles, was ich erschaffe, verzichte ich auf Trends, versuche Probleme systematisch und nicht wie gewohnt zu lΓΆsen. Es kommt oft vor, dass die Hauptschwierigkeit nicht darin besteht, eine LΓΆsung zu finden, sondern anderen zu erklΓ€ren, dass das Problem ΓΌberhaupt besteht.


, , , 4 , , , . , , . . , , . .



Bild


2015


  • AngularJS 1.4 β€” , .
  • Angular 2 alpha β€” JS, - -.
  • React 0.14 β€” .
  • Polymer 1.2.3 β€” 1 .
  • VueJS 1.0 β€” .

. , 4 (iOS, Android, Windows, WEB). , () , β€” , . , , .


:


  1. . , .
  2. . , , .
  3. . , .
  4. . .

? . 10 , , :


Bild


. , , . , . β€” . , , . , , . , β€” . , 13 24. , , , React.


, , SAPUI5. , , ExtJS.


, , , . . , . .



Bild



, , . . , . : , . β€” .


β€” , , ", - ". β€” .


, , . β€” , . β€” , .



. . , , : , , , , , , . , . , , . .



" , ", . $mol. ( ), ( , ).



. - , . " ?". , , .



Bild


2016. MIT , . , "$mol: reactive micromodular ui-framework" , .


, , . - "", . - , .


. . , . , , , , . β€” . 20 , , "". , , . , , . . , , , . view.tree , . , . , . - β€” .


, $mol, . , . . . IT , . , , . . . . β€” , , , , .



Bild


2017. . , , . 2 , . , , 2 , , . . . .


$mol . , , . $mol , . , :


Bild


, . . . ( 33 ? : ). - . : css-variables, - ( , ), mobx-angular Suspense API ( , 2 )… , open source, . , $mol . $mol , .


. , , , $mol , β€” , , , , , , , . , NgRx ( redux ). , mobx , .


, , . , . $mol. , β€” $mol_graph. $mol-, , .



Simpsons


, $mol :



Bild


, . , . . β€” , , .


Vue. . , MobX, , . MobX , . , , .


$mol . , $mol, $mol_mem.



Bild


β€” , .


Suspense API . Vue - . MobX, , .


$mol . promises, callbacks, async/await. , . , , , . , , :


@ $mol_mem
user_name() : string {
    return $mol_fetch.json( '/profile' ).name
}


Bild


, 4 β€” , TS . TS β€” Angular 2 β€” TS, JS. , JS Angular β€” . Vue 3 TS. React JS, MicroSoft JSX TypeScript. , , , , . API JS , .


$mol TS, . . TS, . , . .


, , . , view.tree TS, , , .



Bild


. : , , , , - … . . , , , . , WebPack.


$mol , β€” , . , . . , " , , , ". , "lerna" . MAM , $mol . MAM .


MAM , , , , .


, MAM , , . parcel, html . , . , . β€” .


MAM . . . eject CLI . , . . , .



Bild


PHP JS . . β€” , , , 10. , , , , , . . tree shaking, , , . Angular Vue , . React .


, - , , , . MAM , , . , . β€” . , , $mol , . , , .


$mol , , - . β€” Svelte, . , , .



Bild


, , . , . . . IoC Dependency Injection. DI , , .


$mol IoC Ambient Context β€” , . , :


namespace $ {

    export function $my_hello(
        this : $mol_ambient_context
    ) {
        this.console.log( this.$my_name )
    }

    export let $my_name = 'Anonymous'

}

namespace $ {

    $mol_ambient({}).$my_hello() // logs 'Anonymous'

    let custom_context = $mol_ambient({
        $my_name : 'Jin' ,
    })

    custom_context.$my_hello() // logs 'Jin'

}


Bild


React 16 β€” Error Boundaries. , , , . , . 15 . β€” , .


. -. . : - - , . , $mol ? β€” . .


, β€” , . Promise. , - , . "" .



Bild


4 , $mol . . , , $mol .



Bild


, . . , . , , , html- .


, , : html- , html-. $mol html- β€” , , . $mol React Native, html-, View, Text . html- -. TSX TS:


function MyApp(
    {
        leftColor = 'red',
        rightColor = 'blue',
        message = 'Hello World!',
    } : {
        leftColor? : string,
        rightColor? : string,
        message? : string,
    }
) {
    return (
        <View>
            <View style={{ backgroundColor: leftColor }} />
            <View style={{ backgroundColor: rightColor }} />
            <Text>{message}</Text>
        </View>
    )
}

function MyApp(
    {
        leftColor = 'red',
        rightColor = 'blue',
        message = 'Hello World!',
    } : {
        leftColor? : string,
        rightColor? : string,
        message? : string,
    }
) {
    return (
        View({
            kids: [
                View({ style: { backgroundColor: leftColor } }),
                View({ style: { backgroundColor: rightColor } }),
                Text({ kids: [ message ] }),
            ]
        })
    )
}

: , , , HTML . HTML , TS, $mol β€” , DSL, view.tree:


$my_app $mol_view
    sub /
        <= Left $mol_view
            style *
                backgroundColor <= left_color \blue
        <= Right $mol_view
            style *
                backgroundColor <= right_color \red
        <= Message $mol_view
            sub /
                <= message \Hello World!


Bild


. . . β€” API. .


, β€” , . , , , . , "", .


- , . . " " (, React), , . , . , - .


, - , . . , . "" (, Vue), .


$mol . , . , . , , . , view.tree . , . , , :


$my_app2 $my_app
    left_color \brown
    right_color \green
    sub /
        <= Left
        <= Right
        <= Bid $mol_view
            sub /
                <= bid @ \Smile if you see it!
        <= Message

. - β€” , .



Bild


TimeSlicing β€” , , . , "". .


Catberry, , . , β€” . , , , , DOM , , , (16).


$mol - β€” . API, . , $mol , 4 , .


, β€” , . , .


: , . .



Bild


. , . , . , . β€” (pull). , , . $mol.


, "". Vue, $mol_atom, . . : . " ". , , , .


$mol " ". , . . , , .


. , html- , , . , .


, $mol_list, , .


β€” , , , DOM . . . , " " "overflow-anchor", , " ".


, . . , . - , . , .


CSS-in-TS


Bild


, CSS . css- - , . . . , - .


css-in-js, css . TS, CSS: , . - , TSX VDOM , .


$mol β€” , . $mol_style , json . .


, :


$my_app $mol_view
    sub /
        <= Sidebar $my_page

$my_page $mol_view
    sub /
        <= Head $mol_view
        <= Body $mol_view

, , :


$mol_style_define( $my_app , {
    Sidebar: {
        Body: {
            $mol_button: {
                color: $mol_theme.text,
            },
        },
    },
} )

CSS:


[my_app_sidebar_body] [mol_button] {
    display: none;
}

BEM-like my_app_sidebar_body , . -, .


$mol CSS, $mol_style. .


β€” . , .



. 2 : https://notes.hyoo.ru


Anmerkungen


.


, .


PWA .


Netzwerk


.


50 .


.


.


Zeitleiste


: https://showcase.hyoo.ru/


!


Bild


? , . , :


  1. .
  2. .
  3. 2 .
  4. .
  5. .
  6. .
  7. .
  8. , , .
  9. .
  10. .
  11. .
  12. .
  13. .
  14. , .
  15. , .
  16. ( ).
  17. .
  18. .

2 . - , . , . , , , . - . .



Bild


ui-kit. , , , . . 2:


  1. . , , β€” , , .


  2. . ui-kit 20 , ui-kit 15 , . β€” .



. . , , .


-IT-. IT- β€” β€” . , . - , BEM-. , , , : . - . , - . FaceBook .


, . , . , , , .



Bild


, -: https://digital.alfabank.ru/


, , , . .


8 - 5 , . , 190 90 . : 300 , . "Slow 3G" 12 .


Homepage-Ressourcen


, HTML . SSR+hydrate, , , HTML state. , DOM. , , .


, 8 . , , , . - , β€” .


, . , CSS, β€” . 3 . CSS, 5 .


, - , , , , . , HTML - 2 , SSR html, , .


2 . β€” SPA 600 , 16 .


Komponentengalerie-Ressourcen


, ? , 50 . β€” mol.js.org 45 , 110 .


, . , . https://alfabank.ru/


400 . 17 . , , , 8 , 6 .


, . ? β€” amount. , . , :


<div class="amount">
    <h3 class="heading heading_size_m heading_margins_m heading_theme_alfa-on-white">
        <span>
            <span class="amount__major">1 233</span>
            <div class="amount__minor-container">
                <span class="amount__separator">,</span>
                <span class="amount__minor">43</span>
            </div>
            <span class="amount__currency"> ₽</span>
        </span>
    </h3>
</div>

8 . . . , . . , .


:


<h3 class="amount">
    <span class="amount__major">1 233</span>
    <span class="amount__minor">,43 ₽</span>
</h3>

, , , ? , amount button:


const FeeButton = ( { id , submit , size = 'm' , theme = 'dark' , className = '' } ) => (
    <Button
        onClick={ submit }
        className={ "fee-button__submit " + className }
        data-test-id={ id }
        size={ size }
        theme={ theme }
        >
        <Label
            className="fee-button__prefix"
            size={ size }
            theme={ theme }
            >
            { l10n( 'fee-button__prefix' ) }
        </Label>
        <Amount
            className="fee-button__fee"
            data-test-id={ id + '/fee' }
            amount={ fee }
            size={ size }
            theme={ theme }
        />
    </Button>
)

, ? ? ? , :


<Button id="pay-submit" onClick={ submit }>
    <Label id="pay-prefix">{ payPrefix }</Label>
    <Amount id="pay-fee" amount={ fee }/>
</Button>

, , - :


<= Pay_submit $alfa_button
    click?event <=> submit?event null
    sub /
        <= Pay_prefix $alfa_label
            text <= pay_prefix @ \Pay  
        <= Fee $alfa_amount
            amount <= fee $alfa_currency

, jQuery - . , , . . , .


" ", :


  • .
  • API .
  • .
  • , .
  • , .
  • , .
  • , .

, , .



Bild


$mol . . , . , , . . .


, $mol . , (, , JSX β€” push , pull, $mol).



, , . , $mol . . , .


β€” - , , , . , . $mol. . . - . , , .



. $mol. - .


. , . , , , . . :


  • // $mol. - . β€” .
  • - . . , . $mol .
  • . , , , , .
  • $mol .
  • , $mol . . , $mol , . .


Wappen der Gilde


$mol β€” $mol. β€” $mol. β€” $mol. , - .


. , , , . , . , , , , .


. . . . , . , . - , . , . , . .


, . , , , . , " ". . , $mol. - , , , , .


, , , . , , , , . β€” $mol . . . . , .


, , β€” . , , , 10% . , . β€” .




All Articles