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

Changes to JSON structure #9368

Open
adamrusted opened this issue Aug 22, 2023 · 9 comments
Open

Changes to JSON structure #9368

adamrusted opened this issue Aug 22, 2023 · 9 comments
Labels
meta Issues or pull requests regarding the project or repository itself package Pull requests or issues that affect the NPM package

Comments

@adamrusted
Copy link
Member

As highlighted in #9358 the main JSON is getting pretty massive at this point.
I'm starting this issue to try and gather ideas on how we might mitigate that, at least from a development perspective.

My initial (somewhat selfish) idea was to split out into a JSON file per letter of the alphabet. This would make the letter-by-letter review approach of #9072 a lot easier - but I'm aware that might not be the best solution possible.

Another idea would be to have a folder structure along the lines of <brand>/<product line>/<product> - which would mean that for example:
At the brand level, we could have general guidance that applies to all 'Microsoft' or 'Apache' icons.
You then go further down into the product line - so in the Microsoft example, Office, Power Platform, or Azure - or with Amazon you can have Amazon brands, and AWS as a separate sub-folder.
Finally, you get to the product level, and this would simply be a single JSON per entry, so in the above example - Word, Excel, etc.
Anything defined further into the folder structure would override what is applied at a higher level (for example, if Word had a specific source / guidelines link different to the Microsoft, or even Office file, it would override when generating the JSON.

Unsure how either of these would play out with regards to bundling, but I'm assuming you could just add a 'build' step to generate one giant JSON based on everything found in the folder structure.

Would be great to get some discussion going on this issue - and see what ideas we can come up with!

@adamrusted adamrusted added help wanted meta Issues or pull requests regarding the project or repository itself package Pull requests or issues that affect the NPM package labels Aug 22, 2023
@mondeja
Copy link
Member

mondeja commented Aug 30, 2023

My initial proposal is to split by letter as you proposed and remove the icons property from the new files, then create a build script to distribute the JSON file as currently is, so we don't make breaking changes. And, in a breaking version, just remove the icons property from the distributed JSON file.

I feel that this change is to facilitate icon additions and reviews, because if we are talking about file size, the icons property removal should be the most obvious priority.

The product/subproduct/subsubsubsubs.... folders approach seems to me really confusing.

@adamrusted
Copy link
Member Author

adamrusted commented Aug 30, 2023

so structure would instead be:
data/a/icons.json, data/b/icons.json
with an array of objects, which we would compile into a single file at build-time?

@mondeja
Copy link
Member

mondeja commented Aug 30, 2023

I was thinking on _data/a.json, _data/b.json... with an array of objects which we would compile into a single file at build-time.

@quantumflo
Copy link
Contributor

I think _data/simple-icons/a.json, _data/simple-icons/b.json. Should we have a intermediary directory and then have json splitting inside it?

@LitoMore
Copy link
Member

LitoMore commented Sep 4, 2023

I prefer to create a simple web app for viewing the icon data.

The a.json, b.json confused me about these names: .ENV, /e/, 1001Tracklists.

Imagine we have 36 JSON files from 0 to 9 and from a to z.

@adamrusted
Copy link
Member Author

I would do as I've done with the reviews, and count all symbols and numbers as one entry. Comparatively, there are a lot fewer even combining them all.

@PeterShaggyNoble
Copy link
Member

One thing we could do to reduce the file size, at least, would be to remove all the www subdomains from all the URLs and add that to our linter.

We'd need to do a HEAD request for each one, though, to ensure it still returns a 200 OK status. I can easily throw together a script to run through the existing entries and do all that, but is our linting process capable of making external requests?

@adamrusted
Copy link
Member Author

The 'ourlint' is just a JS File - so using the native fetch API shouldn't be an issue

@PeterShaggyNoble
Copy link
Member

The 'ourlint' is just a JS File - so using the native fetch API shouldn't be an issue

CORS policies could be, though.

@service-paradis service-paradis pinned this issue Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Issues or pull requests regarding the project or repository itself package Pull requests or issues that affect the NPM package
Projects
None yet
Development

No branches or pull requests

5 participants