Coder Social home page Coder Social logo

strophejs-plugin-ping's People

Contributors

extempl avatar flosse avatar jcbrand avatar langpavel avatar lboynton avatar learts avatar reflex-gravity avatar stoyandimov avatar sualko avatar tari avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

strophejs-plugin-ping's Issues

Plugin is declared incompatible with strophejs 2.x

strophejs 2.0.0 was just released, which increments the major version but doesn't appear to contain any API changes that would break this plugin. Since this currently declares a peer dependency on strophe.js ^1, dependency resolution does not permit upgrade of strophe.js.

I think the most reasonable solution is to update the peer dependency to be ^1.2.12 || ^2.0.0 to accept new 2.x versions of strophe while continuing to assume that post-2.x versions might break the plugin (requiring updates for any future major versions). Alternately, use >=1.2.12 to be optimistic that no future version of Strophe will break this plugin.

Dependency name in AMD module is inconsistent with NPM package name

The only external dependency for this package is (no surprise) Strophe.js.

NPM package for Strophe.js is named strophe.js and it is correctly referenced in the package.json file. At the same time, the AMD module dependency is referenced as strophe.

The problem with it is that actual applications have to make aliases from strophe.js to strophe in order to make it find the correct dependency. Converse.js does it in its RequireJS configuration file.

For Webpack bundles it forces application developer to use resolve.alias in order to alias strophe.js as strophe. (See my demo).

It is quite inconvenient because it requires extra configuration for the plugin user application to get started with something which builds correctly.

At the same time it is not needed anymore if you just replace strophe with strophe.js on the dependency list:

diff --git a/strophe.ping.js b/strophe.ping.js
index d1f0b33..3a94315 100644
--- a/strophe.ping.js
+++ b/strophe.ping.js
@@ -15,7 +15,7 @@
     if (typeof define === 'function' && define.amd) {
         // AMD. Register as an anonymous module.
         define([
-            "strophe"
+            "strophe.js"
         ], function (Strophe) {
             factory(
                 Strophe.Strophe,

It works no worse with Webpack and I believe other bundlers will not be a problem too.

This problem exists with other Converse.js dependencies too, including strophejs-plugin-vcard, strophejs-plugin-disco and perhaps some others.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.