posthog-js 1.57.2 → 1.57.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## 1.57.4 - 2023-05-25
2
+
3
+ - fix: Session timeout overridden on reload (#645)
4
+
5
+ ## 1.57.3 - 2023-05-23
6
+
7
+ - fix: properties with "length" value (#640)
8
+ - docs: Update README around releasing and development (#634)
9
+ - chore: add test for $identify events count optimization (#639)
10
+ - ci: consolidate library checks into one workflow (#638)
11
+ - ci: add prettier and eslint linting stage (#637)
12
+ - chore: add pre-commit to run lint staged. (#636)
13
+ - chore: add functional tests (#635)
14
+
1
15
  ## 1.57.2 - 2023-05-17
2
16
 
3
17
 
package/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  [![npm package](https://img.shields.io/npm/v/posthog-js?style=flat-square)](https://www.npmjs.com/package/posthog-js)
4
4
  [![MIT License](https://img.shields.io/badge/License-MIT-red.svg?style=flat-square)](https://opensource.org/licenses/MIT)
5
5
 
6
- Please see [PostHog Docs](https://posthog.com/docs).
7
- Specifically, [browser JS library details](https://posthog.com/docs/libraries/js).
6
+ For information on using this library in your app, [see PostHog Docs](https://posthog.com/docs/libraries/js).
7
+ This README is intended for developing the library itself.
8
8
 
9
9
  ## Testing
10
10
 
@@ -47,71 +47,43 @@ You can use the create react app setup in `playground/nextjs` to test posthog-js
47
47
  2. Cypress tests - integrates with a real chrome browser and is capable of testing timing, browser requests, etc. Useful for testing high-level library behavior, ordering and verifying requests. We shouldn't aim for 100% coverage here as it's impossible to test all possible combinations.
48
48
  3. TestCafe E2E tests - integrates with a real posthog instance sends data to it. Hardest to write and maintain - keep these very high level
49
49
 
50
- ## Developing together with another repo
50
+ ## Developing together with another project
51
51
 
52
- #### Developing with main PostHog repo
52
+ Install Yalc to link a local version of `posthog-js` in another JS project: `npm install -g yalc`
53
53
 
54
- The `posthog-js` snippet for a website loads static js from the main `PostHog/posthog` repo. Which means, when testing the snippet with a website, there's a bit of extra setup required:
54
+ #### Run this to link the local version
55
55
 
56
- 1. Run `PostHog/posthog` locally
57
- 2. Link the `posthog-js` dependency to your local version (see below)
58
- 3. Run `yarn start` in `posthog-js`. (This ensures `dist/array.js` is being generated)
59
- 4. In your locally running `PostHog/posthog` build, run `yarn copy-scripts`. (This copies the scripts generated in step 3 to the static assets folder for `PostHog/posthog`)
56
+ - In the `posthog-js` directory: `yalc publish`
57
+ - In the other directory: `yalc add posthog-js`, then install dependencies
58
+ (for `posthog` this means: `yalc add posthog-js && pnpm i && pnpm copy-scripts`)
60
59
 
61
- Further, it's a good idea to modify `start-http` script to add development mode: `webpack serve --mode development`, which doesn't minify the resulting js (which you can then read in your browser).
60
+ #### Run this to update the linked local version
62
61
 
63
- ### Using Yalc to link local packages
62
+ - In the other directory: `yalc update`, then install dependencies
63
+ (for `posthog` this means: `yalc update && pnpm i && pnpm copy-scripts`)
64
64
 
65
- Run `npm install -g yalc`
65
+ #### Run this to unlink the local version
66
66
 
67
- - In the posthog-js repo
68
- - Run `yalc publish`
69
- - In the posthog repo
70
- - Run `yalc add posthog-js && pnpm i && pnpm copy-scripts`
71
-
72
- #### When making changes
73
-
74
- - In the posthog-js repo
75
- - Run `yalc publish`
76
- - In the posthog repo
77
- - Run `yalc update && pnpm i && pnpm copy-scripts`
78
-
79
- #### To remove the local package
80
-
81
- - In the posthog repo
82
- - run `yalc remove posthog-js`
83
- - run `yarn install`
67
+ - In the other directory: `yalc remove posthog-js`, then install dependencies
68
+ (for `posthog` this means: `yalc remove posthog-js && pnpm i && pnpm copy-scripts`)
84
69
 
85
70
  ## Releasing a new version
86
71
 
87
- Just bump up `version` in `package.json` on the main branch and the new version will be published automatically,
88
- with a matching PR in the [main PostHog repo](https://github.com/posthog/posthog) created.
89
-
90
- It's advised to use `bump patch/minor/major` label on PRs - that way the above will be done automatically
91
- when the PR is merged.
92
-
93
- Courtesy of GitHub Actions.
94
-
95
- ### Manual steps
96
-
97
- To release a new version, make sure you're logged into npm (`npm login`).
98
-
99
- We tend to follow the following steps:
100
-
101
- 1. Merge your changes into master.
102
- 2. Release changes as a beta version:
103
- - `npm version 1.x.x-beta.0`
104
- - `npm publish --tag beta`
105
- - `git push --tags`
106
- 3. Create a PR linking to this version in the [main PostHog repo](https://github.com/posthog/posthog).
107
- 4. Once deployed and tested, write up CHANGELOG.md, and commit.
108
- 5. Release a new version:
109
- - `npm version 1.x.x`
110
- - `npm publish`
111
- - `git push --tags`
112
- 6. Create a PR linking to this version in the [main PostHog repo](https://github.com/posthog/posthog).
72
+ Just put a `bump patch/minor/major` label on your PR! Once the PR is merged, a new version with the appropriate version bump will be released, and the dependency will be updated in [posthog/PostHog](https://github.com/posthog/PostHog) – automatically.
73
+
74
+ If you want to release a new version without a PR (e.g. because you forgot to use the label), check out the `master` branch and run `npm version [major | minor | patch] && git push --tags` - this will trigger the automated release process just like the label.
113
75
 
76
+ ### Prereleases
114
77
 
115
- ## Questions?
78
+ To release an alpha or beta version, you'll need to use the CLI locally:
116
79
 
117
- ### [Join our Slack community.](https://posthog.com/slack)
80
+ 1. Make sure you're a collaborator on `posthog-js` in npm ([check here](https://www.npmjs.com/package/posthog-js)).
81
+ 2. Make sure you're logged into the npm CLI (`npm login`).
82
+ 3. Check out your work-in-progress branch (do not release an alpha/beta from `master`).
83
+ 4. Run the following commands, using the same bump level (major/minor/patch) as your PR:
84
+ ```bash
85
+ npm version [premajor | preminor | prepatch] --preid=beta
86
+ npm publish --tag beta
87
+ git push --tags
88
+ ```
89
+ 5. Enjoy the new prerelease version. You can now use it locally, in a dummy app, or in the [main repo](https://github.com/posthog/PostHog).