Upgrade to Pro — share decks privately, control downloads, hide ads and more …

lwc紹介2.pdf

lintaotan
March 27, 2019
16

 lwc紹介2.pdf

lintaotan

March 27, 2019
Tweet

Transcript

  1. LWCの開発ワークフロー 1.Dev Hub and Scratch Orgs ・Salesforce Command Line Interface

    (CLI) ・Visual Studio Code Extension ・GitHub 2.Non-Scratch Orgs 開発ワーク フロー 関連ツール
  2. 最小限のjsコード 修飾子 Decorators ・@api: Marks a property as public for

    use in your template or other components. ・@track: Marks a property for internal monitoring. ・@wire: Gives you a way to get and bind data. This implementation simplifies getting data from a Salesforce org. LWCのJSファイル ・モジュールlwc ・クラスLighiningElemnt
  3. イベント通信 Create and Dispatch Events ・CustomEvent() ・EventTarget.dispatchEvent() Communicate Between Components

    ・publish-subscribe pattern Aura application events https://github.com/trailheadapps/lwc-recipes/tree/master/force-app/main/default/lwc/pubsub
  4. Lightning Web Componentsのテスト Write Jest tests to: ・Test a component

    in isolation ・Test a component’s public API (@api properties and methods, events) ・Test basic user interaction (clicks) ・Verify the DOM output of a component ・Verify that events fire when expected Jest tests work in: LWC Aura How to write Jest Tests ・folder named __tests__ ・Update .forceignore with **/__tests__/** ・@salesforce/wire-service-jest-util ・registerLdsTestWireAdapter(wireAdapter)