Skip to content

Update dependencies#41

Open
balazspiller wants to merge 7 commits intomasterfrom
update-deps-2
Open

Update dependencies#41
balazspiller wants to merge 7 commits intomasterfrom
update-deps-2

Conversation

@balazspiller
Copy link
Copy Markdown
Collaborator

@balazspiller balazspiller commented Oct 9, 2024

  • Updated Google API Library and its dependencies, but only up to the point that everything is still compatible with PHP 7.4
  • Deleted a ton of files related to unneeded Google API services
  • Inside vendor-prefixed, generated a new version for all the dependency classes with PHP-Scoper, prefixed with the namespace Rank_Math_Instant_Indexing, for example Rank_Math_Instant_Indexing\Google\Service\Indexing
  • Removed vendor folder and added it to .gitignore

This should solve our conflict issues, while we also update the dependencies.

@balazspiller balazspiller requested a review from pratikrm October 9, 2024 02:25
@pratikrm
Copy link
Copy Markdown
Contributor

pratikrm commented Oct 9, 2024

@balazsrm

It is working fine, and the plugin size has not increased. Just one thing: could we automate the deletion of the files by running a command? Like, in the Rank Math plugin, we created a file that removes the doc comments added to the .pot file, which runs with the npm run dist command.

I'm not sure if we can do something like this to delete the files. We will probably need to create a list of folders and files that need to be deleted.

@balazspiller
Copy link
Copy Markdown
Collaborator Author

balazspiller commented Oct 10, 2024

@pratikrm I've added gulp tasks to automate the process but I couldn't properly test it yet because of issues on my local dev environment.

@pratikrm
Copy link
Copy Markdown
Contributor

@balazsrm

I couldn't build the files on my setup either. When I run npm install or npm install --legacy-peer-deps, it fails. I think we may need to update the node packages used in the plugin.

Are you able to install the node_modules on your setup?

@balazspiller
Copy link
Copy Markdown
Collaborator Author

@pratikrm I was able to fix the npm install issue by modernizing all the outdated and deprecated libraries. It required lots of changes in the gulp file as well. But now everything seems to work correctly, we can update all the libraries while also being able to run them independently, without any conflict with other plugins that use the same libraries.

@balazspiller
Copy link
Copy Markdown
Collaborator Author

balazspiller commented Dec 11, 2024

Hi @pratikrm with my latest changes that I just pushed it is working correctly for me, but only with latest version of Node and Composer, and PHP at version 8.2 on my local environment. To test it, you can delete these files and folders:

composer.lock
package-lock.json
vendor
vendor-prefixed
node_modules

Then run npm install, then npm run dist, which should run a series of commands to install composer dependencies, clean unneeded files, use php-scoper to add custom namespaces to the classes, generate the autoload file for the new classes, and finally it runs the old build commands for the scss and the pot file.

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

Successfully merging this pull request may close these issues.

2 participants