-
Install dependencies with Yarn:
yarn install
-
To run a development server:
yarn start
In manifest for a LookML project on your Looker instance:
application: data-dictionary-dev { label: "Data Dictionary (dev)" uri: "http://localhost:8080/bundle.js" entitlements: { local_storage: yes navigation: yes new_window: yes core_api_methods: ["run_inline_query", "lookml_model_explore", "all_lookml_models", "all_users", "me", "search_groups"] } }
And you will also need to add a dummy model to the project.
connection: "thelook"
-
To do a build:
yarn build
(You should commit the built file.)
It uses React and TypeScript for writing your extension, the React Extension SDK for interacting with Looker, and Webpack for building your code.
-
Clone or download a copy of this repo to your development machine
-
Navigate (
cd
) to the template directory on your system -
Install the dependencies with Yarn.
yarn install
You may need to update your Node version or use a Node version manager to change your Node version.
-
Start the development server
yarn start
The extension is now running and serving the JavaScript at http://localhost:8080/bundle.js.
-
Now log in to Looker and create a new project.
This is found under Develop => Manage LookML Projects => New LookML Project.
You'll want to select "Blank Project" as your "Starting Point". You'll now have a new project with no files.
-
In your copy of the extension tablet you have
manifest.lkml
file.You can either drag & upload this file into your Looker project, or create a
manifest.lkml
with the same content. Change theid
,label
, orurl
as needed.application: data-dictionary { label: "Data Dictionary" url: "http://localhost:8080/bundle.js" entitlements: { local_storage: yes navigation: yes new_window: yes core_api_methods: ["run_inline_query", "lookml_model_explore", "all_lookml_models", "all_users", "me", "search_groups"] } }
-
Create a
model
LookML file in your project. Use the name of the project as the model name (this is a convention).- Add a connection in this model. It can be any connection, it doesn't matter which.
- Configure the model you created so that it has access to some connection.
-
Connect your new project to Git.
-
Commit your changes and deploy your them to production through the Project UI.
-
Reload the page and click the
Browse
dropdown menu. You should see your extension in the list.- The extension will load the JavaScript from the
url
you provided in theapplication
definition/ - Reloading the extension page will bring in any new code changes from the extension template. (Webpack's hot reloading is not currently supported.)
- The extension will load the JavaScript from the
The process above requires your local development server to be running to load the extension code. To allow other people to use the extension, we can build the JavaScript file and include it in the project directly.
- In your extension project directory on your development machine you can build the extension with
yarn build
. - Drag and drop the generated
dist/bundle.js
file into the Looker project interface - Modify your
manifest.lkml
to usefile
instead ofurl
:application: data-dictionary { label: "Data Dictionary" uri: "http://localhost:8080/bundle.js" entitlements: { local_storage: yes navigation: yes new_window: yes core_api_methods: ["run_inline_query", "lookml_model_explore", "all_lookml_models", "all_users", "me", "search_groups"] } }