index.rst 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ======================
  2. Firefox Home (New Tab)
  3. ======================
  4. All files related to Firefox Home, which includes content that appears on `about:home`,
  5. `about:newtab`, and `about:welcome`, can we found in the `browser/components/newtab` directory.
  6. Some of these source files (such as `.js`, `.jsx`, and `.sass`) require an additional build step.
  7. We are working on migrating this to work with `mach`, but in the meantime, please
  8. follow the following steps if you need to make changes in this directory:
  9. For .jsm files
  10. ---------------
  11. No build step is necessary. Use `mach` and run mochi tests according to your regular Firefox workflow.
  12. For .js, .jsx, .sass, or .css files
  13. -----------------------------------
  14. Prerequisites
  15. `````````````
  16. You will need the following:
  17. - Node.js 8+ (On Mac, the best way to install Node.js is to use the [install link on the Node.js homepage](https://nodejs.org/en/))
  18. - npm (packaged with Node.js)
  19. To install dependencies, run the following from the root of the mozilla-central repository
  20. (or cd into browser/components/newtab to omit the `--prefix` in any of these commands):
  21. .. code-block:: shell
  22. npm install --prefix browser/components/newtab
  23. Which files should you edit?
  24. ````````````````````````````
  25. You should not make changes to `.js` or `.css` files in `browser/components/newtab/css` or
  26. `browser/components/newtab/data` directory. Instead, you should edit the `.jsx`, `.js`, and `.sass` files
  27. in `browser/components/newtab/content-src` directory.
  28. Building assets and running Firefox
  29. ```````````````````````````````````
  30. To build assets and run Firefox, run the following from the root of the mozilla-central repository:
  31. .. code-block:: shell
  32. npm run bundle --prefix browser/components/newtab && ./mach run
  33. Running tests
  34. `````````````
  35. Mochi tests and xpcshell tests can be run normally. To run our additional unit tests, you can run the following:
  36. .. code-block:: shell
  37. npm test --prefix browser/components/newtab
  38. The Newtab team is currently responsible for fixing any test failures that result from changes
  39. until these tests are running in Try, so this is currently an optional step.
  40. GitHub workflow
  41. ---------------
  42. The files in this directory, including vendor dependencies, are synchronized with the https://github.com/mozilla/activity-stream repository. If you prefer a GitHub-based workflow, you can look at the documentation there to learn more.