Some cleanup refactoring of how stuff is built.

Strophe.ping.js was still in the no-dependencies build

Also clean up wrapper-end.js a bit as well as the grouping of dependencies in
non_amd.html

Remove locales from utils.js and include it in converse.js so that the locales
can more easily be removed from the build.
This commit is contained in:
JC Brand 2016-02-27 16:16:04 +00:00
parent 77a563955e
commit 7e8a11df88
6 changed files with 41 additions and 21 deletions

View File

@ -141,7 +141,6 @@ BUILDS = builds/converse.js \
builds/converse-no-dependencies.min.js \
builds/converse-no-dependencies.js
# XXX This can be updated to use uglify to minimize instead of letting r.js run twice per file
builds/converse.min.js: stamp-bower src locale components *.js
$(RJS) -o src/build.js
builds/converse.js: stamp-bower src locale components *.js

View File

@ -1,20 +1,25 @@
/* Converse.js build configuration
/* Converse.js components configuration
*
* This file is used to tell require.js which components (or plugins) to load
* when it generates a build.
*/
define("converse", [
"converse-api",
define("converse", ["converse-api",
/* Removable components
/* START: Removable components
* --------------------
* Any of the following components may be removed if they're not needed.
*/
"locales", // Translations for converse.js. This line can be removed
// to remove *all* translations, or you can modify the
// file src/locales.js to include only those
// translations that you care about.
"converse-muc", // XEP-0045 Multi-user chat
"converse-otr", // Off-the-record encryption for one-on-one messages
"converse-register",// XEP-0077 In-band registration
"converse-ping", // XEP-0199 XMPP Ping
/* End: Removable components */
/* END: Removable components */
], function(converse_api) {
window.converse = converse_api;
return converse_api;

View File

@ -13,10 +13,15 @@
<link type="text/css" rel="stylesheet" media="screen" href="css/theme.css" />
<link type="text/css" rel="stylesheet" media="screen" href="css/converse.css" />
<!-- BEGIN JQUERY -->
<script type="text/javascript" src="components/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="components/jquery.browser/dist/jquery.browser.js"></script>
<script type="text/javascript" src="components/typeahead.js/index.js"></script>
<!-- END JQUERY -->
<!-- BEGIN OTR: Off-the-record encryption stuff. Can be omitted if OTR is not used. -->
<script type="text/javascript" src="components/otr/build/dep/salsa20.js"></script>
<script type="text/javascript" src="src/bigint.js"></script>
<!-- CryptoJS -->
<script type="text/javascript" src="components/otr/vendor/cryptojs/core.js"></script>
<script type="text/javascript" src="components/otr/vendor/cryptojs/enc-base64.js"></script>
<script type="text/javascript" src="components/crypto-js-evanvosberg/src/md5.js"></script>
@ -28,23 +33,31 @@
<script type="text/javascript" src="components/otr/vendor/cryptojs/hmac.js"></script>
<script type="text/javascript" src="components/otr/vendor/cryptojs/pad-nopadding.js"></script>
<script type="text/javascript" src="components/otr/vendor/cryptojs/mode-ctr.js"></script>
<!-- until here -->
<script type="text/javascript" src="components/otr/build/dep/eventemitter.js"></script>
<script type="text/javascript" src="src/otr.js"></script>
<!-- END OTR -->
<!-- BEGIN STROPHE -->
<script type="text/javascript" src="components/strophejs/strophe.js"></script>
<script type="text/javascript" src="components/strophejs-plugins/vcard/strophe.vcard.js"></script>
<script type="text/javascript" src="components/strophejs-plugins/disco/strophe.disco.js"></script>
<script type="text/javascript" src="components/strophejs-plugins/rsm/strophe.rsm.js"></script>
<script type="text/javascript" src="src/strophe.ping.js"></script>
<!-- END STROPHE -->
<!-- BEGIN BACKBONE -->
<script type="text/javascript" src="components/underscore/underscore.js"></script>
<script type="text/javascript" src="components/backbone//backbone.js"></script>
<script type="text/javascript" src="components/backbone.browserStorage/backbone.browserStorage.js"></script>
<script type="text/javascript" src="components/backbone.overview/backbone.overview.js"></script>
<script type="text/javascript" src="components/momentjs/min/moment-with-locales.js"></script>
<script type="text/javascript" src="components/jquery.browser/dist/jquery.browser.js"></script>
<script type="text/javascript" src="components/typeahead.js/index.js"></script>
<!-- END BACKBONE -->
<!-- BEGIN I18N -->
<script type="text/javascript" src="components/jed/jed.js"></script>
<script type="text/javascript" src="builds/locales.js"></script>
<!-- END I18N -->
<script type="text/javascript" src="components/momentjs/min/moment-with-locales.js"></script>
<script type="text/javascript" src="builds/templates.js"></script>
<script type="text/javascript" src="builds/converse-no-dependencies.js"></script>
</head>

View File

@ -13,6 +13,7 @@
"strophe.disco",
"strophe.rsm",
"strophe.vcard",
"strophe.ping",
"typeahead",
"otr",
"underscore"

View File

@ -1,14 +1,13 @@
/*global escape */
/*global escape locales */
(function (root, factory) {
define([
"jquery",
"jquery.browser",
"underscore",
"jed",
"converse-templates",
"locales"
"converse-templates"
], factory);
}(this, function ($, dummy, _, Jed, templates, locales) {
}(this, function ($, dummy, _, Jed, templates) {
"use strict";
var XFORM_TYPE_MAP = {

View File

@ -20,10 +20,13 @@ define('strophe', [], function () {
'str_sha1': SHA1.str_sha1
};
});
define('strophe.disco', [], function () { return Strophe; });
define('strophe.rsm', [], function () { return Strophe; });
define('strophe.vcard', [], function () { return Strophe; });
var strophePlugin = function () { return Strophe; };
var emptyFunction = function () { };
define('strophe.disco', ['strophe'], strophePlugin);
define('strophe.ping', ['strophe'], strophePlugin);
define('strophe.rsm', ['strophe'], strophePlugin);
define('strophe.vcard', ['strophe'], strophePlugin);
define('backbone', [], emptyFunction);
define('backbone.browserStorage', ['backbone'], emptyFunction);
define('backbone.overview', ['backbone'], emptyFunction);
define('otr', [], function () { return { 'DSA': DSA, 'OTR': OTR };});
define('backbone', [], function () { return; });
define('backbone.browserStorage', [], function () { return; });
define('backbone.overview', [], function () { return; });