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

DEP Silverstripe CMS 5 compatibility #779

Conversation

GuySartorelli
Copy link
Contributor

@GuySartorelli GuySartorelli commented Feb 16, 2023

Replacement for #777
Rebased on master. This is the same code that is in the beta, but with references to silverstripe/silverstripe-fluent reverted back to tractorcow/silverstripe-fluent

CI is green in our fork: https://github.com/creative-commoners/silverstripe-fluent/actions/runs/4190234023

After merging

Ideally this would be tagged 7.0.0-beta1 - we can then (potentially) update our recipes to point back here instead of the fork - but even if we don't, it gives people the option of installing the beta of this module with the correct composer name.

Parent issue

These methods are not in use and have been deprecated since fluent 5.
@GuySartorelli
Copy link
Contributor Author

GuySartorelli commented Feb 16, 2023

Added one last commit to remove deprecated methods which were deprecated in fluent 5 and aren't called in any of the code in 6 or 7. The removal of these methods will be highlighted in the upgrade guide, when I write it.

@GuySartorelli
Copy link
Contributor Author

Not sure why scrutinizer is angry (can't install npm 18 for some reason?), but @tractorcow unless you've been regularly checking it I'd recommend either removing it entirely or, as a less drastic approach, accept the scrutinizer failure for this PR and handle that separately.

},
"scripts": {
"build": "NODE_ENV=production webpack -p --bail --progress",
"build": "yarn && yarn lint && rm -rf client/dist/* && NODE_ENV=production webpack --mode production --bail --progress",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the rm command present? I don't see this in any other modules, for example https://github.com/silverstripe/silverstripe-linkfield/blob/1/package.json#L20

Copy link
Contributor Author

Choose a reason for hiding this comment

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

linkfield isn't a supported module.
Look at any supported module's CMS 5 compatible version, e.g. https://github.com/silverstripe/silverstripe-subsites/blob/3.0/package.json#L4

It's to protect against old files from earlier builds sticking around (e.g. as a result of webpack copy), or from people putting things in dist manually. We should always be able to blow away dist and rebuild and nothing will be lost - this ensures that's always the case.

$newState->setLocale($locale);

$records = LocalisedParent::get()->sort(...$sortArgs);
if ($useOrderBy) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[nitpick] Use ternary operator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's subjective, so unless there's some specific standard that this module adheres to which requires the ternary here I'm inclined to not make this change in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree, hence the nitpick flag. Happy to keep it as is.

@mfendeksilverstripe
Copy link
Contributor

Left some comments but the changes look good so far 👍

@maxime-rainville
Copy link
Contributor

Just approved the build to run.

@tractorcow
Copy link
Collaborator

Merge at will. let me know if you need help releasing /etc.

@maxime-rainville maxime-rainville merged commit 91b834f into tractorcow-farm:master Feb 21, 2023
@maxime-rainville maxime-rainville deleted the pulls/master/cms5-compatibility branch February 21, 2023 21:10
@maxime-rainville
Copy link
Contributor

maxime-rainville commented Feb 21, 2023

I just:

  • merged the PR,
  • created 7.0 and 7 branch from master,
  • tagged a 7.0.0-beta1 from 7.0.

@tractorcow
Copy link
Collaborator

Nice job :D

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.

None yet

5 participants