Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

RFC: Optimistic bundling revision #64

Open
digitalsadhu opened this issue Aug 28, 2018 · 0 comments
Open

RFC: Optimistic bundling revision #64

digitalsadhu opened this issue Aug 28, 2018 · 0 comments

Comments

@digitalsadhu
Copy link
Member

This issue proposes some fairly minor cleanup to the client APIs.

Use Case 1. Publishing assets to server using node client library

const assets = new Assets({ server: 'http://localhost:3031' });

assets.publish('<unique-id>', '/path/to/script.js'); // => publish completion promise 
assets.publish('<unique-id>', '/path/to/style.css'); // => publish completion promise

What's happening here:

  • constructor has been simplified, removal of asset definitions
  • buildServerUri simplified to just server
  • publish method added

Use Case 2. Command line asset publishing

May be implemented at some point

asset-pipe-cli --server=http://localhost:3031 publish <unique-id> </path/to/script.js>
asset-pipe-cli --server=http://localhost:3031 publish <unique-id> </path/to/style.css>

Use Case 3. Bundling assets using node client library

const assets = new Assets({ server: 'http://localhost:3031' });

assets.bundle.js('<unique-id>', '<unique-id>'); // => bundle completion promise
assets.bundle.css('<unique-id>', '<unique-id>'); // => bundle completion promise

assets.css(); // => promise resolving to best effort array of urls
assets.js(); // => promise resolving to best effort array of urls

What's happening here:

  • bundle namespace with js and css methods added for type specific bundling
  • bundling no longer requires a bundle tag/label, just the list of tags/labels to bundle
  • js and css methods added to ping the asset server for a list of urls. These urls will be best effort, meaning, if only some assets have been published, all available individual asset urls will be returned, if everything is published and bundling is finished then the array will only contain a single item, the url to the finished bundle
  • no hashes need be handled, these become internal only details

Use Case 4. Command line asset bundling

May be implemented at some point

asset-pipe-cli --server=http://localhost:3031 --js bundle <unique-id> <unique-id> <unique-id>
asset-pipe-cli --server=http://localhost:3031 --css bundle <unique-id> <unique-id> <unique-id>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant