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

Embeddable grid in iframes #1904

Merged
merged 4 commits into from
Feb 8, 2022
Merged

Embeddable grid in iframes #1904

merged 4 commits into from
Feb 8, 2022

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Jan 31, 2022

Filtering

Command: filter
Value: { name: string; value: string }[] - Provide an array of column name and quick filter values to set.
Example: document.getElementById('my-iframe').contentWindow.postMessage({ command: 'filter', value: [{ name: 'A', value: '>50' }, { name: 'B', value: '<4' } ] }, 'http://localhost:4010')

Sorting

Command: 'sort'
Value: { name: string, direction?: 'ASC' | 'DESC' }[] - Provide an array of column names to sort on, and optionally the sort direction (defaults to 'ASC');
Example: document.getElementById('my-iframe').contentWindow.postMessage({ command: 'sort', value: [{ name: 'A' }, { name: 'B', direction: 'DESC' } ] }, 'http://localhost:4010')

@mofojed mofojed self-assigned this Jan 31, 2022
@devinrsmith devinrsmith added this to the Jan 2022 milestone Jan 31, 2022
Copy link
Member

@devinrsmith devinrsmith left a comment

Choose a reason for hiding this comment

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

Very cool. I think we might want a way to encode a generic ticket (so, we can fetch application mode tickets, etc); probably something like ?ticket=<hex-or-base64url-encoded>?

This does get into the realm of URIs that I'm hoping we can support more thoroughly server-side (resolve("<uri>")); in which case, maybe we want to support encoded URIs instead of tickets directly: ?uri=...

@devinrsmith
Copy link
Member

Does it make sense to break out the static media as it's own package that can be further depended on? Looks like we are duplicating about 15M of content:

15M     /usr/share/nginx/html/iframe/table/static/media
15M     /usr/share/nginx/html/ide/static/media

@devinrsmith
Copy link
Member

Alternatively, should we have a single entrypoint into our npm pack that specifies code-studio and embed-grid?

Use by creating URL with the correct src and tableName, eg. <iframe src="http://localhost:10000/embed-grid?tableName=miami"></iframe>
@mofojed
Copy link
Member Author

mofojed commented Feb 8, 2022

The hex ticket can be a follow up ticket.
The static media between the two packages is not all the same, though the fonts are duplicated. It's possible we could do code-splitting on routes and that would help with that some, but that would require some changes on the web-client-ui side. Could be a separate ticket?

I'll make one entrypoint to our npm pack and re-post.

At some point we could add ticket hash loading and/or code splitting on routes
# Pull in the published embed-grid package from npmjs and extract is
RUN set -eux; \
npm pack @deephaven/embed-grid@${WEB_VERSION}; \
Copy link
Member

Choose a reason for hiding this comment

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

Just verifying - we expect code-studio and embed-grid to always be in-sync with their versions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, they should.

@mofojed mofojed merged commit d171b2d into deephaven:main Feb 8, 2022
@mofojed mofojed deleted the embed-grid branch February 8, 2022 19:08
@github-actions github-actions bot locked and limited conversation to collaborators Feb 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants