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

Stop bundling Mopidy.js #1460

Closed
jodal opened this issue Feb 22, 2016 · 1 comment
Closed

Stop bundling Mopidy.js #1460

jodal opened this issue Feb 22, 2016 · 1 comment
Assignees
Milestone

Comments

@jodal
Copy link
Member

@jodal jodal commented Feb 22, 2016

I propose that as of Mopidy 3.0 we stop bundling Mopidy.js.

There are several arguments supporting this:

  • There is no huge benefit in shipping Mopidy with a "compatible" Mopidy.js, as we have never broken the WebSocket API in the more than three years since introducing it. All released versions of Mopidy.js still works with the latest Mopidy release, AFAIK.
  • Modern web stacks provides proper dependency management through npm and builds single-file app bundles using Browserify or Webpack. Including the Mopidy.js we ship with a tag in your HTML is increasingly rare.
  • Breaking the API of a bundled Mopidy.js immediately breaks all clients using it that have not been updated accordingly. By not providing a version of Mopidy.js bundled with Mopidy all clients have to ship their own copy and decides themselves when to upgrade to a newer version of Mopidy.js. Thus, we're free to make new releases of Mopidy.js, including breaking changes like changing the default calling convention or replacing when.js with standard ES6 Promises and Bane with a standard EventEmitter. A lot has happened in the JavaScript world since Mopidy.js was conceived.
  • Given the source of the mopidy Debian package, you cannot rebuild the bundled Mopidy.js JavaScript files, thus breaking Debian policy. To package this properly, Mopidy.js would have to be packaged as its own Debian package which builds Mopidy.js from source. However, the Grunt and Browserify build tools are not currently packaged in Debian, so this isn't straight forward. I've looked into simplifying the build, maybe using browserify-lite (which is packaged) but it's hard to accomplish this and keep the module working in both the browser and on Node.js.

Status of known/popular clients:

  • Mopidy-API-Explorer: Uses our bundled mopidy.js. Needs to be changed before Mopidy 3. See dz0ny/mopidy-api-explorer#2.
  • Mopidy-Mobile: Installs Mopidy.js from npmjs.org using Bower.
  • Mopidy-Moped: Vendors mopidy.js into its own source tree.
  • Mopidy-Mopify: Vendors mopidy.js into its own source tree.
  • Mopidy-Musicbox-Webclient: Uses our bundled mopidy.js. Needs to be changed before Mopidy 3. See pimusicbox/mopidy-musicbox-webclient#175.
  • Mopidy-Party: Uses our bundled mopidy.js. Needs to be changed before Mopidy 3. See Lesterpig/mopidy-party#21

Other than updating clients using the bundled copy, we need to:

  • Update Mopidy.js' README.
  • Make a new release to npmjs.org with said README.
  • Decide if we're just going to release to npm, or if we need to provide ready-built JS files e.g. via GitHub Releases. For simplicity, I'd like to start with just npm.
  • Update the https://docs.mopidy.com/en/latest/api/js/#getting-the-library-for-browser-use docs section accordingly.
  • Update MopidyAppTest.test_should_return_static_files to use another file for the test.
  • Remove bundled files in mopidy/http/data.
@jodal

This comment has been minimized.

Copy link
Member Author

@jodal jodal commented Oct 3, 2018

Mopidy.js readme has been updated to not refer to files included in Mopidy or hosted by Mopidy.

The built files has been uploaded to Mopidy.js' GitHub releases page.

A new release to npm has not been made, as the build system is so outdated that I can't even manage to install it.

@jodal jodal self-assigned this Oct 3, 2018
jodal added a commit to jodal/mopidy that referenced this issue Oct 3, 2018
jodal added a commit to jodal/mopidy that referenced this issue Oct 3, 2018
jodal added a commit to jodal/mopidy that referenced this issue Oct 3, 2018
@jodal jodal closed this in #1708 Oct 4, 2018
Lesterpig added a commit to Lesterpig/mopidy-party that referenced this issue Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.