-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Roadmap for v2 #11
Comments
Work steps:
|
I think base16 is too old, but mui is a whole package solution. I suggest use tailwindcss (a popular libaray to build style https://tailwindcss.com/ ), it is better choice , better to custom style, especially json-viewer use key-render and value-render. |
I was coding these days. I think we just need https://mui.com/system/getting-started/overview/ for the styling system. We don't need much more CSS, either in mui or tailwinds. |
Is there a plan, or desire, to add a prop that collapses the entire tree by default? (Like the "collapsed" prop in react-json-view.) |
you can archive this by setting defaultInspectDepth and maxDisplayLength to a large number. I'm not sure how entire you want for a tree. I think that will be enough for a screen |
Also, we could support defaultInspect=" * " to expand all key-value |
That's an interesting idea. (defaultInspect="*"). I had tried defaultInspectDepth but it didn't seem to work. I hadn't looked at the code before, but just did. Maybe I'm missing something, but it looks like createJsonViewerStore ignores the props for defaultInspectDepth? |
I see. It's a mistake. I will open a pr |
Is this a thread where we can discuss additional features? If so, I would be interested in:
[EDIT NOTE: ability to sort alphabetically exists already: |
Is there an API or Options doc page for all of these settings? |
No doc for now, but you can read all types on here https://github.com/TexteaInc/json-viewer/blob/main/src/type.ts |
Maybe put a link to that in the README as a "v1.0" of the "docs"?
Greg Fenton.
…On Tue., Nov. 8, 2022, 19:41 Himself65, ***@***.***> wrote:
you can archive this by setting defaultInspectDepth and maxDisplayLength
to a large number.
Is there an API or Options doc page for all of these settings?
No doc for now, but you can read all types on here
https://github.com/TexteaInc/json-viewer/blob/main/docs/pages/full/index.tsx
—
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBUCB45H5V4Y2KTBJWRF23WHLXLNANCNFSM574VIONA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@himself65 Using a MUI would add a lot of dependencies for people who are using alternative frameworks like http://chakra-ui.com. Any thoughts? |
This is a tough question for any component library. I think abstracting a UI-replaceable component library is kind of hard for now. But we could export an unstyled JSON-viewer component in the future, for example import { withStyledJsonViewer } from '@textea/json-viewer'
const StyledJsonViewer = withStyledJsonViewer({
Box: (props) => (<Box /* you handle the props to a third-party UI library*/></Box>)
})
// or even further, we port the UI to other library like tailwind css, or chakra ui
import { withStyledJsonViewer, TailwindCSSMixture } from '@textea/json-viewer'
const TailWindCSSJsonViewer = withStyledJsonViewer(TailwindCSSMixture) |
This might be a V3 roadmap, I think. Because we need to rewrite the whole code again to remove the UI hard binding! |
About 97% BUNDLE SIZE is mui . |
hey, I cannot find it that easy but:
and... thank you for your effort! |
Can be a good idea to replace EditFor state management, Atoms approach is faster than Flux and Proxy ones because is closer to the React state (source).
Related PR #167 FYI @himself65 |
I wonder, this lib is expected to be a simple component plugin to display JSON view, so there is no need of global state management lib. In my use case, I didn't use |
I was having the same problem and resolved it by adding |
Thanks for the reply but I have no longer maintain this project since Textea CEO has had arrears in the salary since three months ago |
our
@textea/json-viewer
is based on mac-s-g/react-json-view, which haven’t been maintained since about 2 years ago. Also, the way of writing a react component has changed since then.So, in
v2
version, we will firstly rewrite the whole project usingTypeScript
andReact Hooks
.Secondly, our team’s product(closed alpha for now) is also using
json-viewer
, we need customize json style in many cases. We need also improve the styling system, my currently plan is to use@mui/material
which is a popular library.Third, is store, I’ve read the whole source code, the previous author stores a value using like
globalStore.set/get(randomID, key, value, defaultValue)
(https://github.com/mac-s-g/react-json-view/blob/master/src/js/stores/ObjectAttributes.js). Also, in many cases, many fields likedefaultValue
are bypass through the whole component lifecycle. We need refactor this part into a lightly structure usingReactContext
,Zustand
.What’s more, a guy suggests me to support plugin system. I’m also thinking this at the beginning. I would prefer a API like:
What’s more, I don’t want it just stop by a JSON viewer. In a real production, we will have many class instance or something more than a string, like images.
P.S. This is inspired by https://www.npmjs.com/package/typeson
Related Issues
react-base16-styling
#10The text was updated successfully, but these errors were encountered: