Comments (18)
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.
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.
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.
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.
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.
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.
It is your call. Removing redux would help us reduce the bundle size
from phenomic.
Totally. That's why I opened this issue in the first place :)
from phenomic.
So. Shall we change status of this issue ?
from phenomic.
Done :)
from phenomic.
I think that implement this would be easy, just mutate a window object. 💃
from phenomic.
An alternative http://madx.me/articles/a-simpler-alternative-to-flux-and-redux.html poke @madx
from phenomic.
I was investigating this tool to use with a MobX store app, so removing Redux is 👍 from me.
from phenomic.
Will be handled soon (hopefully)
from phenomic.
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.
I will try to work on that for the next release. Should not take that long.
from phenomic.
👍 thanks for the update
from phenomic.
Going to be fixed with #925
from phenomic.
Related Issues (20)
- [plugin-rss-feed] Permalinks don't match posts' routes. HOT 5
- Avoid `.json` files for static output HOT 5
- Components map only works with explicit closing tags (when using multiple adjacent component instances)
- No runtime script? HOT 1
- markdown header causes react error HOT 1
- Nuke current db/api and move as a fs-as-database package HOT 1
- accessing window.location HOT 1
- Pages Rendered From Markdown HOT 6
- Webpack with MiniCssExtractPlugin results in a blank page HOT 1
- Failing CI
- Content not loading in browser HOT 4
- Components with hooks fail phenomic build process HOT 2
- Error with oniguruma during installation of preset-react-app on MacOS with Nix and Yarn HOT 13
- [Feature] Update reason-react to jsx 3 HOT 6
- Page 3 of tutorial is not correct HOT 1
- Content node collections should optionally include node bodies HOT 1
- Cannot Serve First Page HOT 3
- Doesn't build on macOS Catalina HOT 1
- Possible roadmap for future releases HOT 7
- Pheunomic.io is not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phenomic.