Skip to content
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

Indent the JSON file with appsmith UI #110

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bkowshik
Copy link

@bkowshik bkowshik commented Jan 5, 2025

NOTE: This PR should be merged to main only after merging #109 and deleting the branch.


The purpose is to make diff on git / Github possible for the appsmith .json file. Currently, all of the app is just one line.

Ex: https://github.com/datakind/Data-Observation-Toolkit/pull/109/files

image

Not sure about what all needs to be considered before making this change though. Below is the size comparison and it looks OK to me given the advantages we get with git-diff.

# Since of the file before indentation.
$ ls -lh docker/appsmith/DOT\ App\ V2.json
-rw-r--r--@ 1 bkowshik  staff   882K Jan  5 15:12 docker/appsmith/DOT App V2.json

# Size of the file after indentation.
$ ls -lh docker/appsmith/DOT\ App\ V2.json 
-rw-r--r--@ 1 bkowshik  staff   2.8M Jan  5 15:12 docker/appsmith/DOT App V2.json

@bkowshik
Copy link
Author

bkowshik commented Jan 5, 2025

Completed the appsmith tutorial and the folder structure isn't one large .json file. Instead, the structure of the application is very clear from the folder structure and additional resources like queries / ui are also in the same folder. Don't know yet on how to move to such a setup, but I think having a structured folder would help make the codebase even more accessible to new contributors.

Ref: https://github.com/bkowshik/appsmith-tutorial

$ tree -L 4
.
├── README.md
├── application.json
├── datasources
│   └── usersTutorialDB.json
├── metadata.json
├── pages
│   ├── Account Details
│   │   ├── Account Details.json
│   │   └── widgets
│   │       ├── Button1.json
│   │       └── Text1.json
│   └── User Information
│       ├── User Information.json
│       ├── jsobjects
│       │   └── JSObject1
│       ├── queries
│       │   ├── JSObject1-getBackground
│       │   ├── Playground
│       │   ├── getUsers
│       │   └── updateUsers
│       └── widgets
│           ├── Button3.json
│           ├── userDetails
│           └── usersTable.json
└── theme.json

NOTE: Import from Git repository is in now Beta. 👏

image

@bkowshik
Copy link
Author

bkowshik commented Jan 6, 2025

Because of the indentation, PR reviews are significantly easier now. This is one commit where the query is modified and it's easy to see the diff because of the indented .json file of appsmith UI.

Ref: 2c218e8

Update

In addition, wrote the Appsmith code into this repository for reference: https://github.com/bkowshik/dot-ui It's significantly to view the pages, queries, etc in this structure instead of a giant .json file. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants