Skip to content

Latest commit

 

History

History
68 lines (41 loc) · 3.66 KB

DEVELOPER.md

File metadata and controls

68 lines (41 loc) · 3.66 KB

Local Development

Welcome 🎉!! If you've found a bug, or have an idea to add a feature we'd love to hear from you. It may save time to first ping the group on Partytown's Discord channel to talk through any ideas or any issues that may be a bug.

Installation

npm install
npm run dev

See the distribution section about the various files created. Note that both the root directory, and the tests directory receive a copy of the build files, such as tests/~partytown/partytown.js.

Submitting Issues And Writing Tests

We need your help! If you found a bug, it's best to create a Pull Request that replicates the issue using a test page. In the tests directory, copy one of the directories, such as tests/platform/document, and recreate the issue you've found.

Follow the manual testing directions on how to start the local dev server. Next, the more you can describe the debug and pin-point the issue the better, and any fixes to the runtime to solve the problem would be awesome. 🎉

If the PR fixes the issue, then creating an end-to-end test would help ensure no regressions happen over time.

Plugin Authors / Developers

If you are the author / developer of any 3rd party plugin / library, and want to ensure that your library works with Partytown, we would love to work with you to ensure it does!

The easiest way to verify is to create a small, standalone replica in our integration tests directory. Our standard practice is to:

  • Create a standard.html which loads your library / plugin as it normally is loaded, as a <script type="text/javascript">. This file basically is your normal, happy case, with no Partytown in sight.
  • Create an index.html which loads your library, but also sets up Partytown. This file should:
    • Setup the partytown configuration
    • Load the partytown.js file
    • Mark the library / plugin that you want to test as text/partytown instead of text/javascript

To get a sense of this, you can take a look at some examples in the tests/integrations folder like Twitter. Usually, creating a copy of one of these folders and modifying it for a new plugin is the easiest way to get these to setup.

If it works, great! Send us a PR and we'd love to merge it in and highlight it as a working integration on our Common Services page . If for any reason it does not work, we would love to help you figure out why it might not be working and figure out a way forward.

Manual Testing

Tests to be manually ran on a browser are located in the tests directory. These pages can help to test out DOM apis and individual services.

npm run serve

http://localhost:4000/tests/

E2E Testing

E2E tests use @playwright/test, which allows us to test on Chromium, Firefox and WebKit browsers. These pages are also tested on every commit within the project's CI Workflow.

npm test

CI Test Results

Deployed Tests

The same pages found in tests are deployed to:

https://partytown.builder.io/

Publishing

npm run release