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

CSS and JavaScript got injected two times in every file #21

Open
weber-d opened this issue Jul 20, 2018 · 5 comments
Open

CSS and JavaScript got injected two times in every file #21

weber-d opened this issue Jul 20, 2018 · 5 comments

Comments

@weber-d
Copy link

weber-d commented Jul 20, 2018

Using the hello world example I noticed that the content of each file is served two times. Doesn't seem to make any difference if we have js or css files.

Simple example: I create a file called style.css with the following content:

.lotusHeader .shareSome-desc .shareSome-title{
    font-size:40px;
    color:orange
}

When I access the injected file from the webserver, It has the following content:

.lotusHeader .shareSome-desc .shareSome-title{
    font-size:40px;
    color:orange
}
.lotusHeader .shareSome-desc .shareSome-title{
    font-size:40px;
    color:orange
}

That's not only a performance issue case it also applys to javascript, so that every code got executet two times.

@briangleeson
Copy link
Contributor

Not sure I follow, your style.css content is the same as the content you posted from injected file from webserver.

Did you see each file injected twice in the returned HTML? Or two requests fetching each file? What env were you using?

Any more detail you can provide would be useful

@weber-d
Copy link
Author

weber-d commented Jul 20, 2018

The file itself (main.css) is only referenced once in the html page source:

<link rel='stylesheet' type='text/css' href='/files/customizer/my-theme/dist/main.css?cache-control=max-age%3D0'>

But style.css contains it's content two times in a row like this (updated the post, too)

.lotusHeader .shareSome-desc .shareSome-title{
    font-size:40px;
    color:orange
}
.lotusHeader .shareSome-desc .shareSome-title{
    font-size:40px;
    color:orange
}

This seems to be a bug somewhere in the customization-system, since the file uploaded by me is fine (no redundant content).

To be more clear, I have the main.css file with the following content:

.lotusHeader .shareSome-desc .shareSome-title{
    font-size:40px;
    color:orange
}

It got uploaded in customizer/my-theme/dist/main.css on the server. Now I access the file using our webserver on http://my-host/files/customizer/my-theme/dist/main.css and got this:

.lotusHeader .shareSome-desc .shareSome-title{
    font-size:40px;
    color:orange
}.lotusHeader .shareSome-desc .shareSome-title{
    font-size:40px;
    color:orange
}

We're having a pink testsystem with kubernetes. I'm mainly a C# developer and completely new on any IBM software, just got recently started on the pink stack. The connections about page say Release v6.0.0.0 Build IC6.0_CR_Integration_20171116-0701. Is this enough or do you need further information?

@briangleeson
Copy link
Contributor

Ah. This issue has been fixed in the next release of the component pack. You would need to upgrade to it once it is released to pick up the fix

@weber-d
Copy link
Author

weber-d commented Jul 23, 2018

Okay, do you have any information about the version and the estimated release date?

@briangleeson
Copy link
Contributor

It'll be included in v6.0.0.6 Component Pack. I'm not certain there is an exact release date announced, but it should be quite soon

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

2 participants