new-xkit / XKit

Fork of XKit, the extension framework for Tumblr
https://new-xkit-extension.tumblr.com
Other
459 stars 135 forks source link

Re-evaluate how distribution files are organized #364

Open 0xazure opened 9 years ago

0xazure commented 9 years ago

The Extensions/dist/ directory is starting to get a little messy, especially once #340 is merged and we start building themes from source. We've currently got a lot of files, and some that probably don't belong with <extensionId>.json files.

This may be a little tricky because we're still supporting fallback URLs to the old XKit servers, so major changes to directory hierarchy will have to be evaluated in the context of that continued support, unless we decide enough time has passed to remove the fallback.

I am of the opinion that the 'distribution' files should be more separate from their source counterparts. I would propose a filesystem hierarchy like the following:

.
├── Chrome/
├── Extensions/
├── Firefox/
├── Themes/
├── dev/
├── dist/
│   ├── extensions/
│   │   ├── accesskit.json
│   │   /* ... */
│   │   └── xwidgets.json
│   ├── framework_version.json
│   ├── gallery.json
│   ├── list.json
│   ├── paperboy.json
│   └── themes.json
/* ... */
└── xkit.js

If we do end up removing the fallback, it would be a good opportunity to clean up some of the distribution files:

I also think it would be a good idea to align how Extensions and Themes are organized. That means, essentially, instead of serving a single themes.json file that contains the entirety of every theme's CSS, we split the themes into separate .json files and have a gallery.json-like file that lists available themes. This would, of course, require changes to themes.js and how it loads themes.

Wolvan commented 9 years ago

:+1:

hobinjk commented 9 years ago

All of this looks good to me. I definitely approve of splitting themes.json in the future. The useless keys are a holdover from old XKit that would need the corresponding logic removed.

nightpool commented 9 years ago

I agree with everything here except removing framework_version. ideally that should be updated by gulp, no?

browsers are bad and inconsistent. firefox auto-update is going to be weird in the future and I think require infrastructure on our part anyway because we're a hidden extension and I don't know if safari auto-updates at all or what the deal is there.

0xazure commented 9 years ago

I've definitely changed my stance on framework_version.json since I've been made aware of how we're going to be handling the Firefox situation going forward. I agree that we'll need some kind of mechanism for letting users know that there's an update they need to download.

Conceivably, we could join everything into a single file with a Gulp task and then have XKit download and cache the data in localStorage, as long a we have mechanisms both on the server (timestamping / cache busting) and client side (user-accessible force-update buttons) to force an update.