26
Olga Petrova, @ tyoushe Introduction to ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @ tyoushe [email protected]

Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe [email protected]

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Introduction toExtReact, ExtAngular, ExtWebComponents

Olga Petrova, @[email protected]

Page 2: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

ExtReact & ExtAngular

Page 3: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Page 4: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Components

Page 5: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Ext JS, React and Angular

Ext JS Componentconfigsitems: []

Angular ComponentpropertiesChildren elements

React ComponentpropsChildren elements

Page 6: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Reactor Wrapper

Concept

Ext JS Componentprops

state

method calls

event listenerstransform translateconfigsevents

methods

link to Ext JS Component

Page 7: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Architecture

first and lastname

React Framework

Core

Ext Modern Components

Theme Packages

Sencha Themer

Angular Framework Sencha Test

Premium Packages

Page 8: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

ExtReact

8

import React, { Component } from 'react';import { Grid, Column } from '@sencha/ext-modern';

export default class MyGrid extends Component {

store = Ext.create('Ext.data.Store', {...});

render() {return (<Grid title="Stock Prices" store={this.store}><Column text="Company" dataIndex="name" width="150"/><Column text="Price" width="85" dataIndex="price" formatter='usMoney‘/>

</Grid>)

}} MyGrid.js

Page 9: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

<container padding="10" layout="fit" [fitToParent]="true"><grid title="Stock Prices" [store]="store"><column text="Company" width="150" dataIndex="name"></column><column text="Price" width="85" dataIndex="price" formatter="usMoney"></column><column text="Last Updated" dataIndex="lastChange"></column>

</grid></container>

ExtAngular

9

import { Component } from '@angular/core';@Component({selector: 'basicgrid-component‘,templateUrl: './MyGrid.html'

})export class BasicGridComponent {store = Ext.create('Ext.data.Store', {...})constructor() {//...

}}

MyGrid.html

MyGrid.ts

Page 10: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Getting Started

10

ExtReact Trial: https://www.sencha.com/products/extreact/evaluate/ExtAngular Trial: https://www.sencha.com/products/extangular/evaluate/

Page 11: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

npm login --registry=https://npm.sencha.com --scope=@sencha

npm install -g @sencha/ext-react-gen

ext-react-gen app -i

Setup

11

Page 12: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Examples

12

ExtReact Kitchensink: https://examples.sencha.com/ExtReact/6.7.0/kitchensink/ExtAngular Kitchensink: https://examples.sencha.com/ExtAngular/6.7.0/kitchensink/

Page 13: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Vue.js

Page 14: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

WebComponents

Page 15: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Page 16: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Specifications• Custom Elements

• Shadow DOM

• ES Modules

• HTML Template

16

Page 17: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Custom HTML Tag

17

class MyAwesomeButton extends HTMLElement {...}window.customElements.define('my-awesome-button', MyAwesomeButton);

<my-awesome-button class="nice_style">Click me!</my-awesome-button>

var myAwesomeButton = document.createElement('my-awesome-button‘);

document.body.appendChild(myAwesomeButton);

document.querySelector('my-awesome-button‘).addEventListener('click', function() {...});

Page 18: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Page 19: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

ExtWebComponents

Page 20: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

ExtWebComponents

20

import '@sencha/ext-web-components/dist/ext-column.component';import '@sencha/ext-web-components/dist/ext-grid.component‘;

Page 21: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

<ext-panel width="100%" height="100%"><ext-grid multiColumnSort=true onready="basicgrid.onGridReady" title="Stock Prices"><ext-column text="Company" flex="1" dataIndex="name"></ext-column><ext-column text="Price" dataIndex="price" formatter="usMoney"></ext-column><ext-column text="Last Updated" dataIndex="lastChange"></ext-column>

</ext-grid></ext-panel>

import './MyGrid.html';

export default class MyGrid {constructor() {this.store = Ext.create('Ext.data.Store', {...});

}

onGridReady = (event) => {this.gridCmp = event.detail.cmp;this.gridCmp.setStore(this.store);

}}

ExtWebComponents

21

MyGrid.html

MyGrid.js

Page 22: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Getting Started

22

MyGrid.ts

Early adopter access to ExtWebComponents Trial: https://www.sencha.com/products/extwebcomponents/evaluate/earlyaccess/

Page 23: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

npm login --registry=https://sencha.myget.org/F/early-adopter/npm/ --scope=@sencha

npm install -g @sencha/ext-web-components-gen

ext-web-components-gen app --name MyApp

Setup

23

MyGrid.ts

Page 24: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Examples

24

ExtWebComponents Kitchensink: https://examples.sencha.com/ExtWebComponents/7.0.0/kitchensink/

Page 25: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

• 115+ UI Components

• Layout System

• Sencha Themer

• Sencha Test

• Sencha Cmd integration

• Ext JS component bridge

• Webpack: Build and Bundle

ExtReactExtAngular

ExtWebComponents

Page 26: Introductionto ExtReact, ExtAngular, ExtWebComponentsOlga Petrova, @tyoushe Introductionto ExtReact, ExtAngular, ExtWebComponents Olga Petrova, @tyoushe olga@sencha.com

Olga Petrova, @tyoushe

Introduction toExtReact, ExtAngular, ExtWebComponents

Olga Petrova, @[email protected]