Source code for an extension demo at Looker's JOIN2019 Conference. Reads a Look to gather carbon usage, sends total to Cloverly to match potential offset purchases.
- Fork this repo
- Clone a copy to your dev machine
- Navigate to the
Extension Template
's directory on your system - Enter the following commands (you may need to update your node version)
yarn install yarn start
Great! Your extension is now running, but you can’t see it at the URL provided.
(default: https://localhost:8080
)
Important: If you go to the url you are running there may be a certificate warning. Go ahead and agree to that.
You will have to do this everytime you start up again with yarn start
- Now login to looker and create a new Blank Project.
- Navigate to the IDE in Looker.
- In your fork of
extension_template
you havemanifest.lkml
file. You can either drag & upload this file into your Looker project, or create amanifest.lkml
with the same content. Change theid
,label
, orurl
as needed.
application: extension-template {
label: "Extension Template"
url: "https://localhost:8080/bundle.js"
}
-
Create a
model
lookml file in your project. Give it any name. It is only used for permissioning.- Add a connection in this model. The specific connection doesn't matter.
- Configure the model you created. https://docs.looker.com/data-modeling/getting-started/create-projects#configuring_a_model
-
We suggest creating an empty git repository and linking it to this project. This will be useful for deploying later.
- Configure git from your Looker project to the new repository.
- https://docs.looker.com/data-modeling/getting-started/setting-up-git-connection
-
Commit and deploy your
model
andmanifest
to production. -
Reload the page and click the
Browse
dropdown menu. You should see your extension in the list. (default:Extension Template
)- Live reloading is not supported
- BUT! While in
Developer Mode
, if you are usingurl
, you can reload the page to see any changes you make to the underlying extension code.
- code splitting is currently NOT supported
- In your terminal you can build the extension with
yarn.build
. - Drag and drop the generated
bundle.js
file into your project via Looker - In your
manifest.lkml
, instead ofurl
, usefile
.
application: extension-template {
label: "Extension Template"
file: "bundle.js"
}