Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 721684 - Use css instead of javascript for the stylesheets
Summary: Use css instead of javascript for the stylesheets
Status: RESOLVED FIXED
Alias: None
Product: Websites
Classification: Unclassified
Component: Packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Packages Website
URL:
Whiteboard:
Keywords:
: 748102 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-05-08 19:48 UTC by Max Magorsch (RETIRED)
Modified: 2023-04-15 19:19 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Test attachment (test.php,3 bytes, application/x-php)
2020-05-08 19:48 UTC, Max Magorsch (RETIRED)
Details
packages.gentoo.org without running Javascript (packages.gentoo.org.png,544.25 KB, image/png)
2023-04-06 18:18 UTC, calimeroteknik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Max Magorsch (RETIRED) Gentoo Infrastructure gentoo-dev 2020-05-08 19:48:15 UTC
Created attachment 636894 [details]
Test attachment

Currently javascript is used for stylesheets. This should be replaced with css in production.
Comment 1 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-11-16 01:01:35 UTC
*** Bug 748102 has been marked as a duplicate of this bug. ***
Comment 2 xHire 2023-04-06 11:20:59 UTC
> Status 	RESOLVED
> Resolution 	WONTFIX

May I ask what’s the reasoning behind this resolution?
Comment 3 Arthur Zamarin archtester Gentoo Infrastructure gentoo-dev Security 2023-04-06 12:05:02 UTC
(In reply to xHire from comment #2)
> > Status 	RESOLVED
> > Resolution 	WONTFIX
> 
> May I ask what’s the reasoning behind this resolution?

I have no issues reopening it if found the place. I've looked at the web assets, and it seems we are using webpack during build to generate css stylesheets for bootstrap.

Unless I miss something, wasn't it mostly done?
Comment 4 xHire 2023-04-06 12:13:03 UTC
Well, it’s true that this bug report unfortunately lacks any details. But in the duplicate bug report, there is mentioned https://packages.gentoo.org/ and I can see exactly the same state as described in that bug report.
Comment 5 calimeroteknik 2023-04-06 18:18:22 UTC
Created attachment 859635 [details]
packages.gentoo.org without running Javascript

This is what packages.gentoo.org looks like without running the Javascript: the CSS is missing.
Comment 6 Arthur Zamarin archtester Gentoo Infrastructure gentoo-dev Security 2023-04-08 08:22:13 UTC
OK, I see, and even how bad it looks. Considering how common it is to run in no JavaScript in Gentoo community, I think this is indeed a bug.

Can I request you to explain how you configure a browser to show it that way so I can reproduce and investigate it, and test if I find a solution?

As for a solution, I think would be hard for the current me, since we are using themes and css from various sources, including gentoo theme tyrian and bootstrap - in both cases I don't know how to fix the issue, I think this is something with webpack configuration?
Either way any help from someone knowledgeable would be great, otherwise it would take long time (since I need to learn this part of web development).
Comment 7 xHire 2023-04-09 16:34:25 UTC
As for replication, in Firefox, there are two possibilities:
• set javascript.enabled = false in about:config
• install noscript addon

NetSurf (which I use) can be either compiled without javascript support entirely, or can have javascript disabled in Preferences → Content → Enable JavaScript (uncheck).

As for the solution, I have taken a look at the repository, but this is completely out of my league, unfortunately.
Comment 8 Arthur Zamarin archtester Gentoo Infrastructure gentoo-dev Security 2023-04-15 15:26:37 UTC
Thank you for giving explanation how to view it locally (decided to use the noscript extension). After much learning, and consulting help with co-workers from the real-life work (real frontend developers, unlike me who is a backend developer with some knowledge of HTML), we managed to configure webpack to extract the styles (Commit [1]).
As mentioned in commit message, the website is still far from ideal, for example the icons aren't displayed, but it looks much better now, mostly functional.


I've pushed it into the develop branch, which will deploy to our staging area [2], so we can preview before we say "Done" on the main production instance. But sadly, the current auto deployer of commit->instance is somewhat broken, so it might take unspecified time until really deployed there [2]. So for now know that it is solved (and verified locally), and I'll ping here when deployed to [2].



[1] https://gitlab.gentoo.org/gentoo/soko/-/commit/6afe3605c73f9a508f4080296b092ec88b958683
[2] https://packagestest.gentoo.org/
Comment 9 Larry the Git Cow gentoo-dev 2023-04-15 19:19:09 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/sites/soko.git/commit/?id=f05a6998c1231bd4e0d2856f5f8c3126b0d38747

commit f05a6998c1231bd4e0d2856f5f8c3126b0d38747
Author:     Arthur Zamarin <arthurzam@gentoo.org>
AuthorDate: 2023-04-15 15:16:02 +0000
Commit:     Arthur Zamarin <arthurzam@gentoo.org>
CommitDate: 2023-04-15 18:50:50 +0000

    fix view with noscript
    
    - configure webpack to extract the css
    - configure webpack mode to be production
    - add fallback for noscript users with the css
    
    In this mode, the website is still far from ideal, for example the icons
    aren't displayed, but it looks much better now, mostly functional.
    
    Closes: https://bugs.gentoo.org/721684
    Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>

 package-lock.json              | 97 +++++++++++++++++++++++++++++++++++++++++-
 package.json                   |  1 +
 web/templates/layout/head.tmpl |  2 +-
 webpack.config.js              | 20 ++++-----
 4 files changed, 105 insertions(+), 15 deletions(-)