Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Embed SDK 2.0 Development (wip) #210

Open
wants to merge 73 commits into
base: master
Choose a base branch
from
Open

Conversation

bryans99
Copy link
Collaborator

No description provided.

@bryans99
Copy link
Collaborator Author

The beginnings of Embed SDK 2.0.

Very much a WIP but I want to get a backup

2. Upgrade karma type script packages.
3. Update documentation.
4. Reduce exposed embed sdk 2.0.0 classes to the minumum.
5. Update version to 2.0.0
6. Fix minor issue with comment in demo.
7. Correct copyright dates.
   out code.
2. Fix internal event handler setup so that users of the sdk can
   listen to events (internal event handler was overwriting handlers
   added with "on".
3. Fix cookieless login. Incorrect separator used.
4. Fix asLookConnection return type. Was ILookerEmbedExtension. Now
   is ILookerEmbedLook (copy pasta error).
5. Fix LookerEmbedSDKFactory constructor input type. Now is interface.
6. Initial karma tests for 2.0.
2. Various fixes for issues found while writing tests for
   LokerEmbedExSDK
2. Add more withApiHost and withAuth tests to LookerEmbedExSDK tests
3. Hide internal properties and methods from documentation
4. Regenerate documentation
2. LookerEmbedExSDK test update
3. doc cleanup
4. Clean up function names
5. Remove unnecessary assertions
6. Clean up generateTokens error handling
7. Fix appendRequiredParameters processing for sandboxed host
8. Add clarifying comments for sandboxed host
9. Fix connect for private embed
10. Fix isCookielessEmbed check (replaces assertions)
2. Update docs to reflect generatTokens change
   does not support it)
2. fix generateTokens handling of fetch init object
3. clean up generate error handling
4. correct initCookieless generateTokens typing
5. more EmbedClientEx tests
2. Updated documentation to reflect removed method
3. EmbedConnection.loadUrl method is the only method for setting
   default values for pushHistory and waitUntilLoaded
4. DashbordConnection tests
5. Updated EmbedClientEx tests to spy on mocks instead of
   connection. Spy ons now callThrough.
6. EmbedConnection tests
7. Add mock sendAndReceive method
2. ExploreConnection test
3. ExtensionConnection test
4. LookConnection test
   SDK.
2. Rename original demo to multi frame demo
3. Rename new demo to single frame demo
4. Change title of message example tp Embed Message API Demo
2. Correct LookSaveEventDetail documentation
3. Generate documentation
4. EmbedClientEx tracks looks being edited
5. Change of page resets editing status
2. fix skipped tests
2. Add more tests
3. Use Promise reject instead of throwing an error when page load not supported
4. use toThrow instead of deprecated toThrowError
2. Added signal to option object to allow caller to abort the request
   (to be implemented in a follow up change)
3. Updated documentation
2. Fixed 404 on beercss woff2 files
3. Remove beer css from repo. Now copied from node modules
   and gitignored
2. Add demo of use of abortable
3. Add env config to allow dev server to be connected from
   any hostname (allows testing of reports using an
   allow listed hostname defined in etc/hosts)
@bryans99 bryans99 marked this pull request as ready for review March 7, 2025 22:57
@bryans99 bryans99 requested a review from a team as a code owner March 7, 2025 22:57
Copy link
Collaborator

@jkaster jkaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a fair number of new files with a copyright date of 2024 instead of 2025 and some others with 2025. This pass is just for resolving typos/links then I can review again when that's resolved

@@ -1,54 +1,60 @@
# Looker JavaScript Embed SDK

## Embed SDK version 2.0.0

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
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 interfaces). 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.

```

A more complete example can be found [here](demo/demo.ts). Detailed instructions on how to use it are [here](#demo).
A more complete example can be found [here](demo/demo_single_frame.ts) and [here](demo/demo_multi_frame.ts). Detailed instructions on how to use the SDK can be found [here](#demo).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these links are not resolving on the npm site

```

In this example, `/auth` is a backend service that you must implement as described in the [Auth](#the-auth-endpoint) section.
In this example, `/auth` is a backend service that must be implemented as described in the [Auth](#the-auth-endpoint) section.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this link isn't resolving


### Advanced Auth Configuration
If another IFRAME is required, the SDK will not call the auth endpoint again as the embed session already exists. Instead the IFRAME will be created with the requested embed URL without signing a `login/embed` URL. If multiple IFRAMEs are created on page load (not recommended but it does work), the SDK will wait for the first IFRAME to be created before creating the more IFRAMEs. This is done to reduce contention that can occur when complex embed users are created.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If another IFRAME is required, the SDK will not call the auth endpoint again as the embed session already exists. Instead the IFRAME will be created with the requested embed URL without signing a `login/embed` URL. If multiple IFRAMEs are created on page load (not recommended but it does work), the SDK will wait for the first IFRAME to be created before creating the more IFRAMEs. This is done to reduce contention that can occur when complex embed users are created.
If another IFRAME is required, the SDK will not call the auth endpoint again as the embed session already exists. Instead the IFRAME will be created with the requested embed URL without signing a `login/embed` URL. If multiple IFRAMEs are created on page load (not recommended but it does work), the SDK will wait for the first IFRAME to be created before creating more IFRAMEs. This is done to reduce contention that can occur when complex embed users are created.


This section does not apply to cookieless embed as an alternate mechanism for authentication is used. See the [cookieless embed](#cookieless) section for details.
Different looker object types or object type instances can be loaded without recreating the IFRAME.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Different looker object types or object type instances can be loaded without recreating the IFRAME.
Different Looker object types or object type instances can be loaded without recreating the IFRAME.


MIT License

Copyright (c) 2024 Looker Data Sciences, Inc.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2025?

"build": "npm run clean && npm run build_utils && tsc && webpack",
"build_utils": "tsc --build tsconfig-server.json",
"clean": "rm -rf lib dist",
"docs": "typedoc --gitRevision master --githubPages false --out docs src/index.ts",
"lint": "eslint --format stylish '**/*.ts'",
"lint-fix": "eslint --format stylish --fix '**/*.ts'",
"start": "npm run build_utils && webpack serve --config webpack-devserver.config.js --hot --color --progress",
"start": "npm run beer-dev && npm run build_utils && webpack serve --config webpack-devserver.config.js --hot --color --progress",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no such thing as free beer?


MIT License

Copyright (c) 2024 Looker Data Sciences, Inc.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2025?


MIT License

Copyright (c) 2024 Looker Data Sciences, Inc.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2025?

@@ -2,7 +2,7 @@

MIT License

Copyright (c) 2022 Looker Data Sciences, Inc.
Copyright (c) 2024 Looker Data Sciences, Inc.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a confused rename on this file name, but ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants