Closed grebaldi closed 1 year ago
Seems like immutable js is already gone from the codebase. That'll make things easier :)
plow js is often used in the hoc @neos
decorators, if we get around writing stuff in hooks, then we dont need plow-js in these places anymore ;)
Bad News:
I've just noticed, that Plow is being leaked as API for Inspector Views. Here's an example:
https://github.com/neos/neos-ui/blob/8.3/packages/neos-ui-views/src/Data/ColumnView/index.js#L24
data
is a dot-separated path being passed plainly to the view that will read the respective value from the result of the data source. This will stop working, once Plow JS is removed.
We will need to support this use case, but that doesn't require the entirety of Plow. It's probably best to have a utility function native to the UI code base that can replace $get
for this purpose.
Plugin vendors using esbuild or the alias feature directly can, if they want to bundle plow-js directly (to avoid deprecation warnings), exclude plow-js from the map:
const {"plow-js": _, ...extensibilityMap} = require("@neos-project/neos-ui-extensibility/extensibilityMap.json");
build({
alias: extensibilityMap
})
Motivation
Once upon a time, I've decided to create PlowJS, a library that would ease the handling of immutable state within the redux reducers of the Neos UI.
It seemed like a good idea at the time, but the JavaScript ecosystem has changed drastically since (and not exactly in favor of such a solution :sweat_smile:).
There's several reasons why PlowJS has become a liability to the Neos UI code base:
The original purpose of PlowJS was to support the development of redux reducers. We already had a discussion about this a couple of years ago and decided to replace PlowJS with immer. Many (if not most) reducers have already been refactored since.
But PlowJS is being used everywhere because of it's convenient feature to hide the API of immutable-js from us.
The goal of this issue is therefore to remove both PlowJS and immutable-js entirely from the codebase.
Acceptance Criteria
Object.freeze
callsreadonly
-enforced TypingsReferences