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

Using iframe srcdoc when possible #382

Merged
merged 12 commits into from
Nov 1, 2023
Merged

Conversation

cblavier
Copy link
Contributor

For dead components, it's possible to inline iframe content directly in the iframe srcdoc attribute, which prevents extra HTTP request for each iframe (for a component story with 10 variations, a classic iframe would trigger 10 HTTP requests on /live/iframe/*story/

Unfortunately, this strategy can't apply to live components that are stateful, and require a full liveview behind to update their state.

Closes #55

cblavier and others added 10 commits October 19, 2023 09:15
Bumps [floki](https://github.com/philss/floki) from 0.35.0 to 0.35.1.
- [Release notes](https://github.com/philss/floki/releases)
- [Changelog](https://github.com/philss/floki/blob/main/CHANGELOG.md)
- [Commits](philss/floki@v0.35.0...v0.35.1)

---
updated-dependencies:
- dependency-name: floki
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [dialyxir](https://github.com/jeremyjh/dialyxir) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/jeremyjh/dialyxir/releases)
- [Changelog](https://github.com/jeremyjh/dialyxir/blob/master/CHANGELOG.md)
- [Commits](jeremyjh/dialyxir@1.4.1...1.4.2)

---
updated-dependencies:
- dependency-name: dialyxir
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.30.7 to 0.30.9.
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](elixir-lang/ex_doc@v0.30.7...v0.30.9)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [floki](https://github.com/philss/floki) from 0.35.1 to 0.35.2.
- [Release notes](https://github.com/philss/floki/releases)
- [Changelog](https://github.com/philss/floki/blob/main/CHANGELOG.md)
- [Commits](philss/floki@v0.35.1...v0.35.2)

---
updated-dependencies:
- dependency-name: floki
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [phoenix_view](https://github.com/phoenixframework/phoenix_view) from 2.0.2 to 2.0.3.
- [Changelog](https://github.com/phoenixframework/phoenix_view/blob/v2.0.3/CHANGELOG.md)
- [Commits](phoenixframework/phoenix_view@v2.0.2...v2.0.3)

---
updated-dependencies:
- dependency-name: phoenix_view
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.3.3 to 3.3.5.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md)
- [Commits](tailwindlabs/tailwindcss@v3.3.3...v3.3.5)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.19.4 to 0.19.5.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.19.4...v0.19.5)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@cblavier cblavier self-assigned this Oct 31, 2023
@cblavier cblavier linked an issue Oct 31, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (0ab4564) 96.41% compared to head (b81d7aa) 96.32%.
Report is 7 commits behind head on main.

❗ Current head b81d7aa differs from pull request most recent head 087c5a9. Consider uploading reports for the commit 087c5a9 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #382      +/-   ##
==========================================
- Coverage   96.41%   96.32%   -0.10%     
==========================================
  Files          38       38              
  Lines        1980     2012      +32     
==========================================
+ Hits         1909     1938      +29     
- Misses         71       74       +3     
Files Coverage Δ
...enix_storybook/live/story/component_iframe_live.ex 86.66% <100.00%> (+0.45%) ⬆️
...ix_storybook/live/story/playground_preview_live.ex 100.00% <100.00%> (ø)
lib/phoenix_storybook/live/story_live.ex 95.19% <100.00%> (+0.28%) ⬆️
lib/phoenix_storybook/live/visual_test_live.ex 93.84% <100.00%> (+0.09%) ⬆️
lib/phoenix_storybook/mount.ex 100.00% <ø> (ø)
lib/phoenix_storybook/router.ex 90.47% <100.00%> (+0.47%) ⬆️
lib/phoenix_storybook/stories/story.ex 100.00% <ø> (ø)
lib/phoenix_storybook/stories/story_validator.ex 99.60% <100.00%> (ø)
lib/phoenix_storybook/views/layout_view.ex 92.85% <85.71%> (-3.58%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cblavier cblavier force-pushed the 55-use-iframe-srcdoc-instead-of-src branch from be30d8e to 3bb4ade Compare October 31, 2023 13:17
@cblavier cblavier force-pushed the 55-use-iframe-srcdoc-instead-of-src branch from 3bb4ade to 52c9d38 Compare October 31, 2023 15:20
@cblavier cblavier marked this pull request as ready for review November 1, 2023 16:38
@cblavier cblavier merged commit a0624e7 into main Nov 1, 2023
1 check passed
@cblavier cblavier deleted the 55-use-iframe-srcdoc-instead-of-src branch November 1, 2023 16:40
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.

Use iframe srcdoc instead of src
1 participant