itemconsulting / enonic-fp Goto Github PK
View Code? Open in Web Editor NEWFunctional programming helpers for Enonic XP
License: MIT License
Functional programming helpers for Enonic XP
License: MIT License
Add TypeScript wrappers for
When part of a pipeline, ContextLib.run
should be able to take the parameters piped in, and pass it on to the inner function.
We know that Content.page.config
is of the type generated by enonic-wizardry. We should be able to give that type up front.
Give Content.publish
a type too.
Either add http status to EnonicError
, or add a function that does the mapping.
Make the mapping between Throwable
from Java, and EnonicError
better
Throwable
stackTrace
field to EnonicError
The following fields in Request
should be able to be undefined
, to force the developer to handle the undefined
case:
To follow best practices for FP, data should be immutable by adding readonly
to properties. And use ReadonlyArrays
.
Add an unsafe version, that can be used when rendering error pages.
If the rendering fails, and we return a Either<EnonicError, T>
, we can end up with a endless loop, and stack overflow.
It's a bit funky, but we'll give it a shot.
Because of naming conflicts, it might make coding nicer, if we change the names of the interfaces in common.
Error
(biggest problem, since there is a global Error
already)Response
Request
EnonicError
-objects can be extendedreq.mode === 'live'
"BadRequestError"
should be able to hold an object of this shape with its errors
{
"firstName": ["Is required", "Must be capitalized"]
}
The functions in the Enonic libraries that would return void, should now return Either<Error, void>
instead of Either<Error, boolean>
Require count to be specified, since the default is 10 (and this can create bugs)
When parsing exceptions we should extract the stack trace from it if the stack trace exists.
We should look into how we want to return the errors from validation. Maybe the cause
field should be able to take a datastructure containing the errors.
To make the functional actually be pure, we should returns IOEither
, since we are actually doing IO operations.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.