Coder Social home page Coder Social logo

plexusjs / plexus Goto Github PK

View Code? Open in Web Editor NEW
15.0 0.0 0.0 6.91 MB

The monorepo for @PlexusJS packages, tools and docs

Home Page: https://plexusjs.org/

License: MIT License

JavaScript 7.86% TypeScript 87.77% Handlebars 4.37%
http-client react reactive state-management global plexus single-source-of-truth ssot state-machine plexusjs

plexus's People

Contributors

dependabot[bot] avatar itsrems avatar pckool avatar philippe-solosegment avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plexus's Issues

Batch calls in actions

Within an action, we should have functionality to keep track of the watchable items in the action. Batch the job under an ID. when that action is complete, keep track of the id. Then let the user choose to go back one or many batches

Add a `useAPI()` hook

We could create a useAPI() hook for react that accepts an APIInstance and returns similar results to the library 'react-query'. We could return the data from the query, plus things like isLoading or isError, and remove the properties related to the request status. Not sure about that last part lol.

React Hydration error

There is a hydration error when using plexus with nextjs+react. If you try using a plexus value exported from the usePlexus hook directly in the template of a React component, it will throw a hydration error. This could be fixed by utilizing the useState hook better inside usePlexus.

Add a "pending tasks" functionality to api

It would be cool if we could add a queue to api to hold api calls until a condition is met (a function is called, or maybe some programmatic condition is met). Would be useful for parallel batch api calls

React 18 Support `Missing useSyncExternalStore` on initial render.

There is an issue caused by the new changes for react 18 concurrent rendering support. On the initial render of an app (tested with a nextjs SSR application) a critical error is thrown stating the app will re-rendered client side only due to this missing hook.

This is caused by the returned values not being memoized. The array syntax works fine when given a mutable array to edit (this way the array reference remains constant), but the single array syntax breaksdown when using groups, selectors, etc.

PreAction!

A PreAction is a special type of action that ensures it has run before any other action can execute. These will attempt to run on runtime initialization.
This could be useful for authentication token refreshes on initial app load.

Vue Support

We should definitely have Vue support! This should be built as a plexus package under the path /plexus/packages/plexus-vue/
It should be built with the same general structure as @plexusjs/react.

Supported Versions

  • v2.x
  • v3.x

Linked Actions

Allow users to define a link name when creating actions addLink(). This is a feature that could be used for reacting to when an action in a link group is run

deepMerge not merging arrays with existing arrays

I was trying to merge an array w/ a existing array on the source but it doesn't seem to merge :(

code

deepMerge({
  extract: {
    include: [
      'test/**/*.{js,ts,jsx,tsx,css}',
    ]
  }
}, {
  extract: {
    include: [
      'src/**/*.{js,ts,jsx,tsx,css}',
    ]
  }
});

output
image

Add back an API class to consume in route

Give the option to create master API "classes" to be used with older projects.

This should contain all the error handling / request features / options, and be used by routes

API call blocking

There should be an option when setting up an API instance that allows you to only have 1 call at a time (no concurrent calls). This could be useful for API calls in react "useEffects". "useEffect" is called twice on component mount unless you turn it off by disabling strict mode or by adding a state you use to keep track of loading state.

Make a plugin that extends the output classes and the inner options

An example of this would be an extension plugin for state that allows you to have new options under state when you bass it a boolean (ex. toggle)

// ...
const value = state(false)

// we should make a plugin that can extend state when it detects a boolean type

value.toggle() // this is not a method on StateInstance, but we could extend it so it could be when we recognze a boolean

add sorting to collections and groups

You should be able to sort the data in a collection or a group. When you define a sort on the collection instance, it is the default sorting pattern for all groups. If you redefine the group instance's sort, it will be applied only to that sort.

Instance function should allow for a name to be passed

If we have the instance function accept a name parameter, we can have plugins create their own instance (if they want) that runs in parallel with the master instance. Maybe we should have a master conductor that connects them all? Or a master runtime that consumes all of their emits?

WatchableMutable History

Add Methods and Props to watchable mutable to add history to all plexus instances that inherit this primitive. This should have configurable history length.

Computed State

There needs to be a computed state function that automatically invokes itself when hoisted to an instance.
It should also accept dependencies that can either be a collection, collection data, state, or an event.

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.