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

Service worker : css class on wrapper component. Doesn't apply at times using emotion-js #3312

Closed
Jaikant opened this issue Dec 22, 2017 · 3 comments

Comments

@Jaikant
Copy link
Contributor

Jaikant commented Dec 22, 2017

There are two issues, I am seeing while loading a route directly (opposed to navigating to it), I am using emotion-js for styles.

Since both are related to loading the files from the service worker cache, I am opening a single issue here. I can break it into two if needed.

I started on service workers only today, so I have only a conceptual understanding of how it works, I tried looking into the code but I guess it will take some time for me to understand that.

Issue 1:

when loading from service worker cache. css missing from main wrapper of react component.

In offline mode:

If we directly access a route. The css class on the main wrapper, is not getting applied on the cached page.

It works fine if we navigate to the route (In offline mode).

Issue 2:

I am also noticing the page loading unevenly, creating a jarring effect.
In the layout in /src/layout/index.js, I have the structure like

  <MainDiv>
    <Navigation title={data.site.siteMetadata.title} />
    {children()}
    <Footer title={data.site.siteMetadata.title} />
  </MainDiv>

The Navigation and Footer load first and the children loads after that, creating a weird affect. Since the service worker setting is cache first, it happens all the time the route is directly accessed.

@Jaikant Jaikant changed the title Service worker : css class on wrapper component. Doesn't apply at times. Service worker : css class on wrapper component. Doesn't apply at times using emotionjs Dec 22, 2017
@Jaikant Jaikant changed the title Service worker : css class on wrapper component. Doesn't apply at times using emotionjs Service worker : css class on wrapper component. Doesn't apply at times using emotion-js Dec 22, 2017
@calcsam
Copy link
Contributor

calcsam commented Dec 26, 2017

Can you put up an example repo that demonstrates Issue 1?

@Jaikant
Copy link
Contributor Author

Jaikant commented Dec 29, 2017

Yes, I temporarily removed the service worker from my project. I will put up an example repo hopefully before the new year.

@KyleAMathews
Copy link
Contributor

Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help!

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

No branches or pull requests

3 participants