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

Delete jQuery #3847

Merged
merged 4 commits into from
Sep 13, 2021
Merged

Delete jQuery #3847

merged 4 commits into from
Sep 13, 2021

Conversation

math-GH
Copy link
Contributor

@math-GH math-GH commented Sep 12, 2021

Closes #3845

Changes proposed in this pull request:

  • delete jquery.min.js
  • delete lib_phpQuery

jQuery is included just in the stats, but it looks like that we does not need it anymore.
So in general jQuery is not needed anymore in the core.

lib_phpQuery looks like unused in the core.
Also: It looks like that the development and active usage of phpQuery stopped in 2015: https://code.google.com/archive/p/phpquery/issues/246

How to test the feature manually:

  1. check the stats (because of jQuery)
  2. and check the system in general (because of phpQuery)

Pull request checklist:

  • clear commit messages
  • code manually tested

I will publish this changes as draft first! Will see if the changes breaks the system or not.

@Frenzie
Copy link
Member

Frenzie commented Sep 12, 2021

Perhaps it's an accidental leftover after #2234 but let me double check.

Edit: the jQuery thing lgtm in principle.

@Frenzie
Copy link
Member

Frenzie commented Sep 12, 2021

delete lib_phpQuery

I'd rather you didn't try to combine such completely unrelated things in the same PR.

Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely used:

if ($html) {
require_once(LIB_PATH . '/lib_phpQuery.php');
$doc = phpQuery::newDocument($html);
if ($maxRedirs > 0) {
//Follow any HTML redirection
$metas = $doc->find('meta[http-equiv][content]');
foreach ($metas as $meta) {
if (strtolower(trim($meta->getAttribute('http-equiv'))) === 'refresh') {
$refresh = preg_replace('/^[0-9.; ]*\s*(url\s*=)?\s*/i', '', trim($meta->getAttribute('content')));
$refresh = SimplePie_Misc::absolutize_url($refresh, $url);
if ($refresh != false && $refresh !== $url) {
phpQuery::unloadDocuments();
return self::getContentByParsing($refresh, $path, $attributes, $maxRedirs - 1);
}
}
}
}
$content = $doc->find($path);
$html = trim(sanitizeHTML($content->__toString(), $url));
phpQuery::unloadDocuments();
return $html;

Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eek, meant the other one.

@Alkarex Alkarex added this to the 1.19.0 milestone Sep 12, 2021
@Alkarex Alkarex added the UI 🎨 User Interfaces label Sep 12, 2021
@Alkarex
Copy link
Member

Alkarex commented Sep 12, 2021

phpQuery is still used for full article content retrieval and has been patched by us along the way, e.g. to support PHP8.
We indeed need a replacement (I think there is an issue somewhere but I cannot find it at the moment). I would like something lighter using some more native PHP functions such as XPath.
Let's restrict this PR to jQuery.

@math-GH
Copy link
Contributor Author

math-GH commented Sep 13, 2021

Reverted lip_phpQuery

@math-GH math-GH marked this pull request as ready for review September 13, 2021 05:59
@Alkarex Alkarex merged commit 93e7385 into FreshRSS:edge Sep 13, 2021
@Alkarex
Copy link
Member

Alkarex commented Sep 13, 2021

Let's go for it 🙂

@math-GH math-GH deleted the 3845-delete-jquery branch September 13, 2021 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI 🎨 User Interfaces
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] jQuery still used?
3 participants