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

StoryblokComponent vs component #142

Open
m0zz094 opened this issue May 28, 2022 · 12 comments
Open

StoryblokComponent vs component #142

m0zz094 opened this issue May 28, 2022 · 12 comments
Assignees
Labels
bug [Issue] Something isn't working pending-author [Issue] Awaiting further information or action from the issue author

Comments

@m0zz094
Copy link

m0zz094 commented May 28, 2022

I get huge performance issues when using the StoryblokComponent instead of component:

example using component: https://family-business-unit-f0hhivfwp-cloudnova-srl.vercel.app/
image

example using StoryblokComponent: https://family-business-unit-6nuzynxzr-cloudnova-srl.vercel.app/
image

@alexjoverm
Copy link
Contributor

Hi @m0zz094 thanks for this issue! I'm curious about this, because StoryblokComponent is a basic wrapper of component as you can see https://github.com/storyblok/storyblok-vue/blob/main/lib/StoryblokComponent.vue

Have you investigated this further?

@alexjoverm alexjoverm self-assigned this May 30, 2022
@alexjoverm
Copy link
Contributor

@manuelschroederdev keeping you on the loop

@m0zz094
Copy link
Author

m0zz094 commented May 30, 2022

Hi @alexjoverm, I haven't investigated this further, but if you need more context here's what I'm doing on [...slug].vue

`<script setup>
const route = useRoute();
const version = route.query._storyblok ? "draft" : "published";
let story;
const path = route.path.replace("/en", "/");
const language = getPageLanguage(); //Simple composable I made to get the current page language
if (version == "draft") {
try {
story = await useStoryblok(path == "/" ? "home" : path, {
version: version,
language: language,
resolve_relations: "global-component.global_component",
});
} catch (e) {
throwError(e);
}
} else {
const storyblokApi = useStoryblokApi();
const { data } = await useAsyncData(language + route.path, () =>
storyblokApi.get("cdn/stories/" + (path == "/" ? "home" : path), {
version: version,
language: language,
resolve_relations: "global-component.global_component",
})
);

story = data.value.data.story;
}
</script>`

@manuelschroederdev
Copy link
Contributor

Hey @m0zz094, could you possibly provide a link to your complete project on GitHub or StackBlitz? That would make it a little easier for us to debug the issue. Thanks. 😊

@manuelschroederdev
Copy link
Contributor

I've create two different versions of a demo project, one using the StoryblokComponent, one using the default component. I've uploaded them to Vercel and couldn't identify any notable performance differences.

https://storyblok-components-test.vercel.app
https://components-test-inky.vercel.app

Are you still encountering these issues?

@Lauritzz77
Copy link

If you look at the page source on the the two links, there is a big difference, the https://storyblok-components-test.vercel.app/ does not generate the static markup and https://components-test-inky.vercel.app/ does.. Maybe there is a bug in StoryblokComponent?

@caroillemann
Copy link

I'm also experiencing the issue with the StoryblokComponent.

Here's a comparison of the markup generated for the two test sites @manuelschroederdev set up with Javascript disabled.

Notice that the component markup is only generated on https://components-test-inky.vercel.app/

storyblok-components

components

@manuelschroederdev
Copy link
Contributor

Thank you very much for pointing this out, @Lauritzz77 and @caroillemann. We will investigate this further and get back to you as soon as possible.

@Dawntraoz Dawntraoz added bug [Issue] Something isn't working investigation [Issue] The Storyblok team is investigating labels Nov 3, 2022
@alvarosabu
Copy link
Contributor

Hi, @m0zz094 do you know if this is still an issue? @manuelschroederdev @Dawntraoz any update from our side?

@m0zz094
Copy link
Author

m0zz094 commented Apr 24, 2023

Hi @alvarosabu, I haven't changed my codebase since then honestly, I'm still using the component approach for now

@Dawntraoz
Copy link
Contributor

Dawntraoz commented Apr 24, 2023

As per the abovementioned issue, this behavior was fixed from v4.x.x -> #204 (comment).

Can you @m0zz094 replace your solution with StoryblokComponent using a v4.x or above of this package so we can be sure this issue can be closed <3 Thanks in advance!

@alvarosabu alvarosabu assigned alvarosabu and unassigned alexjoverm Apr 25, 2023
@alvarosabu alvarosabu added pending-author [Issue] Awaiting further information or action from the issue author and removed investigation [Issue] The Storyblok team is investigating labels Apr 25, 2023
@alvarosabu
Copy link
Contributor

Any updates @m0zz094?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [Issue] Something isn't working pending-author [Issue] Awaiting further information or action from the issue author
Projects
None yet
Development

No branches or pull requests

7 participants