-
Notifications
You must be signed in to change notification settings - Fork 468
Refactored Properties using Object.defineProperties #120
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
Merged
jpwsutton
merged 2 commits into
eclipse-paho:develop
from
tmulkern:refactor-public-properties
Sep 8, 2017
Merged
Refactored Properties using Object.defineProperties #120
jpwsutton
merged 2 commits into
eclipse-paho:develop
from
tmulkern:refactor-public-properties
Sep 8, 2017
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Refactored Properties using Object.defineProperties as seen here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties This reduces the javascript code by removing repeated code. This will have a impact on overall file size. Signed-off-by: Tadhg Mulkern<[email protected]>
Added a piece of code to removed the need for all the Typed Array checks, base on this method https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView and from the Stackoverflow answer https://stackoverflow.com/questions/15251879/how-to-check-if-a-variable-is-a-typed-array-in-javascript/29651223#29651223
Size before changes
https://travis-ci.org/eclipse/paho.mqtt.javascript/builds/272407632#L765 Size after changes
https://travis-ci.org/eclipse/paho.mqtt.javascript/builds/273000617#L773 That's a saving of 2% Uncompressed, 6% Compressed and 4% gzipped |
Thanks @tmulkern, nice improvement! |
jpwsutton
added a commit
that referenced
this pull request
Jul 23, 2018
* Removed reference to window and change to self (#116) * Removed reference to window and change to self Removed reference to window and change to self. This is to allow the client to be used in Web Workers see: https://developer.mozilla.org/en/docs/Web/API/Window/self Signed-off-by: Tadhg Mulkern<[email protected]> * Updated Client-hareness.js Updated Client-hareness.js, set global.window = global; to global.self = global; * Update .travis.yml to fix build error Update .travis.yml to fix build error, set nodejs version to use the latest stable version of 5.x * Refactored Properties using Object.defineProperties (#120) * Refactored Properties using Object.defineProperties Refactored Properties using Object.defineProperties as seen here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties This reduces the javascript code by removing repeated code. This will have a impact on overall file size. Signed-off-by: Tadhg Mulkern<[email protected]> * Added additional cleanup of code Added a piece of code to removed the need for all the Typed Array checks, base on this method https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView and from the Stackoverflow answer https://stackoverflow.com/questions/15251879/how-to-check-if-a-variable-is-a-typed-array-in-javascript/29651223#29651223 * Remove the needed for reversing arrays for processing Changed usages of push on this._buffered_msg_queue and this._msg_queue to use unshift https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift, removing the need to reverse the array to pop elements in fifo order Signed-off-by: Tadhg Mulkern<[email protected]> * Tweaking tests to run on travis. Signed-off-by: James Sutton <[email protected]> * Fix typo (#128) Signed-off-by: Nico Rikken <[email protected]> * Moving to eslint and setting consistent code style in paho-mqtt.js as well as improving build Signed-off-by: James Sutton <[email protected]> * Fixing tests to fully complete Signed-off-by: James Sutton <[email protected]> * Variable message should not be global Signed-off-by: Jannik Hunziker <[email protected]> * Function call should be local Signed-off-by: Jannik Hunziker <[email protected]> * Variable client should not be global Signed-off-by: Jannik Hunziker <[email protected]> * Variable client should not be global Signed-off-by: Jannik Hunziker <[email protected]> * Updating Utility to use Automatic Reconnect & have visible console Signed-off-by: James Sutton <[email protected]> * Fixing tests to work with updated interopability broker, updating .gitignore and readme. Signed-off-by: James Sutton <[email protected]> * Adding Travis badge and fixing typo. Signed-off-by: James Sutton <[email protected]> * Added subscribe/unsunbscribe support for multiple topics Signed-off-by: Michael Zak <[email protected]> * Fixing typo in PR and adding a test case Signed-off-by: James Sutton <[email protected]> * GDPR - Adding LocalStorage Warning to Utility Signed-off-by: James Sutton <[email protected]> * Brings Paho one step closer to be supported in non-browser environments. (#153) * Fix global object Signed-off-by: Manuel Iglesias <[email protected]> * Remove references to self Signed-off-by: Manuel Iglesias <[email protected]> * Fix arguments conversion to array Signed-off-by: Manuel Iglesias <[email protected]> * Use simple in-memory fake of localStorage when global one is not available Signed-off-by: Manuel Iglesias <[email protected]> * Updating version to 1.1.0 for Eclipse Photon Signed-off-by: James Sutton <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactored Properties using Object.defineProperties as seen here
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties
This reduces the javascript code by removing repeated code. This will
have an impact on overall file size.
Signed-off-by: Tadhg Mulkern[email protected]