Giter Club home page Giter Club logo

Comments (7)

dimaip avatar dimaip commented on May 14, 2024

💯

So we won't call this API layer directly in React components, but rather in async action creators, right?

Sidenote: to leverage full potential of Redux, we can try to put as few logic as possible on React side (even in containers) and rather create meaningful action creators + selectors, and bind them in @connect.

from neos-ui.

Inkdpixels avatar Inkdpixels commented on May 14, 2024

Right, the points you've mentioned: 👍

from neos-ui.

Inkdpixels avatar Inkdpixels commented on May 14, 2024

Note for later use: For JSON scheme validations we could use https://github.com/hapijs/joi

from neos-ui.

Inkdpixels avatar Inkdpixels commented on May 14, 2024

Though I could see a stream based API as a more future proof solution, for example if you want to retrieve bunch of nodes and want to process them one node at a time(faster rendering), I think we should start small. So here comes a small and simple API draft.

// Needs to be set initially, otherwise the API throws errors.
window.neos.setCsrfToken('myToken');

// Retrieve a node, returns a promise.
window.neos.node('path/to/my/node').get().then(nodeData...);

// Set data of a a node, returns a promise as well.
window.neos.node('path/to/my/node').set({
    data...
}).then(newNode).catch(e);

I think this will cover pretty much everything, except one thing. We still need events in some way, since inspector editors/wizards will set data of nodes and this needs to be reflected in the main UI (publish dropdown f.e.). Currently I don't know if events will be a good solutions for this, since I don't want us to create a big event mess in bigger UIs with a lot of custom inspector editors. And thats why I was thinking about streams as well...

Would love some feedback on this @dimaip @grebaldi @skurfuerst

from neos-ui.

dimaip avatar dimaip commented on May 14, 2024

How do we get multiple nodes with such API? E.g. to render a list of nodes, or render a tree of nodes.
How would you fetch nodes in different context?
Remind me, why do we identify nodes by path and not by id+context?
I think @kitsunet should have an opinion about this one too.

from neos-ui.

kitsunet avatar kitsunet commented on May 14, 2024

nodeData this is a defined name on the PHP side, for clarity sake it should never appear in the client please.

Path is important if you moved nodes and work with structure. Basically on a structural level you will want to deal with paths (child named "foo" of parent "/sites/mysite/home/" etc.) and on a technical level you might want or need to work with identifiers to keep same stuff together across dimensions and workspaces (like references, I reference a specific node and the only valid replacement for other dimensions is a node iwth the same identifier regardless of the path).

from neos-ui.

skurfuerst avatar skurfuerst commented on May 14, 2024

we won't do this now (before 1.0.0); maybe lateron based on Graphql

from neos-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.