{"action":"created","issue":{"url":"https://api.github.com/repos/jsdrupal/drupal-admin-ui/issues/476","repository_url":"https://api.github.com/repos/jsdrupal/drupal-admin-ui","labels_url":"https://api.github.com/repos/jsdrupal/drupal-admin-ui/issues/476/labels{/name}","comments_url":"https://api.github.com/repos/jsdrupal/drupal-admin-ui/issues/476/comments","events_url":"https://api.github.com/repos/jsdrupal/drupal-admin-ui/issues/476/events","html_url":"https://github.com/jsdrupal/drupal-admin-ui/issues/476","id":360208100,"node_id":"MDU6SXNzdWUzNjAyMDgxMDA=","number":476,"title":"Decide on API for including third party JS libraries","user":{"login":"mspae","id":1044829,"node_id":"MDQ6VXNlcjEwNDQ4Mjk=","avatar_url":"https://avatars0.githubusercontent.com/u/1044829?v=4","gravatar_id":"","url":"https://api.github.com/users/mspae","html_url":"https://github.com/mspae","followers_url":"https://api.github.com/users/mspae/followers","following_url":"https://api.github.com/users/mspae/following{/other_user}","gists_url":"https://api.github.com/users/mspae/gists{/gist_id}","starred_url":"https://api.github.com/users/mspae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mspae/subscriptions","organizations_url":"https://api.github.com/users/mspae/orgs","repos_url":"https://api.github.com/users/mspae/repos","events_url":"https://api.github.com/users/mspae/events{/privacy}","received_events_url":"https://api.github.com/users/mspae/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-14T08:35:01Z","updated_at":"2018-09-14T12:15:37Z","closed_at":null,"author_association":"NONE","body":"Contrib modules should be able to build their own backend config pages in addition to extending existing config pages. They should be able to define their dependencies so they can be used as (modern) JS developers are used to with import or require statements.\r\n\r\nHowever, we don’t want to add a dependency for node and this limits our ability to use modern build tools somewhat. Contrib module developers can be expected to have a node installation in order to build the JS bundles for their module but we want to have the ability to use third-party libraries that can be reused by other modules.\r\n\r\nThe following solutions are a possibility (please correct and add to this list):\r\n \r\n1. **Drupal does come with a dependency to node** This is by far the most painless for development at this point, however, it does mean that millions of site maintainers will need to install/or enable node on their installations. This conflicts with our goal of implementing a decoupled backend with minimal friction from the community.\r\n2. **Provide a remote service for bundling of assets** As this is quite a performance intensive task this wouldn’t be trivial (in addition to rate limiting and security aspects)\r\n3. **\"Rebuild node in PHP\"** or at least provide an intelligent bundling script for JS - This is not really feasible\r\n4. **Modules define their third-party dependencies**, Drupal makes sure they are exposed as global properties on the correct pages and the build (probably webpack) config of the module takes care that imports to that lib are resolved in this way. (See [the webpack external feature documention](https://webpack.js.org/configuration/externals/) – It would make sense to use [the Libraries API](https://www.drupal.org/docs/8/modules/libraries-api-8x) for this"},"comment":{"url":"https://api.github.com/repos/jsdrupal/drupal-admin-ui/issues/comments/421340409","html_url":"https://github.com/jsdrupal/drupal-admin-ui/issues/476#issuecomment-421340409","issue_url":"https://api.github.com/repos/jsdrupal/drupal-admin-ui/issues/476","id":421340409,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTM0MDQwOQ==","user":{"login":"mspae","id":1044829,"node_id":"MDQ6VXNlcjEwNDQ4Mjk=","avatar_url":"https://avatars0.githubusercontent.com/u/1044829?v=4","gravatar_id":"","url":"https://api.github.com/users/mspae","html_url":"https://github.com/mspae","followers_url":"https://api.github.com/users/mspae/followers","following_url":"https://api.github.com/users/mspae/following{/other_user}","gists_url":"https://api.github.com/users/mspae/gists{/gist_id}","starred_url":"https://api.github.com/users/mspae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mspae/subscriptions","organizations_url":"https://api.github.com/users/mspae/orgs","repos_url":"https://api.github.com/users/mspae/repos","events_url":"https://api.github.com/users/mspae/events{/privacy}","received_events_url":"https://api.github.com/users/mspae/received_events","type":"User","site_admin":false},"created_at":"2018-09-14T12:15:37Z","updated_at":"2018-09-14T12:15:37Z","author_association":"NONE","body":"Yes, will do 👍 and share my results here."}}
{"actor":{"display_login":"mspae"}}