Contenu connexe
Similaire à SalesforceでのモダンSPA開発(Mashmatrix ”Sheet"の場合) (20)
Plus de Shinichi Tomita (20)
SalesforceでのモダンSPA開発(Mashmatrix ”Sheet"の場合)
- 2. 業務アプリケーションとSPA
• SPA = Single Page Application
• サーバサイドレンダリングしないWebアプリ
• 画面描画のためにサーバを経由しない ⇒ ユーザ入力に対して迅速に反応
• もともと業務系アプリはSPAに向いている!
• 例えばSEOはサーバサイドレンダリングでしかできないが、ほとんどの場合要件に
含まれない
• しかしフロントエンドアプリ作成は面倒だった
• 標準ルールの不在/職人の世界
• 大規模開発では破綻するケースも
- 6. Lightningに至る道(過去形)
• これからの業務アプリ構築はHTML5 / JavaScriptベースが基本になるだろう(⇐ たぶんそ
の通り)
• なのでSalesforceも今後はHTML5/JavaScriptでアプリを簡単に作れるようにせないかんぜ
(⇐ 仰るとおり)
• ということで弊社謹製のLightning Framework作ったよ(⇐ へえ。がんばったのかな?ど
れどれ?)
• 現在に至る()
- 17. Architecture of Mashmatrix Sheet
Action
CreatorStore
View
State
callrender
Reselect
Action
Redux
Action(async)
• Lightning: @AuraEnabled + enqueueAction
• Visualforce: @RemoteAction + VFRemoting
• Local: API + JSForce
- 21. Initialization (Visualforce)
<apex:page docType="html-5.0"
sidebar="false"
cache="true"
controller="MsmxSheetController"
>
<link rel="stylesheet" href="{!URLFOR($Resource.MsmxSheetVendor, 'salesforce-
lightning-design-system/assets/styles/salesforce-lightning-design-system-vf.css')}" />
<link rel="stylesheet" href="{!URLFOR($Resource.MsmxSheetApp, 'styles/main.css')}" />
<script src="{!URLFOR($Resource.MsmxSheetVendor,
'jsforce/build/jsforce.min.js')}"></script>
<script src="{!URLFOR($Resource.MsmxSheetApp, 'scripts/main.js')}"></script>
<div class="msmx-tabbed-container msmx-app slds"></div>
<script>
(function() {
// ...
MsmxSheet.render('vf', document.querySelector(‘msmx-tabbed-container’), options);
})();
</script>
</apex:page>
- 22. Initialization (Lightning)
({
afterRender: function(cmp, evt) {
this.superAfterRender();
var options = {
component: cmp,
appResourceRoot: '/resource/MsmxSheetApp/',
vendorResourceRoot: '/resource/MsmxSheetVendor/',
};
typeof MsmxSheet !== 'undefined' && MsmxSheet.renderComponent('aura',
cmp.getElement(), options);
},
rerender: function(cmp, evt) {
// ...
}
})
MsmxSheetRenderer.js