SMF icon indicating copy to clipboard operation
SMF copied to clipboard

[3.0] Manage third party libs via composer

Open MissAllSunday opened this issue 1 year ago • 10 comments

This is a simple POC for allowing SMF to handle their internal third party libraries via composer.

Some key features to take into consideration for this POC

  • Composer is solely used by SMF, that is, no access to mod authors. Mod authors can still ship their own vendor folder if they provide their respective configuration for it
  • Modifications to Simplemachines/build-tools will have to be made to further remove hardcoded instances of third party libs, happy to do those changes myself if required.
  • SMF release process will need to change to accommodate composer commands.

MissAllSunday avatar May 31 '24 20:05 MissAllSunday

@MissAllSunday this is still marked as draft. You plan on more changes here?

live627 avatar Dec 20 '24 07:12 live627

@MissAllSunday this is still marked as draft. You plan on more changes here?

Nope, will mark it as ready and resolve the conflicts

MissAllSunday avatar Dec 24 '24 16:12 MissAllSunday

Upon further testing, integrate_autoload doesn't work because it is called before settings are loaded. My fix https://github.com/live627/SMF2.1/commit/cfdfe79546def2a2de6e92b8d6b2d9924493c9a5 should I submit this as another PR?

live627 avatar Dec 25 '24 04:12 live627

Not really sure, it has to do with this PR so it makes sense to include it here but it could also be a separate PR specially if this one doesn't get merged, up to you. Best of options would be include it here and also send it as a separate PR I suppose.

MissAllSunday avatar Jan 03 '25 17:01 MissAllSunday

I did a rebase from release-3.0 will take a look at this again

MissAllSunday avatar Mar 25 '25 20:03 MissAllSunday

I've been waiting for this PR for 5 years. Please merge it soon.

3.0 is still in alpha so it will still be a while before it's ready for use on a production forum

Oldiesmann avatar Mar 29 '25 03:03 Oldiesmann

I've been waiting for this PR for 5 years. Please merge it soon.

3.0 is still in alpha so it will still be a while before it's ready for use on a production forum

Probably just a spammer account, I wouldn't pay too much attention to it

MissAllSunday avatar Mar 31 '25 15:03 MissAllSunday

Abuse reported.

Wildly inappropriate. First time I've seen anything like that on GH.

sbulen avatar Apr 01 '25 06:04 sbulen

@MissAllSunday, can you also ensure that the readme is updated with relevant information for those looking to start using the development version? Nothing fancy, I would add a bullet to the how to contribute section.

jdarwood007 avatar Apr 05 '25 14:04 jdarwood007

@Sesquipedalian @jdarwood007

How about this approach? essentially removing the Autoloader file and the need to call Integration classes and instead, add the autoloader logic inside the already established closure which already checks and loads all what we need for using composer's autoloader. Since autoloading happens quite early and its a special case, I don't think we need to fully load Integration class to handle it, I used the same approach we already used when loading integrate_pre_include hooks on Config.

Regarding autoloading own classes, the SMF namespace was moved to composer's configuration, meaning all classes that has that namespace will still be autoloaded just like it was before this change. If there is a class that doesn't use the SMF namespace or lives outside its scope then it will have to be changed or its unique namespace to be added to composer's autoload setting

MissAllSunday avatar Apr 25 '25 18:04 MissAllSunday

rebased against latest release-3.0

MissAllSunday avatar Jul 25 '25 19:07 MissAllSunday

#8801 adds another library. So, figuring this out is becoming more important. Hopefully, we can get it tagged to a milestone.

jdarwood007 avatar Jul 25 '25 21:07 jdarwood007

Figuring this out will be needed if we want psr interoperability.

On Fri, Jul 25, 2025 at 2:24 PM Jeremy D @.***> wrote:

jdarwood007 left a comment (SimpleMachines/SMF#8240) https://github.com/SimpleMachines/SMF/pull/8240#issuecomment-3120408916

#8801 https://github.com/SimpleMachines/SMF/pull/8801 adds another library. So, figuring this out is becoming more important. Hopefully, we can get it tagged to a milestone.

— Reply to this email directly, view it on GitHub https://github.com/SimpleMachines/SMF/pull/8240#issuecomment-3120408916, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADJNN7XG34PC2PPL5BHNFL3KKOCHAVCNFSM6AAAAABITMPHWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCMRQGQYDQOJRGY . You are receiving this because you commented.Message ID: @.***>

live627 avatar Jul 26 '25 10:07 live627

Figuring this out as in there is still something to be resolved on this PR?

MissAllSunday avatar Jul 28 '25 13:07 MissAllSunday

As in, getting this assigned to a milestone; sorry for not being clear there.

live627 avatar Jul 28 '25 13:07 live627

This branch and release-3.0 has diverged quite significantly so a rebase was causing a lot of problems, better start fresh so a new PR was submitted at: https://github.com/SimpleMachines/SMF/pull/9015

MissAllSunday avatar Oct 27 '25 18:10 MissAllSunday