Giter Club home page Giter Club logo

Comments (18)

bloodyowl avatar bloodyowl commented on May 13, 2024

I'd really say it depends on what you try to achieve. statinamic already seems opinionated on some parts, and I see it more like a boilerplate than a library. if you want to provide a way to manage data across components whatever the tree structure is in this boilerplate, then I'd say keep redux. If you want it to be more of a library, keep it minimal, and just use your own provider and decorator.

from phenomic.

MoOx avatar MoOx commented on May 13, 2024

Statinamic is a collection of lib + a boilerplate generator + docs: you start with a boilerplate that use statinamic libs to help you generate a website with react and webpack. So Statinamic is opininated because of these 2 things (react and webpack). Except that nothing is mandatory (no required structures etc).
You can use the webpack config you want, your own loader, and any npm module you want in your components.

There is a minimal boilerplate that is required to allow some flexibility (choose your styles flavor (inline, css modules, sass...) and I am currently writing a helper to generate the minimal required boilerplate.

The idea is to allow to create a website very easily with one command $ statinamic setup: this will generate the boilerplate that use Statinamic libs. The only things that Statinamic uses are:

  • a registry to access page data
  • a registry to get available pages layouts (component references) that can be used from md header

Not a lot of things, no user interaction. That's what I was thinking about using react context instead of redux. Currently there is already a context provider to share some metadata about your project (eg: package.json to get homepage url, stuff like that) and I was thinking about using it for all the shared (read only - or sort of) data. The only interaction is: you click on a link, if page data are not in the store, we fetch a json to get those.

from phenomic.

thangngoc89 avatar thangngoc89 commented on May 13, 2024

I use redux in almost every project so using redux is one the reasons why I use statinamic.

Also with redux, I can just add reducers that listen for default action of statinamic. Some example use cases: show a loading indicator when getting new page's info. show a error message when getting new page's info failed, ...

In the other hand, keeping redux would make statinamic too opinionated.

One more thing, if you decide to keep redux, you might need to use immutable.js (or similars) because redux store is holding all pages info which could lead to a performance issue on large page.

from phenomic.

MoOx avatar MoOx commented on May 13, 2024

show a loading indicator when getting new page's info. show a error message when getting new page's info failed, ...

I think thoses things should be possible without redux (and more easy to implement without using redux).

I will try to avoid redux and maybe will consider removing it.

from phenomic.

thangngoc89 avatar thangngoc89 commented on May 13, 2024

I think we should consider this again. I don't see the benefit of using redux anymore. We aren't modify anything in the state (just add more page).

This should be a good alternative solution
https://github.com/heroku/react-refetch

from phenomic.

MoOx avatar MoOx commented on May 13, 2024

I think we should not need anything if we remove redux. All the logic for downloading is in PageContainer, maybe we can make a simple fetch/registry directly in here for now. And that might help for hot loading md.

from phenomic.

thangngoc89 avatar thangngoc89 commented on May 13, 2024

It is your call. Removing redux would help us reduce the bundle size

from phenomic.

MoOx avatar MoOx commented on May 13, 2024

Totally. That's why I opened this issue in the first place :)

from phenomic.

thangngoc89 avatar thangngoc89 commented on May 13, 2024

So. Shall we change status of this issue ?

from phenomic.

MoOx avatar MoOx commented on May 13, 2024

Done :)

from phenomic.

thangngoc89 avatar thangngoc89 commented on May 13, 2024

I think that implement this would be easy, just mutate a window object. 💃

from phenomic.

MoOx avatar MoOx commented on May 13, 2024

An alternative http://madx.me/articles/a-simpler-alternative-to-flux-and-redux.html poke @madx

from phenomic.

arlair avatar arlair commented on May 13, 2024

I was investigating this tool to use with a MobX store app, so removing Redux is 👍 from me.

from phenomic.

MoOx avatar MoOx commented on May 13, 2024

Will be handled soon (hopefully)

from phenomic.

dab avatar dab commented on May 13, 2024

Any updates on this issue? It's really nice to have easy way to add your preferred state store. I'm also using mobx currently, and would like to add it to my static site app as well. It's not such simple to replace redux right now.
Thanks.

from phenomic.

MoOx avatar MoOx commented on May 13, 2024

I will try to work on that for the next release. Should not take that long.

from phenomic.

dab avatar dab commented on May 13, 2024

👍 thanks for the update

from phenomic.

bloodyowl avatar bloodyowl commented on May 13, 2024

Going to be fixed with #925

from phenomic.

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.