A port of Belgian Beer Explorer to typescript as a proof of concept.
This is a very primitive setup and just meant to illustrate how typescript could be leveraged in the lightning component framework. Could easily be expanded to work as a DX project to provide a much more robust developer experience.
git clone [this]
cd typescript-belgian-beer-explorer-lightning
npm install
npm install sfdx-cli -g
(if you don't have sdfx-cli already installed)- in
package.json
updatedeploy
script with an authed user
- Edit ts files
npm run build
npm run deploy
See Belgian Beer Explorer instructions for setting up application.
As of writing this, no typing files were available for the aura API. If you'd like to see salesforce add them, go show support on this issue. I've added a few API types to types.d.ts
as well as typed some of the BeerList
component.
Note: I haven't actually tested to see if salesforce accepts any of the functional typescript features (things that transpile to code like classes & enums). Type Definitions don't result in any transpiled JS so there should be no issues there.