3
edits
(formatting) |
(Formatting, documented kinto github repositories) |
||
Line 11: | Line 11: | ||
* Certificates blocklist (OneCRL) | * Certificates blocklist (OneCRL) | ||
* Addons/Plugins/Gfx | * Addons/Plugins/Gfx [[Blocklisting]] | ||
* storage.sync API ( | * <code>storage.sync</code> API ([[WebExtensions]]) | ||
== Upgrade client libraries == | == Upgrade client libraries == | ||
Line 18: | Line 18: | ||
Two client libraries are embedded in Firefox: | Two client libraries are embedded in Firefox: | ||
* | * <code>Kinto/kinto-client.js</code>: for direct interactions with the Kinto HTTP API | ||
* | * <code>Kinto/kinto.js</code>: for offline persistence in internal SQLite | ||
=== Generate bundles === | === Generate bundles === | ||
The libraries are developed independently on Github | The Kinto client libraries are developed independently on Github: | ||
* [https://github.com/Kinto/kinto-client kinto-client] is the HTTP client for the Kinto REST API; | |||
* [https://github.com/Kinto/kinto.js kinto.js] is the offline-first client for Kinto. | |||
With the help of Babel and browsersify, a bundle is generated for Firefox with the minimum transpilation possible (eg. CommonJS require, ES7 decorators). | With the help of Babel and browsersify, a bundle is generated for Firefox with the minimum transpilation possible (eg. CommonJS require, ES7 decorators). | ||
==== kinto.js ==== | ==== kinto.js ==== | ||
From kinto.js repo, generate the | From the kinto.js repo, generate the <code>moz-kinto-offline-client.js</code> file: | ||
<pre> | |||
$ npm run dist-fx | |||
</pre> | |||
And overwrite it in the Firefox code base: | And overwrite it in the Firefox code base: | ||
<pre> | |||
$ cp dist/moz-kinto-offline-client.js ../mozilla-central/services/common/kinto-offline-client.js | |||
</pre> | |||
==== kinto-client.js ==== | ==== kinto-client.js ==== | ||
From kinto-client.js repo, generate the | From the kinto-client.js repo, generate the <code>moz-kinto-http-client.js</code> file: | ||
<pre> | |||
$ npm run dist-fx | |||
</pre> | |||
And overwrite it in the Firefox code base: | And overwrite it in the Firefox code base: | ||
<pre> | |||
$ cp dist/moz-kinto-http-client.js ../mozilla-central/services/common/kinto-http-client.js | |||
</pre> | |||
=== Run the tests === | === Run the tests === | ||
Line 52: | Line 64: | ||
For JavaScript updates only, have a look at [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Artifact_builds Artifacts Builds], trading bandwidth for compilation time. | For JavaScript updates only, have a look at [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Artifact_builds Artifacts Builds], trading bandwidth for compilation time. | ||
<pre> | |||
$ ./mach build faster | |||
$ ./mach xpcshell-test services/common/tests/unit/test_kinto.js | |||
$ ./mach xpcshell-test services/common/tests/unit/test_storage_adapter.js | |||
</pre> | |||
Or all tests related to Kinto: | Or all tests related to Kinto: | ||
<pre> | |||
$ ./mach xpcshell-test services/common/tests/unit/*into* | |||
</pre> | |||
==== TDD mode ==== | ==== TDD mode ==== | ||
Using ''inotify'', we will detect a file change in the | Using ''inotify'', we will detect a file change in the <code>dist/</code> folder and run a series of commands to execute the tests automatically. | ||
First, install ''inotify-tools'': | First, install ''inotify-tools'': | ||
<pre> | |||
sudo apt-get install inotify-tools | |||
</pre> | |||
Then start an infinite loop with | Then start an infinite loop with <code>inotify-wait</code>: | ||
<pre> | |||
while true; do | |||
# Wait for a change | |||
inotifywait -q -e create,modify,delete -r ~/Code/Mozilla/kinto.js/dist | |||
# Execute these commands | |||
cp ~/Code/Mozilla/kinto.js/dist/moz-kinto-offline-client.js services/common/kinto-offline-client.js | |||
./mach xpcshell-test services/common/tests/unit/test_storage_adapter.js | |||
./mach xpcshell-test services/common/tests/unit/test_kinto.js | |||
done | |||
</pre> | |||
[http://makina-corpus.com/blog/metier/2013/utiliser-inotify-pour-tester-en-continu-son-code Source: Antoine Cezar] | [http://makina-corpus.com/blog/metier/2013/utiliser-inotify-pour-tester-en-continu-son-code Source: Antoine Cezar] | ||
Line 88: | Line 107: | ||
'''DO NOT''' land files that are not tagged officially on upstream repositories. | '''DO NOT''' land files that are not tagged officially on upstream repositories. | ||
==== Become a contributor | ==== Become a contributor ==== | ||
* Generate a SSH key | * Generate a SSH key | ||
Line 97: | Line 116: | ||
Configure SSH key for hg: | Configure SSH key for hg: | ||
<pre> | |||
Host hg.mozilla.org | |||
User user@server.com | |||
IdentityFile ~/.ssh/contrib_moz | |||
</pre> | |||
==== Run integration tests: «Try» ==== | ==== Run integration tests: «Try» ==== | ||
Line 107: | Line 128: | ||
Or use a ''gecko-dev'' fork from Github, and with install [https://github.com/mozilla/moz-git-tools moz git tools] | Or use a ''gecko-dev'' fork from Github, and with install [https://github.com/mozilla/moz-git-tools moz git tools] | ||
<pre> | |||
git push-to-try -t --rev master..HEAD ~/hg/mozilla-central/ -b do -p linux,linux64,macosx64,win32,win64 -u xpcshell -t none | |||
</pre> | |||
==== Submit for review ==== | ==== Submit for review ==== | ||
Line 113: | Line 136: | ||
See http://mozilla-version-control-tools.readthedocs.org | See http://mozilla-version-control-tools.readthedocs.org | ||
<pre> | |||
# Commit with link to Bugzilla | |||
hg commit -m "Bug XXXXX - Upgrade <lib> to X.Y.Z" | |||
# Submit to MozReview | |||
hg push review | |||
# Keep a bookmark of your branch to address review. | |||
hg bookmark bug-XXXXX | |||
# Go back to «master» | |||
hg update central | |||
</pre> | |||
Examples: | Examples: | ||
* https://reviewboard.mozilla.org/r/45445/ | * https://reviewboard.mozilla.org/r/45445/ |
edits