diff --git a/README.md b/README.md index 2a19dec..6cc6efd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Embed SDK version 2.0.0 -The following document has been updated to reflect the usage of Embed SDK 2.0.0. The API associated with Embed SDK 1.8.x is still available but in order to take advantage of features added to Embed SDK 2.0.0 an embedding application will need to refactored slightly. See the section [Upgrading to Embed SDK 2.0.0](#upgrading_sdk) for more information. +The following document has been updated to reflect the implementation of Embed SDK 2.0.0. Technically the 2.0.0 API is backwards compatible with Embed SDK 1.8.x but the underlying implementation has changed for some functionality. SDK 1.8.x exported a number of classes. SDK 2.0.0 replaces these classes with deprecated interfaces. It is preferred that application that uses the SDK use the 'I' prefixed interfaces (which are identical to the non prefixed interaces). Applications upgrading to SDK 2.0.0 should behave the same. In order to take advantage of the API improvements some refactoring will be required. ## Introduction @@ -696,62 +696,3 @@ const connection = await getEmbedSDK() ``` This functionality is also available to the javascript API. See [here](demo/message_example.ts) for how to add this functionality. - - - -## Upgrading to Embed SDK 2.0.0 - -Embed SDK 2.0.0 is not a breaking change as upgrading the package will NOT break an existing embedded application as the version `1.8.x` API still exists in and has not been removed from the package. It will however be removed in a future release. - -In order to take advantage of the new features (loading different Looker dashboards, looks and explores without creating a new IFRAME), the embedding application will need to refactored slightly. The section of the document outlines the changes that will need to be made. - -### SDK Initialization - -```javascript -// Version 1.8.x -LookerEmbedSDK.init('looker.example.com', '/auth') - -// Version 2.0.x -getEmbedSDK().init('looker.example.com', '/auth') -``` - -### Creating and interacting with an IFRAME - -```javascript -// Version 1.8.x -try { - const dashboard = await LookerEmbedSDK - .createDashboardWithId('42) - .withAllowAttr('fullscreen') - .appendTo('#dashboard') - .on('dashboard:loaded', () => updateStatus('Loaded')) - .build() - .connect() - - dashboard.run() -} catch(error) { - // Error handling -} - -// Version 2.0.x -try { - const connection = getEmbedSDK() - .createDashboardWithId('42) - .withAllowAttr('fullscreen') - .appendTo('#embed_container') - .on('dashboard:loaded', () => updateStatus('Loaded')) - .build() - .connect() - - // The following still works but is deprecated and will be - // removed if a future release - connection.run() - - // The following is the preferred mechanism running a dashboard. - // There are equivalent methods for explores (asExploreConnection) - // and looks (asLookConnection). - connection.asDashboardConnection().run() -} catch(error) { - // Error handling -} -``` diff --git a/docs/assets/highlight.css b/docs/assets/highlight.css index ba5d935..952e013 100644 --- a/docs/assets/highlight.css +++ b/docs/assets/highlight.css @@ -21,8 +21,6 @@ --dark-hl-9: #4EC9B0; --light-hl-10: #000000FF; --dark-hl-10: #D4D4D4; - --light-hl-11: #CD3131; - --dark-hl-11: #F44747; --light-code-background: #F5F5F5; --dark-code-background: #1E1E1E; } @@ -39,7 +37,6 @@ --hl-8: var(--light-hl-8); --hl-9: var(--light-hl-9); --hl-10: var(--light-hl-10); - --hl-11: var(--light-hl-11); --code-background: var(--light-code-background); } } @@ -55,7 +52,6 @@ --hl-8: var(--dark-hl-8); --hl-9: var(--dark-hl-9); --hl-10: var(--dark-hl-10); - --hl-11: var(--dark-hl-11); --code-background: var(--dark-code-background); } } @@ -71,7 +67,6 @@ body.light { --hl-8: var(--light-hl-8); --hl-9: var(--light-hl-9); --hl-10: var(--light-hl-10); - --hl-11: var(--light-hl-11); --code-background: var(--light-code-background); } @@ -87,7 +82,6 @@ body.dark { --hl-8: var(--dark-hl-8); --hl-9: var(--dark-hl-9); --hl-10: var(--dark-hl-10); - --hl-11: var(--dark-hl-11); --code-background: var(--dark-code-background); } @@ -102,5 +96,4 @@ body.dark { .hl-8 { color: var(--hl-8); } .hl-9 { color: var(--hl-9); } .hl-10 { color: var(--hl-10); } -.hl-11 { color: var(--hl-11); } pre, code { background: var(--code-background); } diff --git a/docs/index.html b/docs/index.html index 7aeae20..cbf8607 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,7 +6,7 @@

Looker JavaScript Embed SDK

Embed SDK version 2.0.0

-

The following document has been updated to reflect the usage of Embed SDK 2.0.0. The API associated with Embed SDK 1.8.x is still available but in order to take advantage of features added to Embed SDK 2.0.0 an embedding application will need to refactored slightly. See the section Upgrading to Embed SDK 2.0.0 for more information.

+

The following document has been updated to reflect the implementation of Embed SDK 2.0.0. Technically the 2.0.0 API is backwards compatible with Embed SDK 1.8.x but the underlying implementation has changed for some functionality. SDK 1.8.x exported a number of classes. SDK 2.0.0 replaces these classes with deprecated interfaces. It is preferred that application that uses the SDK use the 'I' prefixed interfaces (which are identical to the non prefixed interaces). Applications upgrading to SDK 2.0.0 should behave the same. In order to take advantage of the API improvements some refactoring will be required.

Introduction

@@ -306,23 +306,4 @@

Tile dialogs

const connection = await getEmbedSDK()
.createDashboardWithId(runtimeConfig.dashboardId)
// Scrolls the top of the IFRAME into view when drilling
.withDialogScroll()
// Ensures that the tile download and tile alert dialogs remain in view
.withScrollMonitor()
// Append to the #dashboard element
.appendTo('#dashboard')
// Finalize the build
.build()
// Connect to Looker
.connect()

This functionality is also available to the javascript API. See here for how to add this functionality.

-

- - -

Upgrading to Embed SDK 2.0.0

-
-

Embed SDK 2.0.0 is not a breaking change as upgrading the package will NOT break an existing embedded application as the version 1.8.x API still exists in and has not been removed from the package. It will however be removed in a future release.

-

In order to take advantage of the new features (loading different Looker dashboards, looks and explores without creating a new IFRAME), the embedding application will need to refactored slightly. The section of the document outlines the changes that will need to be made.

- - -

SDK Initialization

-
-
// Version 1.8.x
LookerEmbedSDK.init('looker.example.com', '/auth')

// Version 2.0.x
getEmbedSDK().init('looker.example.com', '/auth') -
- - -

Creating and interacting with an IFRAME

-
-
// Version 1.8.x
try {
const dashboard = await LookerEmbedSDK
.createDashboardWithId('42)
.withAllowAttr('fullscreen')
.appendTo('#dashboard')
.on('dashboard:loaded', () => updateStatus('Loaded'))
.build()
.connect()

dashboard.run()
} catch(error) {
// Error handling
}

// Version 2.0.x
try {
const connection = getEmbedSDK()
.createDashboardWithId('42)
.withAllowAttr('fullscreen')
.appendTo('#embed_container')
.on('dashboard:loaded', () => updateStatus('Loaded'))
.build()
.connect()

// The following still works but is deprecated and will be
// removed if a future release
connection.run()

// The following is the preferred mechanism running a dashboard.
// There are equivalent methods for explores (asExploreConnection)
// and looks (asLookConnection).
connection.asDashboardConnection().run()
} catch(error) {
// Error handling
} -

Generated using TypeDoc

\ No newline at end of file