[BREAK] Update to Meteor to 1.8 (#12468)

* Update livechat widget to Meteor 1.8

* Replace synced-cron package

* Add break change regarding cordova app
pull/12371/head^2
Guilherme Gazzo 7 years ago committed by Diego Sampaio
parent 727375b093
commit afd747dde8
  1. 5
      .eslintignore
  2. 5
      .github/history-manual.json
  3. 44
      .meteor/packages
  4. 1
      .meteor/platforms
  5. 2
      .meteor/release
  6. 113
      .meteor/versions
  7. 18
      .postcssrc
  8. 2
      .stylelintignore
  9. 7572
      package-lock.json
  10. 8
      package.json
  11. 1
      packages/autoupdate/.gitignore
  12. 115
      packages/autoupdate/QA.md
  13. 13
      packages/autoupdate/README.md
  14. 176
      packages/autoupdate/autoupdate_client.js
  15. 85
      packages/autoupdate/autoupdate_cordova.js
  16. 198
      packages/autoupdate/autoupdate_server.js
  17. 30
      packages/autoupdate/package.js
  18. 2
      packages/rocketchat-analytics/client/trackEvents.js
  19. 2
      packages/rocketchat-analytics/package.js
  20. 5
      packages/rocketchat-assets/server/assets.js
  21. 28
      packages/rocketchat-i18n/package.js
  22. 2
      packages/rocketchat-katex/package-lock.json
  23. 2
      packages/rocketchat-lib/client/CustomTranslations.js
  24. 2
      packages/rocketchat-lib/client/lib/startup/commands.js
  25. 30
      packages/rocketchat-livechat/.app/.meteor/packages
  26. 2
      packages/rocketchat-livechat/.app/.meteor/release
  27. 82
      packages/rocketchat-livechat/.app/.meteor/versions
  28. 518
      packages/rocketchat-livechat/.app/package-lock.json
  29. 10
      packages/rocketchat-livechat/.app/package.json
  30. 1
      packages/rocketchat-postcss/.npm/plugin/minifier-postcss/.gitignore
  31. 7
      packages/rocketchat-postcss/.npm/plugin/minifier-postcss/README
  32. 62
      packages/rocketchat-postcss/.npm/plugin/minifier-postcss/npm-shrinkwrap.json
  33. 25
      packages/rocketchat-postcss/package.js
  34. 198
      packages/rocketchat-postcss/plugin/minify-css.js
  35. 2
      packages/rocketchat-tokenpass/package.js
  36. 2
      packages/rocketchat-ui/client/views/cmsPage.js
  37. 2
      packages/rocketchat-version-check/package.js
  38. 0
      packages/rocketchat_theme/client/imports/components/alerts.css
  39. 0
      packages/rocketchat_theme/client/imports/components/avatar.css
  40. 0
      packages/rocketchat_theme/client/imports/components/badge.css
  41. 0
      packages/rocketchat_theme/client/imports/components/chip.css
  42. 0
      packages/rocketchat_theme/client/imports/components/contextual-bar.css
  43. 0
      packages/rocketchat_theme/client/imports/components/emojiPicker.css
  44. 0
      packages/rocketchat_theme/client/imports/components/flex-nav.css
  45. 0
      packages/rocketchat_theme/client/imports/components/header.css
  46. 0
      packages/rocketchat_theme/client/imports/components/main-content.css
  47. 0
      packages/rocketchat_theme/client/imports/components/memberlist.css
  48. 0
      packages/rocketchat_theme/client/imports/components/message-box.css
  49. 0
      packages/rocketchat_theme/client/imports/components/messages.css
  50. 0
      packages/rocketchat_theme/client/imports/components/modal.css
  51. 0
      packages/rocketchat_theme/client/imports/components/modal/create-channel.css
  52. 0
      packages/rocketchat_theme/client/imports/components/modal/directory.css
  53. 0
      packages/rocketchat_theme/client/imports/components/modal/full-modal.css
  54. 0
      packages/rocketchat_theme/client/imports/components/popout.css
  55. 0
      packages/rocketchat_theme/client/imports/components/popover.css
  56. 0
      packages/rocketchat_theme/client/imports/components/setup-wizard.css
  57. 0
      packages/rocketchat_theme/client/imports/components/sidebar/rooms-list.css
  58. 0
      packages/rocketchat_theme/client/imports/components/sidebar/sidebar-flex.css
  59. 0
      packages/rocketchat_theme/client/imports/components/sidebar/sidebar-header.css
  60. 0
      packages/rocketchat_theme/client/imports/components/sidebar/sidebar-item.css
  61. 0
      packages/rocketchat_theme/client/imports/components/sidebar/sidebar.css
  62. 0
      packages/rocketchat_theme/client/imports/components/sidebar/toolbar.css
  63. 0
      packages/rocketchat_theme/client/imports/components/slider.css
  64. 0
      packages/rocketchat_theme/client/imports/components/table.css
  65. 0
      packages/rocketchat_theme/client/imports/components/tabs.css
  66. 0
      packages/rocketchat_theme/client/imports/components/tooltip.css
  67. 0
      packages/rocketchat_theme/client/imports/components/userInfo.css
  68. 0
      packages/rocketchat_theme/client/imports/forms/button.css
  69. 0
      packages/rocketchat_theme/client/imports/forms/checkbox.css
  70. 0
      packages/rocketchat_theme/client/imports/forms/input.css
  71. 0
      packages/rocketchat_theme/client/imports/forms/popup-list.css
  72. 0
      packages/rocketchat_theme/client/imports/forms/select-avatar.css
  73. 0
      packages/rocketchat_theme/client/imports/forms/select.css
  74. 0
      packages/rocketchat_theme/client/imports/forms/switch.css
  75. 0
      packages/rocketchat_theme/client/imports/forms/tags.css
  76. 0
      packages/rocketchat_theme/client/imports/general/animations.css
  77. 0
      packages/rocketchat_theme/client/imports/general/apps.css
  78. 0
      packages/rocketchat_theme/client/imports/general/base.css
  79. 0
      packages/rocketchat_theme/client/imports/general/base_old.css
  80. 0
      packages/rocketchat_theme/client/imports/general/forms.css
  81. 0
      packages/rocketchat_theme/client/imports/general/reset.css
  82. 0
      packages/rocketchat_theme/client/imports/general/rtl.css
  83. 0
      packages/rocketchat_theme/client/imports/general/typography.css
  84. 0
      packages/rocketchat_theme/client/imports/general/variables.css
  85. 2
      packages/rocketchat_theme/client/main.css
  86. 0
      packages/rocketchat_theme/client/vendor/fontello/config.json
  87. 0
      packages/rocketchat_theme/client/vendor/fontello/css/fontello.css
  88. 0
      packages/rocketchat_theme/client/vendor/fontello/demo.html
  89. 0
      packages/rocketchat_theme/client/vendor/fontello/font/fontello.eot
  90. 0
      packages/rocketchat_theme/client/vendor/fontello/font/fontello.svg
  91. 0
      packages/rocketchat_theme/client/vendor/fontello/font/fontello.ttf
  92. 0
      packages/rocketchat_theme/client/vendor/fontello/font/fontello.woff
  93. 0
      packages/rocketchat_theme/client/vendor/fontello/font/fontello.woff2
  94. 0
      packages/rocketchat_theme/client/vendor/fontello/utf8-rtl.html
  95. 0
      packages/rocketchat_theme/client/vendor/jscolor.js
  96. 0
      packages/rocketchat_theme/client/vendor/photoswipe.css
  97. 8
      packages/rocketchat_theme/package.js
  98. 0
      packages/rocketchat_theme/server/colors.less
  99. 0
      packages/rocketchat_theme/server/server.js
  100. 0
      packages/rocketchat_theme/server/variables.js

@ -9,12 +9,13 @@ packages/rocketchat-livechat/.app/node_modules
packages/rocketchat-livechat/.app/.meteor
packages/rocketchat-livechat/assets/rocketchat-livechat.min.js
packages/rocketchat-livechat/assets/rocket-livechat.js
packages/rocketchat-theme/client/minicolors/jquery.minicolors.js
packages/rocketchat_theme/client/minicolors/jquery.minicolors.js
packages/rocketchat_theme/client/minicolors/jquery.minicolors.js
packages/rocketchat_theme/client/vendor/
packages/rocketchat-ui/client/lib/customEventPolyfill.js
packages/rocketchat-ui/client/lib/Modernizr.js
packages/rocketchat-ui/client/lib/recorderjs/recorder.js
packages/rocketchat-videobridge/client/public/external_api.js
packages/rocketchat-theme/client/vendor/
packages/tap-i18n/lib/tap_i18next/tap_i18next-1.7.3.js
private/moment-locales/
public/livechat/

@ -11,5 +11,10 @@
"title": "[FIX] Removed Deprecated Package rocketchat:sharedsecret`",
"userLogin": "rodrigok",
"contributors": []
}],
"0.72.0": [{
"title": "[BREAK] Support for Cordova (Rocket.Chat Legacy app) has reached End-of-life, support has been discontinued",
"userLogin": "sampaiodiego",
"contributors": []
}]
}

@ -5,38 +5,38 @@
rocketchat:cors
accounts-facebook@1.3.1
accounts-github@1.4.1
accounts-google@1.3.1
accounts-meteor-developer@1.4.1
accounts-password@1.5.0
accounts-twitter@1.4.1
accounts-facebook@1.3.2
accounts-github@1.4.2
accounts-google@1.3.2
accounts-meteor-developer@1.4.2
accounts-password@1.5.1
accounts-twitter@1.4.2
blaze-html-templates
check@1.3.0
check@1.3.1
ddp-rate-limiter@1.0.7
ddp-common@1.4.0
dynamic-import@0.3.0
ecmascript@0.10.6
dynamic-import@0.5.0
ecmascript@0.12.0
ejson@1.1.0
email@1.2.3
fastclick@1.0.13
http@1.4.0
http@1.4.1
jquery@1.11.10
logging@1.1.19
meteor-base@1.3.0
logging@1.1.20
meteor-base@1.4.0
mobile-experience@1.0.5
mongo@1.4.2
mongo@1.6.0
random@1.1.0
rate-limit@1.0.8
reactive-dict@1.2.0
rate-limit@1.0.9
reactive-dict@1.2.1
reactive-var@1.0.11
reload@1.2.0
service-configuration@1.0.11
session@1.1.7
shell-server@0.3.1
session@1.1.8
shell-server@0.4.0
spacebars
standard-minifier-js@2.3.1
tracker@1.1.3
standard-minifier-js@2.4.0
tracker@1.2.0
rocketchat:2fa
rocketchat:action-links
@ -108,7 +108,6 @@ rocketchat:monitoring
rocketchat:oauth2-server-config
rocketchat:oembed
rocketchat:otr
rocketchat:postcss
rocketchat:push-notifications
rocketchat:reactions
rocketchat:retention-policy
@ -183,7 +182,6 @@ nimble:restivus
nooitaf:colors
ostrio:cookies
pauli:accounts-linkedin
percolate:synced-cron
raix:handlebar-helpers
rocketchat:push
raix:ui-dropped-event
@ -199,6 +197,8 @@ rocketchat:search
chatpal:search
rocketchat:lazy-load
tap:i18n
underscore
underscore@1.0.10
rocketchat:bigbluebutton
rocketchat:mailmessages
juliancwirko:postcss
littledata:synced-cron

@ -1,3 +1,2 @@
browser
ios
server

@ -1 +1 @@
METEOR@1.6.1.3
METEOR@1.8

@ -1,24 +1,24 @@
accounts-base@1.4.2
accounts-facebook@1.3.1
accounts-github@1.4.1
accounts-google@1.3.1
accounts-meteor-developer@1.4.1
accounts-oauth@1.1.15
accounts-base@1.4.3
accounts-facebook@1.3.2
accounts-github@1.4.2
accounts-google@1.3.2
accounts-meteor-developer@1.4.2
accounts-oauth@1.1.16
accounts-password@1.5.1
accounts-twitter@1.4.1
accounts-twitter@1.4.2
aldeed:simple-schema@1.5.4
allow-deny@1.1.0
autoupdate@1.4.0
babel-compiler@7.0.9
babel-runtime@1.2.2
autoupdate@1.5.0
babel-compiler@7.2.1
babel-runtime@1.3.0
base64@1.0.11
binary-heap@1.0.10
blaze@2.3.2
binary-heap@1.0.11
blaze@2.3.3
blaze-html-templates@1.1.2
blaze-tools@1.0.10
boilerplate-generator@1.4.0
caching-compiler@1.1.12
caching-html-compiler@1.1.2
boilerplate-generator@1.6.0
caching-compiler@1.2.0
caching-html-compiler@1.1.3
callback-hook@1.1.0
cfs:http-methods@0.0.32
chatpal:search@0.0.1
@ -26,35 +26,37 @@ check@1.3.1
coffeescript@1.0.17
dandv:caret-position@2.1.1
ddp@1.4.0
ddp-client@2.3.2
ddp-client@2.3.3
ddp-common@1.4.0
ddp-rate-limiter@1.0.7
ddp-server@2.1.2
ddp-server@2.2.0
deepwell:bootstrap-datepicker2@1.3.0
deps@1.0.12
diff-sequence@1.1.0
dispatch:run-as-user@1.1.1
dynamic-import@0.3.0
ecmascript@0.10.9
ecmascript-runtime@0.5.0
ecmascript-runtime-client@0.6.2
ecmascript-runtime-server@0.5.0
dynamic-import@0.5.0
ecmascript@0.12.1
ecmascript-runtime@0.7.0
ecmascript-runtime-client@0.8.0
ecmascript-runtime-server@0.7.1
edgee:slingshot@0.7.1
ejson@1.1.0
email@1.2.3
emojione:emojione@2.2.6
es5-shim@4.7.3
facebook-oauth@1.4.1
es5-shim@4.8.0
facebook-oauth@1.5.0
fastclick@1.0.13
fetch@0.1.0
francocatena:status@1.5.3
geojson-utils@1.0.10
github-oauth@1.2.0
google-oauth@1.2.5
github-oauth@1.2.2
google-oauth@1.2.6
hot-code-push@1.0.4
html-tools@1.0.11
htmljs@1.0.11
http@1.4.1
id-map@1.1.0
inter-process-messaging@0.1.0
jalik:ufs@0.7.5
jalik:ufs-gridfs@0.2.1
jalik:ufs-local@0.2.9
@ -62,6 +64,7 @@ jparker:crypto-core@0.1.0
jparker:crypto-md5@0.1.1
jparker:gravatar@0.5.1
jquery@1.11.11
juliancwirko:postcss@2.0.3
kadira:blaze-layout@2.3.0
kadira:flow-router@2.12.1
keepnox:perfect-scrollbar@0.6.8
@ -72,28 +75,31 @@ konecty:mongo-counter@0.0.5_3
konecty:multiple-instances-status@1.1.0
konecty:user-presence@2.2.0
launch-screen@1.1.1
less@2.7.12
less@2.8.0
littledata:synced-cron@1.5.1
livedata@1.0.18
localstorage@1.2.0
logging@1.1.20
matb33:collection-hooks@0.8.4
mdg:validation-error@0.5.1
meteor@1.8.6
meteor-base@1.3.0
meteor-developer-oauth@1.2.0
meteor@1.9.2
meteor-base@1.4.0
meteor-developer-oauth@1.2.1
meteorhacks:inject-initial@1.0.4
meteorhacks:meteorx@1.4.1
meteorspark:util@0.2.0
minifier-css@1.3.1
minifier-js@2.3.5
minimongo@1.4.4
minifier-css@1.4.0
minifier-js@2.4.0
minimongo@1.4.5
mizzao:autocomplete@0.5.1
mizzao:timesync@0.3.4
mobile-experience@1.0.5
mobile-status-bar@1.0.14
modules@0.11.8
modules-runtime@0.9.2
mongo@1.4.7
modern-browsers@0.1.2
modules@0.13.0
modules-runtime@0.10.3
mongo@1.6.0
mongo-decimal@0.1.0
mongo-dev-server@1.1.0
mongo-id@1.0.7
mongo-livedata@1.0.12
@ -102,24 +108,23 @@ mystor:device-detection@0.2.0
nimble:restivus@0.8.12
nooitaf:colors@1.1.2_1
npm-bcrypt@0.9.3
npm-mongo@2.2.34
oauth@1.2.3
oauth1@1.2.0
oauth2@1.2.0
npm-mongo@3.1.1
oauth@1.2.5
oauth1@1.2.1
oauth2@1.2.1
observe-sequence@1.0.16
ordered-dict@1.1.0
ostrio:cookies@2.2.4
ostrio:cookies@2.3.0
pauli:accounts-linkedin@2.1.5
pauli:linkedin-oauth@1.2.0
percolate:synced-cron@1.3.2
promise@0.10.2
promise@0.11.1
raix:eventemitter@0.1.3
raix:eventstate@0.0.4
raix:handlebar-helpers@0.2.5
raix:ui-dropped-event@0.0.7
random@1.1.0
rate-limit@1.0.9
reactive-dict@1.2.0
reactive-dict@1.2.1
reactive-var@1.0.11
reload@1.2.0
retry@1.1.0
@ -202,7 +207,6 @@ rocketchat:oauth2-server@2.0.0
rocketchat:oauth2-server-config@1.0.0
rocketchat:oembed@0.0.1
rocketchat:otr@0.0.1
rocketchat:postcss@1.0.0
rocketchat:push@3.3.1
rocketchat:push-notifications@0.0.1
rocketchat:reactions@0.0.1
@ -254,19 +258,17 @@ rocketchat:videobridge@0.2.0
rocketchat:webdav@0.0.1
rocketchat:webrtc@0.0.1
rocketchat:wordpress@0.0.1
routepolicy@1.0.13
server-render@0.3.1
routepolicy@1.1.0
service-configuration@1.0.11
session@1.1.7
session@1.1.8
sha@1.0.9
shell-server@0.3.1
shim-common@0.1.0
shell-server@0.4.0
simple:json-routes@2.1.0
socket-stream-client@0.1.0
socket-stream-client@0.2.2
spacebars@1.0.15
spacebars-compiler@1.1.3
srp@1.0.10
standard-minifier-js@2.3.4
srp@1.0.12
standard-minifier-js@2.4.0
steffo:meteor-accounts-saml@0.0.1
swydo:graphql@0.4.0
tap:i18n@1.8.2
@ -274,13 +276,14 @@ templating@1.3.2
templating-compiler@1.3.3
templating-runtime@1.3.2
templating-tools@1.1.2
tmeasday:check-npm-versions@0.3.2
todda00:friendly-slugs@0.6.0
tracker@1.1.3
tracker@1.2.0
twitter-oauth@1.2.0
ui@1.0.13
underscore@1.0.10
url@1.2.0
webapp@1.5.0
webapp@1.7.0
webapp-hashing@1.0.9
yasaricli:slugify@0.0.7
yasinuslu:blaze-meta@0.3.3

@ -1,6 +1,6 @@
{
"plugins": {
"postcss-import": {},
"postcss-easy-import": {},
"postcss-custom-properties": {
"preserve": true
},
@ -9,18 +9,12 @@
"postcss-nested": {},
"autoprefixer": {
"browsers": [
"ie > 10",
"last 2 Edge versions",
"last 2 Firefox versions",
"last 1 FirefoxAndroid versions",
"last 2 Chrome versions",
"last 1 ChromeAndroid versions",
"Safari > 7",
"last 2 Opera versions",
"last 2 iOS versions",
"last 1 Android version"
"last 2 versions"
]
}
},
"excludedPackages": ["deepwell:bootstrap-datepicker2", "smoral:sweetalert"]
"excludedPackages": [
"deepwell:bootstrap-datepicker2",
"smoral:sweetalert"
]
}

@ -1,2 +1,2 @@
packages/rocketchat-theme/client/vendor/fontello/css/fontello.css
packages/rocketchat_theme/client/vendor/fontello/css/fontello.css
packages/meteor-autocomplete/client/autocomplete.css

7572
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -101,8 +101,11 @@
"husky": "^0.14.3",
"mocha": "^5.2.0",
"mock-require": "^3.0.2",
"postcss": "^6.0.22",
"postcss-custom-properties": "^7.0.0",
"postcss-import": "^11.1.0",
"postcss-easy-import": "^1.0.1",
"postcss-import": "^12.0.0",
"postcss-load-config": "^1.2.0",
"postcss-media-minmax": "^3.0.0",
"postcss-nested": "^3.0.0",
"postcss-selector-not": "^3.0.1",
@ -114,7 +117,7 @@
"supertest": "^3.3.0"
},
"dependencies": {
"@babel/runtime": "^7.0.0-beta.49",
"@babel/runtime": "^7.1.2",
"@google-cloud/language": "^1.2.0",
"@google-cloud/storage": "^1.7.0",
"@google-cloud/vision": "^0.19.0",
@ -144,6 +147,7 @@
"csv-parse": "^2.5.0",
"emailreplyparser": "^0.0.5",
"express": "^4.16.4",
"fibers": "^3.0.0",
"file-type": "^8.1.0",
"filesize": "^3.6.1",
"grapheme-splitter": "^1.0.4",

@ -1 +0,0 @@
.build*

@ -1,115 +0,0 @@
# QA Notes
## Hot Code Push Reload
Run the leaderboard example, and click on one of the names. Make a
change to the leaderboard.html file, see the client reload, and see
that the name is still selected.
## AUTOUPDATE_VERSION
Set the `AUTOUPDATE_VERSION` environment variable when running the
application:
$ AUTOUPDATE_VERSION=abc meteor
Now when you make an HTML change, it won't appear in the client
automatically. (Note the leader list flickers when the server
subscription restarts, but that's not a window reload).
Conversely, you can force a client reload (even without making any
client code changes) by restarting the server with a new value for
`AUTOUPDATE_VERSION`.
## No Client Reload on Server-only Change
Revert previous changes and run the example without setting
AUTOUPDATE_VERSION.
Note that it might look like the browser is reloading because the page
content in the leaderboard example will flicker when the server
restarts because the example is using autopublish, but that the window
won't actually be reloading.
In the browser console, assign a variable such as `a = true` so that
you can easily verify that the client hasn't reloaded.
In the leaderboard example directory, create the `server` directory
and add `foo.js`. See in the browser console that `a` is still
defined, indicating the browser hasn't reloaded.
## Test with the appcache
Add the appcache package:
$ meteor add appcache
And do the above tests again.
Note that if 1) AUTOUPDATE_VERSION is set so the client doesn't
automatically reload, 2) you make a client change, and 3) you manually
reload the browser page, you usually *won't* see the updated HTML the
*first* time you reload (unless the browser happened to check the app
cache manifest between steps 2 and 3). This is normal browser app
cache behavior: the browser populates the app cache in the background,
so it doesn't wait for new files to download before displaying the web
page.
## Autoupdate.newClientAvailable
Undo previous changes made, such as by using `git checkout .` Reload
the client, which will cause the browser to stop using the app cache.
It's hard to see the `newClientAvailable` reactive variable when the
client automatically reloads. Remove the `hot-code-push` package so you can
see the variable without having the client also reload.
$ meteor remove meteor-base
$ meteor add meteor webapp ddp autoupdate
Add to leaderboard.js:
Template.leaderboard.helpers({
available: function () {
return Autoupdate.newClientAvailable().toString();
}
});
And add `{{available}}` to the leaderboard template in
leaderboard.html.
Initially you'll see `false`, and then when you make a change to the
leaderboard HTML you'll see the variable change to `true`. (You won't
see the new HTML on the client because you disabled reload).
Amusingly, you can undo the addition you made to the HTML and the "new
client available" variable will go back to `false` (you now don't have
client code available on the server different than what's running in
the browser), because by default the client version is based on a hash
of the client files.
## DDP Version Negotiation Failure
A quick way to test DDP version negotiation failure is to force the
client to use the wrong DDP version. At the top of
livedata_connection.js:
var Connection = function (url, options) {
var self = this;
+ options.supportedDDPVersions = ['abc'];
You will see the client reload (in the hope that new client code will
be available that can successfully negotiation the DDP version). Each
reload takes longer than the one before, using an exponential backoff.
If you remove the `options.supportedDDPVersions` line and allow the
client to connect (or manually reload the browser page so you don't
have to wait), this will reset the exponential backoff counter.
You can verify the counter was reset by adding the line back in a
second time, and you'll see the reload cycle start over again with
first reloading quickly, and then again taking longer between tries.

@ -1,13 +0,0 @@
# autoupdate
[Source code of released version](https://github.com/meteor/meteor/tree/master/packages/autoupdate) | [Source code of development version](https://github.com/meteor/meteor/tree/devel/packages/autoupdate)
***
This package is the heart of Meteor's Hot Code Push functionality. It has a
client component and a server component component. The client component uses a
DDP API provided by the server to subscribe to the version ID of the most recent
build of the app's client. When it sees that a new version is available, it uses
the [reload](https://atmospherejs.com/meteor/reload) package (if included in the
app) to gracefully save the app's state and reload it in place.
`autoupdate` is part of the [Webapp](https://github.com/meteor/meteor/tree/master/packages/webapp)
project.

@ -1,176 +0,0 @@
// Subscribe to the `meteor_autoupdate_clientVersions` collection,
// which contains the set of acceptable client versions.
//
// A "hard code push" occurs when the running client version is not in
// the set of acceptable client versions (or the server updates the
// collection, there is a published client version marked `current` and
// the running client version is no longer in the set).
//
// When the `reload` package is loaded, a hard code push causes
// the browser to reload, so that it will load the latest client
// version from the server.
//
// A "soft code push" represents the situation when the running client
// version is in the set of acceptable versions, but there is a newer
// version available on the server.
//
// `Autoupdate.newClientAvailable` is a reactive data source which
// becomes `true` if there is a new version of the client is available on
// the server.
//
// This package doesn't implement a soft code reload process itself,
// but `newClientAvailable` could be used for example to display a
// "click to reload" link to the user.
// The client version of the client code currently running in the
// browser.
var autoupdateVersion = __meteor_runtime_config__.autoupdateVersion || "unknown";
var autoupdateVersionRefreshable =
__meteor_runtime_config__.autoupdateVersionRefreshable || "unknown";
// The collection of acceptable client versions.
ClientVersions = new Mongo.Collection("meteor_autoupdate_clientVersions");
Autoupdate = {};
Autoupdate.newClientAvailable = function () {
return !! ClientVersions.findOne({
_id: "version",
version: {$ne: autoupdateVersion} }) ||
!! ClientVersions.findOne({
_id: "version-refreshable",
version: {$ne: autoupdateVersionRefreshable} });
};
Autoupdate._ClientVersions = ClientVersions; // Used by a self-test
var knownToSupportCssOnLoad = false;
var retry = new Retry({
// Unlike the stream reconnect use of Retry, which we want to be instant
// in normal operation, this is a wacky failure. We don't want to retry
// right away, we can start slowly.
//
// A better way than timeconstants here might be to use the knowledge
// of when we reconnect to help trigger these retries. Typically, the
// server fixing code will result in a restart and reconnect, but
// potentially the subscription could have a transient error.
minCount: 0, // don't do any immediate retries
baseTimeout: 30*1000 // start with 30s
});
var failures = 0;
function after(times, func) {
return function() {
if (--times < 1) {
return func.apply(this, arguments);
}
};
};
Autoupdate._retrySubscription = function () {
Meteor.subscribe("meteor_autoupdate_clientVersions", {
onError: function (error) {
Meteor._debug("autoupdate subscription failed:", error);
failures++;
retry.retryLater(failures, function () {
// Just retry making the subscription, don't reload the whole
// page. While reloading would catch more cases (for example,
// the server went back a version and is now doing old-style hot
// code push), it would also be more prone to reload loops,
// which look really bad to the user. Just retrying the
// subscription over DDP means it is at least possible to fix by
// updating the server.
Autoupdate._retrySubscription();
});
},
onReady: function () {
if (Package.reload) {
var checkNewVersionDocument = function (doc) {
var self = this;
if (doc._id === 'version-refreshable' &&
doc.version !== autoupdateVersionRefreshable) {
autoupdateVersionRefreshable = doc.version;
// Switch out old css links for the new css links. Inspired by:
// https://github.com/guard/guard-livereload/blob/master/js/livereload.js#L710
var newCss = (doc.assets && doc.assets.allCss) || [];
var oldLinks = [];
Array.prototype.forEach.call(
document.getElementsByTagName('link'),
function (link) {
if (link.className === '__meteor-css__') {
oldLinks.push(link);
}
}
);
function waitUntilCssLoads(link, callback) {
var called;
function executeCallback(...args) {
if (! called) {
called = true;
return callback(...args);
}
}
link.onload = function () {
knownToSupportCssOnLoad = true;
executeCallback();
};
if (! knownToSupportCssOnLoad) {
var id = Meteor.setInterval(function () {
if (link.sheet) {
executeCallback();
Meteor.clearInterval(id);
}
}, 50);
}
}
var removeOldLinks = after(newCss.length, function () {
oldLinks.forEach(function (link) {
link.parentNode.removeChild(link);
});
});
var attachStylesheetLink = function (newLink) {
document.getElementsByTagName("head").item(0).appendChild(newLink);
waitUntilCssLoads(newLink, function () {
Meteor.setTimeout(removeOldLinks, 200);
});
};
if (newCss.length !== 0) {
newCss.forEach(function (css) {
var newLink = document.createElement("link");
newLink.setAttribute("rel", "stylesheet");
newLink.setAttribute("type", "text/css");
newLink.setAttribute("class", "__meteor-css__");
newLink.setAttribute("href", css.url);
attachStylesheetLink(newLink);
});
} else {
removeOldLinks();
}
}
else if (doc._id === 'version' && doc.version !== autoupdateVersion) {
handle && handle.stop();
if (Package.reload) {
Package.reload.Reload._reload();
}
}
};
var handle = ClientVersions.find().observe({
added: checkNewVersionDocument,
changed: checkNewVersionDocument
});
}
}
});
};
Autoupdate._retrySubscription();

@ -1,85 +0,0 @@
var DEBUG_TAG = 'METEOR CORDOVA DEBUG (autoupdate_cordova.js) ';
var log = function (msg) {
console.log(DEBUG_TAG + msg);
};
// This constant was picked by testing on iOS 7.1
// We limit the number of concurrent downloads because iOS gets angry on the
// application when a certain limit is exceeded and starts timing-out the
// connections in 1-2 minutes which makes the whole HCP really slow.
var MAX_NUM_CONCURRENT_DOWNLOADS = 30;
var MAX_RETRY_COUNT = 5;
var autoupdateVersionCordova = __meteor_runtime_config__.autoupdateVersionCordova || "unknown";
// The collection of acceptable client versions.
ClientVersions = new Mongo.Collection("meteor_autoupdate_clientVersions");
Autoupdate = {};
Autoupdate.newClientAvailable = function () {
return !! ClientVersions.findOne({
_id: 'version-cordova',
version: {$ne: autoupdateVersionCordova}
});
};
var hasCalledReload = false;
var updating = false;
var localPathPrefix = null;
var retry = new Retry({
// Unlike the stream reconnect use of Retry, which we want to be instant
// in normal operation, this is a wacky failure. We don't want to retry
// right away, we can start slowly.
//
// A better way than timeconstants here might be to use the knowledge
// of when we reconnect to help trigger these retries. Typically, the
// server fixing code will result in a restart and reconnect, but
// potentially the subscription could have a transient error.
minCount: 0, // don't do any immediate retries
baseTimeout: 30*1000 // start with 30s
});
var failures = 0;
Autoupdate._retrySubscription = function () {
var appId = __meteor_runtime_config__.appId;
Meteor.subscribe("meteor_autoupdate_clientVersions", appId, {
onError: function (err) {
Meteor._debug("autoupdate subscription failed:", err);
failures++;
retry.retryLater(failures, function () {
// Just retry making the subscription, don't reload the whole
// page. While reloading would catch more cases (for example,
// the server went back a version and is now doing old-style hot
// code push), it would also be more prone to reload loops,
// which look really bad to the user. Just retrying the
// subscription over DDP means it is at least possible to fix by
// updating the server.
Autoupdate._retrySubscription();
});
}
});
if (Package.reload) {
var checkNewVersionDocument = function (doc) {
var self = this;
if (doc.version !== autoupdateVersionCordova) {
window.fireGlobalEvent('onNewVersion', doc.version)
// onNewVersion();
}
};
var handle = ClientVersions.find({
_id: 'version-cordova'
}).observe({
added: checkNewVersionDocument,
changed: checkNewVersionDocument
});
}
};
Meteor.startup(Autoupdate._retrySubscription);
window.WebAppLocalServer = {};
WebAppLocalServer.startupDidComplete = function() {};
WebAppLocalServer.checkForUpdates = function() {};
WebAppLocalServer.onNewVersionReady = function() {};
WebAppLocalServer.onError = function() {};

@ -1,198 +0,0 @@
// Publish the current client versions to the client. When a client
// sees the subscription change and that there is a new version of the
// client available on the server, it can reload.
//
// By default there are two current client versions. The refreshable client
// version is identified by a hash of the client resources seen by the browser
// that are refreshable, such as CSS, while the non refreshable client version
// is identified by a hash of the rest of the client assets
// (the HTML, code, and static files in the `public` directory).
//
// If the environment variable `AUTOUPDATE_VERSION` is set it will be
// used as the client id instead. You can use this to control when
// the client reloads. For example, if you want to only force a
// reload on major changes, you can use a custom AUTOUPDATE_VERSION
// which you only change when something worth pushing to clients
// immediately happens.
//
// The server publishes a `meteor_autoupdate_clientVersions`
// collection. There are two documents in this collection, a document
// with _id 'version' which represents the non refreshable client assets,
// and a document with _id 'version-refreshable' which represents the
// refreshable client assets. Each document has a 'version' field
// which is equivalent to the hash of the relevant assets. The refreshable
// document also contains a list of the refreshable assets, so that the client
// can swap in the new assets without forcing a page refresh. Clients can
// observe changes on these documents to detect when there is a new
// version available.
//
// In this implementation only two documents are present in the collection
// the current refreshable client version and the current nonRefreshable client
// version. Developers can easily experiment with different versioning and
// updating models by forking this package.
import Future from "fibers/future";
Autoupdate = {};
// The collection of acceptable client versions.
ClientVersions = new Mongo.Collection("meteor_autoupdate_clientVersions",
{ connection: null });
// The client hash includes __meteor_runtime_config__, so wait until
// all packages have loaded and have had a chance to populate the
// runtime config before using the client hash as our default auto
// update version id.
// Note: Tests allow people to override Autoupdate.autoupdateVersion before
// startup.
Autoupdate.autoupdateVersion = null;
Autoupdate.autoupdateVersionRefreshable = null;
Autoupdate.autoupdateVersionCordova = null;
Autoupdate.appId = __meteor_runtime_config__.appId = process.env.APP_ID;
var syncQueue = new Meteor._SynchronousQueue();
// updateVersions can only be called after the server has fully loaded.
var updateVersions = function (shouldReloadClientProgram) {
// Step 1: load the current client program on the server and update the
// hash values in __meteor_runtime_config__.
if (shouldReloadClientProgram) {
WebAppInternals.reloadClientPrograms();
}
// If we just re-read the client program, or if we don't have an autoupdate
// version, calculate it.
if (shouldReloadClientProgram || Autoupdate.autoupdateVersion === null) {
Autoupdate.autoupdateVersion =
process.env.AUTOUPDATE_VERSION ||
WebApp.calculateClientHashNonRefreshable();
}
// If we just recalculated it OR if it was set by (eg) test-in-browser,
// ensure it ends up in __meteor_runtime_config__.
__meteor_runtime_config__.autoupdateVersion =
Autoupdate.autoupdateVersion;
Autoupdate.autoupdateVersionRefreshable =
__meteor_runtime_config__.autoupdateVersionRefreshable =
process.env.AUTOUPDATE_VERSION ||
WebApp.calculateClientHashRefreshable();
Autoupdate.autoupdateVersionCordova =
__meteor_runtime_config__.autoupdateVersionCordova =
process.env.AUTOUPDATE_VERSION ||
WebApp.calculateClientHashCordova();
// Step 2: form the new client boilerplate which contains the updated
// assets and __meteor_runtime_config__.
if (shouldReloadClientProgram) {
WebAppInternals.generateBoilerplate();
}
// XXX COMPAT WITH 0.8.3
if (! ClientVersions.findOne({current: true})) {
// To ensure apps with version of Meteor prior to 0.9.0 (in
// which the structure of documents in `ClientVersions` was
// different) also reload.
ClientVersions.insert({current: true});
}
if (! ClientVersions.findOne({_id: "version"})) {
ClientVersions.insert({
_id: "version",
version: Autoupdate.autoupdateVersion
});
} else {
ClientVersions.update("version", { $set: {
version: Autoupdate.autoupdateVersion
}});
}
if (! ClientVersions.findOne({_id: "version-cordova"})) {
ClientVersions.insert({
_id: "version-cordova",
version: Autoupdate.autoupdateVersionCordova,
refreshable: false
});
} else {
ClientVersions.update("version-cordova", { $set: {
version: Autoupdate.autoupdateVersionCordova
}});
}
// Use `onListening` here because we need to use
// `WebAppInternals.refreshableAssets`, which is only set after
// `WebApp.generateBoilerplate` is called by `main` in webapp.
WebApp.onListening(function () {
if (! ClientVersions.findOne({_id: "version-refreshable"})) {
ClientVersions.insert({
_id: "version-refreshable",
version: Autoupdate.autoupdateVersionRefreshable,
assets: WebAppInternals.refreshableAssets
});
} else {
ClientVersions.update("version-refreshable", { $set: {
version: Autoupdate.autoupdateVersionRefreshable,
assets: WebAppInternals.refreshableAssets
}});
}
});
};
Meteor.publish(
"meteor_autoupdate_clientVersions",
function (appId) {
// `null` happens when a client doesn't have an appId and passes
// `undefined` to `Meteor.subscribe`. `undefined` is translated to
// `null` as JSON doesn't have `undefined.
check(appId, Match.OneOf(String, undefined, null));
// Don't notify clients using wrong appId such as mobile apps built with a
// different server but pointing at the same local url
if (Autoupdate.appId && appId && Autoupdate.appId !== appId)
return [];
return ClientVersions.find();
},
{is_auto: true}
);
Meteor.startup(function () {
updateVersions(false);
});
var fut = new Future();
// We only want 'refresh' to trigger 'updateVersions' AFTER onListen,
// so we add a queued task that waits for onListen before 'refresh' can queue
// tasks. Note that the `onListening` callbacks do not fire until after
// Meteor.startup, so there is no concern that the 'updateVersions' calls from
// 'refresh' will overlap with the `updateVersions` call from Meteor.startup.
syncQueue.queueTask(function () {
fut.wait();
});
WebApp.onListening(function () {
fut.return();
});
var enqueueVersionsRefresh = function () {
syncQueue.queueTask(function () {
updateVersions(true);
});
};
// Listen for the special {refresh: 'client'} message, which signals that a
// client asset has changed.
process.on('message', Meteor.bindEnvironment(function (m) {
if (m && m.refresh === 'client') {
enqueueVersionsRefresh();
}
}, "handling client refresh message"));
// Another way to tell the process to refresh: send SIGHUP signal
process.on('SIGHUP', Meteor.bindEnvironment(function () {
enqueueVersionsRefresh();
}, "handling SIGHUP signal for refresh"));

@ -1,30 +0,0 @@
Package.describe({
summary: "Update the client when new client code is available",
version: '1.4.0'
});
Package.onUse(function (api) {
api.use([
'webapp',
'check'
], 'server');
api.use([
'tracker',
'retry'
], 'client');
api.use([
'ecmascript',
'ddp',
'mongo'
], ['client', 'server']);
api.use(['http', 'random'], 'web.cordova');
api.addFiles('autoupdate_server.js', 'server');
api.addFiles('autoupdate_client.js', 'web.browser');
api.addFiles('autoupdate_cordova.js', 'web.cordova');
api.export('Autoupdate');
});

@ -83,7 +83,7 @@ if (!window._paq || window.ga) {
(() => {
let oldUserId = null;
Meteor.autorun(() => {
Tracker.autorun(() => {
const newUserId = Meteor.userId();
if (oldUserId === null && newUserId) {
if (window._paq && RocketChat.settings.get('Analytics_features_users')) {

@ -8,7 +8,7 @@ Package.describe({
// Note: Piwik respects Google Chrome's No Track: http://piwik.org/docs/privacy/#step-4-respect-donottrack-preference
Package.onUse(function(api) {
api.use(['ecmascript', 'rocketchat:lib']);
api.use(['ecmascript', 'rocketchat:lib', 'tracker']);
api.use(['templating', 'kadira:flow-router'], 'client');
api.addFiles(['client/loadScript.js', 'client/trackEvents.js'], 'client');

@ -390,8 +390,6 @@ WebAppHashing.calculateClientHash = function(manifest, includeFilter, runtimeCon
size: value.cache.size,
hash: value.cache.hash,
};
WebAppInternals.staticFiles[`/__cordova/assets/${ key }`] = value.cache;
WebAppInternals.staticFiles[`/__cordova/assets/${ key }.${ value.cache.extension }`] = value.cache;
} else {
const extension = value.defaultUrl.split('.').pop();
cache = {
@ -403,9 +401,6 @@ WebAppHashing.calculateClientHash = function(manifest, includeFilter, runtimeCon
url: `/assets/${ key }.${ extension }?v3`,
hash: 'v3',
};
WebAppInternals.staticFiles[`/__cordova/assets/${ key }`] = WebAppInternals.staticFiles[`/__cordova/${ value.defaultUrl }`];
WebAppInternals.staticFiles[`/__cordova/assets/${ key }.${ extension }`] = WebAppInternals.staticFiles[`/__cordova/${ value.defaultUrl }`];
}
const manifestItem = _.findWhere(manifest, {

@ -5,24 +5,30 @@ Package.describe({
git: '',
});
const additionalPackages = {
livechat: 'rocketchat-livechat/.app/i18n',
};
const fs = Npm.require('fs');
Package.onUse(function(api) {
api.use('templating', 'client');
const fs = Npm.require('fs');
const workingDir = process.env.PWD || '.';
const i18nDir = `${ workingDir }/packages/rocketchat-i18n/i18n`;
fs.readdirSync(i18nDir).forEach(function(filename) {
if (filename.indexOf('.json') > -1 && fs.statSync(`${ i18nDir }/${ filename }`).size > 16) {
api.addFiles(`i18n/${ filename }`);
}
});
const livechatDir = `${ workingDir }/packages/rocketchat-livechat/.app/i18n`;
fs.readdirSync(livechatDir).forEach(function(filename) {
if (filename.indexOf('.json') > -1 && fs.statSync(`${ livechatDir }/${ filename }`).size > 16) {
fs.writeFileSync(`${ i18nDir }/livechat.${ filename }`, fs.readFileSync(`${ livechatDir }/${ filename }`));
Object.keys(additionalPackages).forEach(function(current) {
const fullPath = `${ workingDir }/packages/${ additionalPackages[current] }`;
fs.readdirSync(fullPath).forEach(function(filename) {
if (filename.indexOf('.json') > -1 && fs.statSync(`${ fullPath }/${ filename }`).size > 16) {
fs.writeFileSync(`${ i18nDir }/${ current }.${ filename }`, fs.readFileSync(`${ fullPath }/${ filename }`));
}
});
});
api.addFiles(`i18n/livechat.${ filename }`);
fs.readdirSync(i18nDir).forEach(function(filename) {
if (filename.indexOf('.json') > -1 && filename.indexOf('livechat.') === -1 && fs.statSync(`${ i18nDir }/${ filename }`).size > 16) {
api.addFiles(`i18n/${ filename }`);
}
});

@ -9,7 +9,7 @@
"resolved": "https://registry.npmjs.org/katex/-/katex-0.9.0.tgz",
"integrity": "sha512-lp3x90LT1tDZBW2tjLheJ98wmRMRjUHwk4QpaswT9bhqoQZ+XA4cPcjcQBxgOQNwaOSt6ZeL/a6GKQ1of3LFxQ==",
"requires": {
"match-at": "0.1.1"
"match-at": "^0.1.1"
}
},
"match-at": {

@ -18,7 +18,7 @@ RocketChat.applyCustomTranslations = function applyCustomTranslations() {
};
Meteor.startup(function() {
Meteor.autorun(function() {
Tracker.autorun(function() {
// Re apply translations if tap language was changed
Session.get(TAPi18n._loaded_lang_session_key);
RocketChat.applyCustomTranslations();

@ -2,7 +2,7 @@
(() => {
let oldUserId = null;
Meteor.autorun(() => {
Tracker.autorun(() => {
const newUserId = Meteor.userId();
if (oldUserId === null && newUserId) {
RocketChat.API.v1.get('commands.list').then(function _loadedCommands(result) {

@ -4,20 +4,20 @@
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.
meteor@1.8.2
webapp@1.5.0
logging@1.1.19
tracker@1.1.3
meteor@1.9.2
webapp@1.7.0
logging@1.1.20
tracker@1.2.0
deps@1.0.12
session@1.1.7
session@1.1.8
ddp@1.4.0
livedata@1.0.18
mongo@1.4.2
mongo@1.6.0
blaze
ui
spacebars
templating
check@1.3.0
check@1.3.1
jquery@1.11.10
random@1.1.0
ejson@1.1.0
@ -25,17 +25,17 @@ rocketchat:streamer
kadira:flow-router
kadira:blaze-layout
konecty:nrr
less@2.7.11
less@2.8.0
momentjs:moment
mizzao:timesync
reactive-var@1.0.11
accounts-password@1.5.0
accounts-password@1.5.1
tap:i18n
ecmascript@0.10.6
es5-shim@4.7.0
standard-minifier-css@1.4.0
standard-minifier-js@2.3.1
shell-server@0.3.1
dynamic-import@0.3.0
ecmascript@0.12.0
es5-shim@4.8.0
standard-minifier-css@1.5.0
standard-minifier-js@2.4.0
shell-server@0.4.0
dynamic-import@0.5.0
konecty:user-presence

@ -1,97 +1,99 @@
accounts-base@1.4.2
accounts-base@1.4.3
accounts-password@1.5.1
aldeed:simple-schema@1.5.4
allow-deny@1.1.0
babel-compiler@7.0.9
babel-runtime@1.2.2
babel-compiler@7.2.1
babel-runtime@1.3.0
base64@1.0.11
binary-heap@1.0.10
blaze@2.3.2
binary-heap@1.0.11
blaze@2.3.3
blaze-tools@1.0.10
boilerplate-generator@1.4.0
caching-compiler@1.1.12
caching-html-compiler@1.1.2
boilerplate-generator@1.6.0
caching-compiler@1.2.0
caching-html-compiler@1.1.3
callback-hook@1.1.0
cfs:http-methods@0.0.32
check@1.3.1
coffeescript@1.0.17
ddp@1.4.0
ddp-client@2.3.2
ddp-client@2.3.3
ddp-common@1.4.0
ddp-rate-limiter@1.0.7
ddp-server@2.1.2
ddp-server@2.2.0
deps@1.0.12
diff-sequence@1.1.0
dynamic-import@0.3.0
ecmascript@0.10.9
ecmascript-runtime@0.5.0
ecmascript-runtime-client@0.6.2
ecmascript-runtime-server@0.5.0
dynamic-import@0.5.0
ecmascript@0.12.1
ecmascript-runtime@0.7.0
ecmascript-runtime-client@0.8.0
ecmascript-runtime-server@0.7.1
ejson@1.1.0
email@1.2.3
es5-shim@4.7.3
es5-shim@4.8.0
fetch@0.1.0
geojson-utils@1.0.10
html-tools@1.0.11
htmljs@1.0.11
http@1.4.1
id-map@1.1.0
inter-process-messaging@0.1.0
jquery@1.11.11
kadira:blaze-layout@2.3.0
kadira:flow-router@2.12.1
konecty:nrr@2.0.2
konecty:user-presence@2.1.0
less@2.7.12
konecty:user-presence@2.2.0
less@2.8.0
livedata@1.0.18
localstorage@1.2.0
logging@1.1.20
mdg:validation-error@0.5.1
meteor@1.8.6
meteor@1.9.2
meteorspark:util@0.2.0
minifier-css@1.3.1
minifier-js@2.3.5
minimongo@1.4.4
minifier-css@1.4.0
minifier-js@2.4.0
minimongo@1.4.5
mizzao:timesync@0.5.0
modules@0.11.8
modules-runtime@0.9.2
modern-browsers@0.1.2
modules@0.13.0
modules-runtime@0.10.3
momentjs:moment@2.22.2
mongo@1.4.7
mongo@1.6.0
mongo-decimal@0.1.0
mongo-dev-server@1.1.0
mongo-id@1.0.7
nooitaf:colors@1.1.2_1
npm-bcrypt@0.9.3
npm-mongo@2.2.34
npm-mongo@3.1.1
observe-sequence@1.0.16
ordered-dict@1.1.0
promise@0.10.2
promise@0.11.1
raix:eventemitter@0.1.3
random@1.1.0
rate-limit@1.0.9
reactive-dict@1.2.0
reactive-dict@1.2.1
reactive-var@1.0.11
reload@1.2.0
retry@1.1.0
rocketchat:streamer@0.6.2
routepolicy@1.0.13
server-render@0.3.1
rocketchat:streamer@1.0.1
routepolicy@1.1.0
service-configuration@1.0.11
session@1.1.7
session@1.1.8
sha@1.0.9
shell-server@0.3.1
shim-common@0.1.0
socket-stream-client@0.1.0
shell-server@0.4.0
socket-stream-client@0.2.2
spacebars@1.0.15
spacebars-compiler@1.1.3
srp@1.0.10
standard-minifier-css@1.4.1
standard-minifier-js@2.3.4
srp@1.0.12
standard-minifier-css@1.5.1
standard-minifier-js@2.4.0
tap:i18n@1.8.2
templating@1.3.2
templating-compiler@1.3.3
templating-runtime@1.3.2
templating-tools@1.1.2
tracker@1.1.3
tracker@1.2.0
ui@1.0.13
underscore@1.0.10
url@1.2.0
webapp@1.5.0
webapp@1.7.0
webapp-hashing@1.0.9

File diff suppressed because it is too large Load Diff

@ -20,18 +20,18 @@
"email": "support@rocket.chat"
},
"dependencies": {
"@babel/runtime": "^7.0.0-beta.49",
"autolinker": "^1.6.2",
"@babel/runtime": "^7.1.2",
"autolinker": "^1.7.1",
"bcrypt": "^2.0.1",
"core-js": "^2.5.7",
"jquery": "^3.3.1",
"meteor-node-stubs": "^0.3.3",
"mime-db": "^1.34.0",
"mime-db": "^1.37.0",
"mime-type": "^3.0.5",
"moment": "^2.22.2",
"sweetalert2": "^7.24.4",
"sweetalert2": "^7.28.11",
"toastr": "^2.1.4",
"underscore": "^1.9.1",
"underscore.string": "^3.3.4"
"underscore.string": "^3.3.5"
}
}

@ -1,7 +0,0 @@
This directory and the files immediately inside it are automatically generated
when you change this package's NPM dependencies. Commit the files in this
directory (npm-shrinkwrap.json, .gitignore, and this README) to source control
so that others run the same versions of sub-dependencies.
You should NOT check in the node_modules directory that Meteor automatically
creates; if you are using git, the .gitignore file tells git to ignore it.

@ -1,62 +0,0 @@
{
"lockfileVersion": 1,
"dependencies": {
"ansi-styles": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
"integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug=="
},
"app-module-path": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/app-module-path/-/app-module-path-2.2.0.tgz",
"integrity": "sha1-ZBqlXft9am8KgUHEucCqULbCTdU="
},
"chalk": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz",
"integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q=="
},
"color-convert": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz",
"integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ=="
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
"has-flag": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
"integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE="
},
"postcss": {
"version": "6.0.13",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
"integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
"dependencies": {
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
}
}
},
"source-map": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz",
"integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI="
},
"supports-color": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz",
"integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s="
}
}
}

@ -1,25 +0,0 @@
Package.describe({
summary: 'Minifier for Meteor with PostCSS processing',
version: '1.0.0',
name: 'rocketchat:postcss',
});
Package.registerBuildPlugin({
name: 'minifier-postcss',
use: [
'ecmascript',
'minifier-css',
],
npmDependencies: {
'app-module-path': '2.2.0',
postcss: '6.0.13',
'source-map': '0.5.6',
},
sources: [
'plugin/minify-css.js',
],
});
Package.onUse(function(api) {
api.use('isobuild:minifier-plugin');
});

@ -1,198 +0,0 @@
/* global CssTools */
import appModulePath from 'app-module-path';
import Future from 'fibers/future';
import fs from 'fs';
import path from 'path';
import postCSS from 'postcss';
import sourcemap from 'source-map';
appModulePath.addPath(`${ process.cwd() }/node_modules/`);
const postCSSConfigFile = path.resolve(process.cwd(), '.postcssrc');
const postCSSConfig = JSON.parse(fs.readFileSync(postCSSConfigFile));
const getPostCSSPlugins = () => {
const plugins = [];
if (postCSSConfig.plugins) {
Object.keys(postCSSConfig.plugins).forEach((pluginName) => {
const postCSSPlugin = require(pluginName);
if (postCSSPlugin && postCSSPlugin().postcssPlugin) {
plugins.push(postCSSPlugin(postCSSConfig.plugins ? postCSSConfig.plugins[pluginName] : {}));
}
});
}
return plugins;
};
const getExcludedPackages = () => {
if (postCSSConfig.excludedPackages && postCSSConfig.excludedPackages instanceof Array) {
return postCSSConfig.excludedPackages;
}
return false;
};
const isNotInExcludedPackages = (excludedPackages, pathInBundle) => {
let exclArr = [];
if (excludedPackages && excludedPackages instanceof Array) {
exclArr = excludedPackages.map((packageName) => pathInBundle && pathInBundle.indexOf(`packages/${ packageName.replace(':', '_') }`) > -1);
}
return exclArr.indexOf(true) === -1;
};
const isNotImport = (inputFileUrl) => !(/\.import\.css$/.test(inputFileUrl) || /(?:^|\/)imports\//.test(inputFileUrl));
const mergeCss = (css) => {
const originals = {};
const excludedPackagesArr = getExcludedPackages();
const cssAsts = css.map((file) => {
const filename = file.getPathInBundle();
originals[filename] = file;
const f = new Future;
let css;
let postres;
const isFileForPostCSS = isNotInExcludedPackages(excludedPackagesArr, file.getPathInBundle());
postCSS(isFileForPostCSS ? getPostCSSPlugins() : [])
.process(file.getContentsAsString(), {
from: process.cwd() + file._source.url.replace('_', '-'),
})
.then((result) => {
result.warnings().forEach((warn) => {
process.stderr.write(warn.toString());
});
f.return(result);
})
.catch((error) => {
if (error.name === 'CssSyntaxError') {
error.message = `${ error.message }\n\nCss Syntax Error.\n\n${ error.message }${ error.showSourceCode() }`;
}
f.return(error);
});
try {
const parseOptions = {
source: filename,
position: true,
};
postres = f.wait();
if (postres.name === 'CssSyntaxError') {
throw postres;
}
css = postres.css;
const ast = CssTools.parseCss(css, parseOptions);
ast.filename = filename;
return ast;
} catch (e) {
if (e.name === 'CssSyntaxError') {
file.error({
message: e.message,
line: e.line,
column: e.column,
});
} else if (e.reason) {
file.error({
message: e.reason,
line: e.line,
column: e.column,
});
} else {
file.error({
message: e.message,
});
}
return {
type: 'stylesheet',
stylesheet: { rules: [] },
filename,
};
}
});
const mergedCssAst = CssTools.mergeCssAsts(cssAsts, (filename, msg) => {
console.log(`${ filename }: warn: ${ msg }`);
});
const stringifiedCss = CssTools.stringifyCss(mergedCssAst, {
sourcemap: true,
inputSourcemaps: false,
});
if (!stringifiedCss.code) {
return { code: '' };
}
stringifiedCss.map.sourcesContent =
stringifiedCss.map.sources.map((filename) => originals[filename].getContentsAsString());
const newMap = sourcemap.SourceMapGenerator.fromSourceMap(new sourcemap.SourceMapConsumer(stringifiedCss.map));
Object.keys(originals).forEach((name) => {
const file = originals[name];
if (!file.getSourceMap()) {
return false;
}
try {
newMap.applySourceMap(new sourcemap.SourceMapConsumer(file.getSourceMap()), name);
} catch (err) {
// If can't apply the source map, silently drop it.
}
});
return {
code: stringifiedCss.code,
sourceMap: newMap.toString(),
};
};
class CssToolsMinifier {
processFilesForBundle(files, options) {
const mode = options.minifyMode;
if (!files.length) {
return false;
}
const filesToMerge = [];
files.forEach((file) => {
if (isNotImport(file._source.url)) {
filesToMerge.push(file);
}
});
const merged = mergeCss(filesToMerge);
if (mode === 'development') {
files[0].addStylesheet({
data: merged.code,
sourceMap: merged.sourceMap,
path: 'merged-stylesheets.css',
});
return false;
}
const minifiedFiles = CssTools.minifyCss(merged.code);
if (files.length) {
minifiedFiles.forEach((minified) => {
files[0].addStylesheet({
data: minified,
});
});
}
}
}
Plugin.registerMinifier({ extensions: ['css'] }, () => new CssToolsMinifier);

@ -10,7 +10,7 @@ Package.onUse(function(api) {
api.use('ecmascript');
api.use('service-configuration');
api.use('templating', 'client');
api.use('percolate:synced-cron');
api.use('littledata:synced-cron');
api.use('rocketchat:lib');
api.use('rocketchat:authorization');
api.use('rocketchat:custom-oauth');

@ -1,6 +1,6 @@
Template.cmsPage.onCreated(function() {
this.page = new ReactiveVar('');
return Meteor.autorun(() => {
return Tracker.autorun(() => {
const cmsPage = Session.get('cmsPage');
if (cmsPage != null) {
return this.page.set(RocketChat.settings.get(cmsPage));

@ -11,7 +11,7 @@ Package.onUse(function(api) {
'ecmascript',
'rocketchat:lib',
'rocketchat:logger',
'percolate:synced-cron',
'littledata:synced-cron',
]);
api.mainModule('client/client.js', 'client');

@ -1,5 +1,4 @@
/* General */
@import 'imports/general/reset.css';
@import 'imports/general/variables.css';
@import 'imports/general/base_old.css';
@import 'imports/general/base.css';
@ -8,6 +7,7 @@
/* Forms */
@import 'imports/general/forms.css';
@import 'imports/general/reset.css';
@import 'imports/forms/button.css';
@import 'imports/forms/input.css';
@import 'imports/forms/select.css';

@ -4,30 +4,25 @@ Package.describe({
summary: '',
git: '',
});
Package.onUse(function(api) {
api.use('rocketchat:lib');
api.use('rocketchat:logger');
api.use('rocketchat:assets');
api.use('juliancwirko:postcss');
api.use('ecmascript');
api.use('less');
api.use('webapp');
api.use('webapp-hashing');
api.use('templating', 'client');
// Compiled stylesheets
api.addFiles('client/main.css', 'client');
// Server side files
api.addFiles('server/server.js', 'server');
api.addFiles('server/variables.js', 'server');
// Colorpicker
api.addFiles('client/vendor/jscolor.js', 'client');
// Photoswipe
api.addFiles('client/vendor/photoswipe.css', 'client');
api.addAssets('client/imports/general/variables.css', 'server');
// Fontello
api.addFiles('client/vendor/fontello/css/fontello.css', 'client');
@ -36,7 +31,6 @@ Package.onUse(function(api) {
api.addAssets('client/vendor/fontello/font/fontello.ttf', 'client');
api.addAssets('client/vendor/fontello/font/fontello.woff', 'client');
api.addAssets('client/vendor/fontello/font/fontello.woff2', 'client');
// Run-time stylesheets
api.addAssets('server/colors.less', 'server');
});
Loading…
Cancel
Save