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

!!!TASK: Remove plow-js #3306

Merged
merged 19 commits into from
Nov 9, 2023
Merged

Conversation

grebaldi
Copy link
Contributor

@grebaldi grebaldi commented Dec 22, 2022

solves: #3118

I'm moving from package to package. Until the last package is finished, this remains a WIP.

TODOs

  • Remove plow-js from @neos-project/neos-ui-sagas
  • Remove plow-js from @neos-project/neos-ui
  • Remove plow-js from @neos-project/neos-ui-backend-connector
  • Remove plow-js from @neos-project/neos-ui-ckeditor5-bindings
  • Remove plow-js from @neos-project/neos-ui-contentrepository
  • Remove plow-js from @neos-project/neos-ui-editors
    • RichTextEditor causes UI crash when formattingOptions are not configured (unrelated to this PR) -> this needs more testing once it works properly
      • Nope, that was me. Missed an optchain 🙈
    • Don't know how to test MasterPluginEditor
    • Don't know how to test PluginViewEditor
    • Don't know how to test PluginViewsEditor
      • This one also doesn't seem to show up when configured (unrelated to this PR)
    • Don't know how to test CreateNew decorator
    • Don't know how to test LinkInputOptions -> possibly dead code?
  • Remove plow-js from @neos-project/neos-ui-guest-frame
  • Remove plow-js from @neos-project/neos-ui-inspector
  • Remove plow-js from @neos-project/neos-ui-redux-store
    • This function is particularly problematic:
      // TODO: deprecate
      export const getPathInNode = (state: GlobalState, contextPath: NodeContextPath, propertyPath: any) => {
      const node = $get(['cr', 'nodes', 'byContextPath', contextPath], state);
      return $get(propertyPath, node);
      };
      • I'll do the following:
        • As it is stated in the TODO comment, I will add a deprecation warning (via console) for any caller of this function
        • Remove the plow-js $get reference while retaining the functionality of getPathInNode through a manual replacement implementation
        • Remove/Replace all references to getPathInNode from the Neos UI code base
        • Change the TODO comment, so it states that getPathInNode is up for removal in v10
  • Remove plow-js from @neos-project/neos-ui-validators
  • Remove plow-js from @neos-project/neos-ui-views
  • Remove plow-js from @neos-project/react-ui-components
  • Rebase on 9.0, once present

@grebaldi grebaldi linked an issue Dec 22, 2022 that may be closed by this pull request
8 tasks
@grebaldi grebaldi force-pushed the task/3118/remove-plow-js branch from 7020c93 to 8603b0c Compare December 22, 2022 16:32
@grebaldi grebaldi force-pushed the task/3118/remove-plow-js branch from 10dd28a to 4d1baf9 Compare December 26, 2022 13:41
@grebaldi grebaldi force-pushed the task/3118/remove-plow-js branch from 6cc67f9 to 9a47f88 Compare December 26, 2022 17:18
@mhsdesign
Copy link
Member

mhsdesign commented Jan 30, 2023

we could also merge this into 8.3 already and remove the extensibility export of plow starting with 9.0 ...

and due to plows frequent usage, the neos extensibility api could augment all plow methods with a deprecated warning, so plugin authors and users know what to expect with neos 9 :)

@@ -249,6 +249,8 @@ public function getDisallowedProperties(NodeInterface $node): array
};

$disallowedProperties = array_filter(array_keys($node->getNodeType()->getProperties()), $filter);
$disallowedProperties = array_values($disallowedProperties);
Copy link
Member

Choose a reason for hiding this comment

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

hi :D why has this been added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

array_filter leaves keys intact. Through json_encode this can lead to arrays being serialized as objects. array_values makes sure that we always end up with a strictly numerical array.

@mhsdesign
Copy link
Member

id like to merge this before we tackle: #3217 as there will be (some easy to fix) merge conflicts. Im planning the css rename for 8.3 ...

also the earlier we merge, the more we can test ^^

@mhsdesign
Copy link
Member

#3304 will result in a small merge conflict ;)

@mhsdesign
Copy link
Member

it was discussed that PluginViewEditor will be deprecated with 8.3

@mhsdesign
Copy link
Member

will resolve merge conflicts

@github-actions github-actions bot added the 8.3 label Mar 10, 2023
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import {produce} from 'immer';
import mapValues from 'lodash.mapvalues';
import {connect} from 'react-redux';
import {$get, $contains, $set} from 'plow-js';
Copy link
Member

Choose a reason for hiding this comment

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

biggest merge conflict was in this file (packages/neos-ui/src/Containers/RightSideBar/Inspector/index.js)

because of @JamesAlias and @markusguenther work

#3304
#2989

Copy link
Member

Choose a reason for hiding this comment

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

As you @grebaldi also did some refactoring here (extract preprocessViewConfiguration into evaluateExpression), i suspect we need to migrate this file again and start fresh

Comment on lines 26 to 38
const addPlugin = (Plugin, isEnabled) => (ckEditorConfiguration, options) => {
// we duplicate editorOptions here so it would be possible to write smth like `$get('formatting.sup')`
if (!isEnabled || isEnabled(options.editorOptions, options)) {
ckEditorConfiguration.plugins = ckEditorConfiguration.plugins || [];
return $add('plugins', Plugin, ckEditorConfiguration);
return {
...ckEditorConfiguration,
plugins: [
...(ckEditorConfiguration.plugins ?? []),
Plugin
]
};
}
return ckEditorConfiguration;
};
Copy link
Member

Choose a reason for hiding this comment

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

Highlighting this addPlugin utility function for everyone migrating $add to normal js

@markusguenther markusguenther changed the base branch from 8.3 to 9.0 April 11, 2023 11:29
@grebaldi
Copy link
Contributor Author

grebaldi commented May 3, 2023

Just noticed potential conflict with #3478 (I think #3478 should take precedence)

@grebaldi grebaldi marked this pull request as ready for review September 28, 2023 16:30
@grebaldi grebaldi changed the title WIP: !!!TASK: Remove plow-js !!!TASK: Remove plow-js Sep 28, 2023
Copy link
Member

@mhsdesign mhsdesign left a comment

Choose a reason for hiding this comment

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

I did a full "by reading" review of this once and now seeing that the e2e tests also succeed i give this green light ;)

# Conflicts:
#	Classes/Service/NodePolicyService.php
#	packages/neos-ui-sagas/src/Changes/index.js
#	packages/neos-ui-sagas/src/Publish/index.js
#	packages/neos-ui/src/Containers/PrimaryToolbar/PublishDropDown/index.js
Copy link
Member

@markusguenther markusguenther left a comment

Choose a reason for hiding this comment

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

Updated the PR and resolved conflicts. Also tested the PR locally. Thanks to @grebaldi for all the work.

@markusguenther markusguenther force-pushed the task/3118/remove-plow-js branch from 87fa293 to f34f62c Compare November 9, 2023 13:48
@mhsdesign mhsdesign merged commit 66889e3 into neos:9.0 Nov 9, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Remove PlowJS & immutable-js
3 participants