primus: Predefine breaks compatibility with some plugins

Hi,

Commit ebc7a842815cd26a43c299ac8282a90d1dff42ad introduces a new way of defining setters and getters using the predefine module. However, some Spark methods, such as initialise have now been marked as read-only, which breaks plugins that rely on overrides to extend Spark (see primus-emitter, for instance).

There is also no way to properly extend Spark through plugins now (actually, Sparky), because it does not expose the extend method from predefine.

Personally, I like the way extend works on Backbone and it could be a neat way for plugins to add functionality to Spark in a simple and elegant form, but this would require a version bump.

What do you suggest in this case @3rd-Eden?

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 31 (23 by maintainers)

Commits related to this issue

Most upvoted comments

Using primus@7.0.2 and primus-emitter. Getting the following error.

var initialise = Spark.prototype.initialise; ^ TypeError: Cannot read property ‘prototype’ of undefined