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

Update AngularJS from 1.1.2 to 1.8.2 #2190

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DarthTealc
Copy link
Contributor

I have updated AngularJS from 1.1.2 to the final version, 1.8.2 - and I've updated the menus to migrate to this latest version.

Testing in both CEF (x86-64 branch) and Awesomium (main branch) on Windows 10 and it appears to be functional in both. I have resolved any bugs that I encountered. Further testing from more users would be useful and appreciated.

Would be good to know if users on lower performing devices can notice performance improvements. There are no changes to functionality or design.

Implementation notes and explanations:

  • angular.js and angular-route.js are sourced from their .min.js versions here https://code.angularjs.org/1.8.2 - for security, you can add these yourself rather than trusting the versions I submitted. - these are used by the entire main menu system (new game, server list, addons, dupes, saves, demos, etc)
  • for debugging you may also use the non minified versions. for shipping it should be the minified versions. either way, in gmod they don't have .min. in the name.
  • Some changes to menuApp.js have been explained via comments, to prevent confusing other devs in future. For example, 'asset://' paths needed to be whitelisted as AngularJS now blocks any links/images from invalid protocols.
  • for debugging, you can edit menuApp.js and comment out the $compileProvider.debugInfoEnabled( false ); line. But this line should remain in-place when released.
  • Various <a> elements with ng-click have had an empty href attribute added. This was done automatically in 1.1.2 but needed to be done manually here. These are required for CSS styling to apply properly to javascript links, such as the pointer finger cursor. Not needed on other elements or hyperlinks that use ng-href
  • the 'old' angular.js has been renamed angular.legacy.js, and is used by Sandbox's spawn menu saves/dupes. These sandbox spawn menu panels continue to use 1.1.2 as I was not able to resolve bugs with them. As they are mostly isolated from the rest of the menu system I do not think this is an issue but would welcome anyone updating them to use 1.8.2.

While I believe this to be bug-free and shippable, I think it would be best to get confirmation from more people that they've experienced no issues before merging. There are likely specific cases or features I don't use that I haven't fully tested.

Other contributors are very welcome to add improvements.

@robotboy655 robotboy655 self-assigned this Jan 21, 2025
@robotboy655 robotboy655 added the Enhancement The pull request enhances current functionality. label Jan 21, 2025
@robotboy655 robotboy655 removed their assignment Jan 21, 2025
@DarthTealc
Copy link
Contributor Author

I've re-based this pull request after recent garrysmod changes. None of the changes conflict with this angularjs upgrade.

As nobody has reported any issues and I've not experienced any myself over the past few days, it may be worth pushing to the dev branch and then x86-64 branch for a larger test audience.

@DarthTealc
Copy link
Contributor Author

I've re-based this pull request, no conflicts were present.

I've also included this fix #2202 for this issue Facepunch/garrysmod-issues#6104, though if there's an AngularJS setting that could be used instead then I'd welcome someone replacing the onauxclick with an AngularJS solution.

@DarthTealc
Copy link
Contributor Author

Reverted the middle-click fix aspect, as per #2202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement The pull request enhances current functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants