0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-25 11:17:50 +01:00
Commit Graph

291 Commits

Author SHA1 Message Date
Alex Gyujin Kim
07186942ef
Event list in session recordings player (#6971)
Co-authored-by: Rick Marron <rcmarron@gmail.com>
2021-11-12 12:47:22 -08:00
PostHog bot
46ad68649d
Update posthog-js to 1.16.3 (#7104) 2021-11-12 16:37:38 +00:00
Marius Andra
cbea9dcca1
replace live-server with our own express file serving system (#6990) 2021-11-09 14:55:02 +01:00
Marius Andra
26a3b06445
Add paths to logics (#6945)
* add typegen with path writing support

* toolbar paths

* scene paths

* all other paths

* revert deleted comments

* add two missing paths
2021-11-09 07:59:21 +00:00
Rick Marron
f7d7a3b005
Player tweaks and fixes (#6928)
* fix player close button position

* reduce player padding

* allow recording on seek bar

* remove skip inactivity toggle

* style fix

* update rrweb

* add svg for remvoed content

* add ts ignore to legacy files
2021-11-08 13:49:55 -08:00
PostHog bot
dd9493a430
Update posthog-js to 1.16.2 (#6933) 2021-11-07 17:16:10 +00:00
Yakko Majuri
7a3e25742d
Fix pre-commit hook (#6902)
* pre commit hook

* final config options

* try new approach

* update prettierignore
2021-11-04 17:09:40 +00:00
Marius Andra
128af73705
Revert "dev(react): add react hook eslint rules, as warnings" (#6831)
* Revert "dev(react): add react hook eslint rules, as warnings (#6571)"

This reverts commit f06e0b4c51.

* revert all eslint comments
2021-11-03 21:44:41 +00:00
Paolo D'Amico
3bd79cc6a1
Update dev start commands for ESBuild (#6829) 2021-11-03 11:41:28 -06:00
Marius Andra
c82ca49686
Less cleaning for the build (#6812)
* less cleaning for the build

* push layout.html

* copy the right file, fix build script
2021-11-03 12:30:48 +01:00
Marius Andra
b5a02e2ca7
Bundle our frontend via esbuild (#6758)
* esbuild package

* almost get esbuild working

* fix react-virtualized imports

* add splitting

* fix funny import reorder bug

* fix squeakAudio referring to itself

* write index.html file

* fix some bad imports

* update antd paths

* remove raw-loader usage, it didn't work anyway

* refactor and copy public

* build app and toolbar

* get toolbar working, but without styles

* make toolbar and its styles work

* shared dashboards

* clean frontend build before rebuilding

* add watch mode

* reorder tasks

* revert js url

* incremental builds of app with debounced chokidar watching

* common build/watch script

* improve logs

* watch during firrst build

* fix toolbar url

* fix wrongly exported scene

* create sceneProxyLogic to untangle sceneLogic from all bundles

* disconnect sceneLogic and refactor setPageTitle

* live reloading server

* rename utils file

* only wait for /static

* fix encoding

* simplify

* add missing dayjs plugins

* fix pathless logics

* simplify options

* add jsx for webapck

* slight delay to catch changes

* a type is a type

* fix build

* esbuild in start

* funnelLogic path

* include all files with a "." (so .mjs, etc) in /frontend/ to docker

* rename to "utils.mjs", make "build.mjs" executable

* improve erroring

* revert some needless changes

* more reverts

* change some scripts

* remove setuff

* clarify function

* make "--host 0.0.0.0" work

* fix import order issue in webpack

* remove webpack css inlining for toolbar to simplify config

* make toolbar with external styles work in storybook

* move live server injection into django

* fix undefined bug

* simplify setup to work with injection directly in http://localhost:8000 (no proxying needed on :8234)

* add comments

* Fix `fse` usage

I was getting this otherwise:

$ node frontend/build.mjs
file:///Users/twixes/Developer/posthog/frontend/utils.mjs:46
    fse.copySync(srcDir, destDir, { overwrite: true }, function (err) {
        ^

TypeError: fse.copySync is not a function
    at copyPublicFolder (file:///Users/twixes/Developer/posthog/frontend/utils.mjs:46:9)
    at file:///Users/twixes/Developer/posthog/frontend/build.mjs:5:1
    at ModuleJob.run (internal/modules/esm/module_job.js:146:23)
    at async Loader.import (internal/modules/esm/loader.js:165:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5)

* Mock `process` for VFile used by ReactMarkdown

I was getting this otherwise:

core.js:55 Uncaught ReferenceError: process is not defined
    at new VFile (core.js:55)
    at VFile (core.js:49)
    at Function.parse (index.js:273)
    at ReactMarkdown2 (react-markdown.js:42)
    at renderWithHooks (react-dom.development.js:14803)
    at mountIndeterminateComponent (react-dom.development.js:17482)
    at beginWork (react-dom.development.js:18596)
    at HTMLUnknownElement.callCallback2 (react-dom.development.js:188)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:237)
    at invokeGuardedCallback (react-dom.development.js:292)

* Mock `process.env` for VFile used by ReactMarkdown

I was getting this otherwise:

platform.ts:73 Uncaught TypeError: Cannot read properties of undefined (reading 'ENABLE_VSCODE_BROWSER_CODE_LOADING')
    at platform.ts:73
    at platform.ts:79
    at Function.r._invokeFactory (loader.js:1118)
    at r.complete (loader.js:1128)
    at r._onModuleComplete (loader.js:1754)
    at r._resolve (loader.js:1714)
    at r.defineModule (loader.js:1357)
    at _ (loader.js:1804)
    at numbers.ts:10
    at fake:1

* pass the heavy appScenes to sceneLogic through props via App.tsx

* remove sceneProxyLogic

* remove exported variables

* fix sceneLogic test

Co-authored-by: Michael Matloka <dev@twixes.com>
2021-11-03 09:50:24 +01:00
PostHog bot
abefe4cf66
Update posthog-js to 1.16.1 (#6787)
Co-authored-by: posthog-bot <posthog-bot@users.noreply.github.com>
2021-11-02 09:51:20 -07:00
PostHog bot
1994ccbf3d
Update posthog-js to 1.16.0 (#6713) 2021-10-28 12:18:26 +01:00
PostHog bot
6cbeb409fb
Update posthog-js to 1.15.4 (#6700)
Co-authored-by: posthog-bot <posthog-bot@users.noreply.github.com>
2021-10-27 14:58:58 -07:00
Marius Andra
f76d0b6521
Turbo mode (#6632)
* fix router redirect

* remove dependence on user var

* split scenes and sceneTypes out of sceneLogic

* rename LoadedScene type to SceneExport

* export SceneExport from most scenes

* use exported scene objects, warn if not exported

* fix type import bugs

* remove dashboard

* keep all loaded scene logics in memory

* fix sorting bugs

* support scenes with params, make it work with dashboards

* fetch result from dashboard if mounted

* fix mutations

* add lastTouch

* refactor scene parameters to include searchParams and hashParams

* add insights scene to scene router

* add insight router scene to scene router

* fix cohort back/forward bug

* this works

* bring back delayed loading of scenes

* set insight from dashboard also in afterMount

* split events, actions, event stats and properties stats into their own scenes

* refactor to options object for setInsight

* override filters

* clean filters for comparison

* fix cohort bug

* get a better feature flag

* make turbo mode faster by making non-turbo-mode slower

* less noise in failed tests

* fix tests

* flyby: add jest tests pycharm launcher

* clean up scenes

* add test for loading from dashboardLogic

* fix bug

* split test init code into two

* have the same data in the context and in the api

* add basic tests for sceneLogic

* run the latest and greatest

* fix menu highlight

* implement screaming snake

* only show scenes with logics
2021-10-26 20:08:45 +00:00
Tim Glaser
ee35d18d9f
Remove papercups widget (#6415)
* Remove papercups widget

* remove unused import

* helper button in the nav bar

* post-merge fix

* extra fixes & improvements

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-10-25 16:50:11 +02:00
Marius Andra
b720da94ab
Saved insights filter & url sync (#6388)
* saved insights url sync WIP

* sync filters with the url

* improve trend and date filters

* convert utils test to typescript

* create simple object shallow diff function

* only persist the difference from the default filters in the url

* add tests and simplify operations

* improve tests

* better load checking
2021-10-22 11:53:40 +02:00
Harry Waye
01873b1780
feat(correlation): add multiselect for property names (#6407)
* refactor(taxonomic-filter): add api mock functions

* chore: remove makeApi from storybook preview.js

* feat(correlation): add multiselect for property names

Previously we had a simple text input box that was splitting the input
to get a list of property names. This doesn't give the greatest user
experience.

Now we have a simple select box that includes:

 1. search filtering for options
 2. multiselecting options
 3. a select $all, although this is pretty poorly implemented at the
    moment, for instance you can select $all, at the same time as
    selecting a subset of properties.

* add a little commentary around PropertyNamesSelect

* add deps to useEffect

* ignore return type eslint issues

* just use console.log instead of actions

* remove unused import

* chore: add error condition

* chore(correlation): update styling of property select

This puts it more in line with
https://www.figma.com/file/gQBj9YnNgD8YW4nBwCVLZf/PostHog-App?node-id=4200%3A30715

* Add no search results message

* input focus border

* fix type

* use onBlur

* make checkbox checked colour change

* make query bold in no results message

* add clear

* Implement search highlighting

* fix typing

* add regex split comment

* if no property names selected, default to $all

* typo

* Add test for selection component

* Add test highlighting onChange lag and clicking outside

* click out side should depend on hide

* make sure onChange triggered on clear or select all
2021-10-20 14:12:32 +00:00
Harry Waye
f06e0b4c51
dev(react): add react hook eslint rules, as warnings (#6571)
Here I have installed react-hooks eslint rules. See
https://reactjs.org/docs/hooks-rules.html#eslint-plugin for reference.

The specific trigger for this was [this
fix](abdbe54663)
I put in for a bug, which would have been caught by the
`react-hooks/exhaustive-deps` rule.

I've added these both as warnings as there are currently 69 😏
problems:

```
$ yarn eslint
...
✖ 69 problems (6 errors, 63 warnings)
```

At least this will highlight in editors that support it. We can make
these errors in a follow up PR, but this is valuable in itself without
getting into some yak shaving.
2021-10-20 14:40:06 +01:00
Guido Iaquinti
8b0ba34689
package.json: restrict node engines to < 17 (#6569) 2021-10-20 12:28:38 +02:00
Alex Gyujin Kim
ba33121d33
Move rrweb player into repo (#6505)
* rename sessionRecording to session-recording

* logic for new player

* move rrweb-player into repo

* remove awkward wrapper and fix time not updating bug

* chunk load meta timing

* fix duration setting bug

* update icons and styling for controller

* styling icons

* slider styling

* ugly slider

* remove consoles

* sonarqube

* typescript

* typescript

* remove hardcode

* Fix icon from merge

* move report usage back to sessionsplaylogic

* add comments back

* bug fix

Co-authored-by: Rick Marron <rcmarron@gmail.com>
2021-10-19 21:33:43 -07:00
PostHog bot
f0e6776807
Update posthog-js to 1.15.3 (#6533) 2021-10-19 10:04:13 +01:00
PostHog bot
a86fdeb895
Update posthog-js to 1.15.1 (#6525) 2021-10-18 21:05:25 +01:00
PostHog bot
d976fc8deb
Update posthog-js to 1.14.5 (#6507) 2021-10-18 10:20:12 +01:00
Alex Gyujin Kim
074d633c53
Make Sessions Recording faster!! (#6270)
* paginate session recording events api

* code quality

* don't rerender replayer every time events get loaded

* refactor session recordings, make it backwards compatible, add bunch of tests

* move limit and offset to after decompress

* change limit

* add caching of recording

* add duration

* fix a few tests

* fix api tests

* add partial chunk test

* fix default limit test

* code quality

* typing

* fix backend tests

* mypy fixes and signature

* remove circular dependency

* mypy and sessionsplaylogic tests

* fix migration

* make single migration

* revert mypy typing

* remove require react resolve

* fix loading state to persist across multi chunks and add test'

* cleanup

* duration to ms

* fix duration tests

* remove require react resolve

* fix test

* bump rrweb player

* change cache behavior plus more

* fix frontend tests and make duration calculation more robust

* fix timestamp in ms bug in tests

* fix duration 0 test

* fix compatibility with rrweb-player

* update lockfile

* yarn unlink

* resolve kea-test-utils changes

* another one

* remove caching for now (leave as todo) and change limit to 100
2021-10-15 02:41:47 +00:00
Marius Andra
72da684f8a
extract kea-test-utils (#6425) 2021-10-14 17:17:42 +00:00
PostHog bot
ce1dabb1a4
Update posthog-js to 1.14.4 (#6445) 2021-10-14 18:08:39 +01:00
Michael Matloka
77621366de
Fix remaining TypeScript errors (#6436)
* Fix remaining TS errors and remove `.ts-strict-blacklist`

* Move `IGNORED_SPECS` to top
2021-10-14 15:08:42 +00:00
Marius Andra
d1caefb606
Refetch insight if id changes (#6368)
* refetch insight if id changes

* current project also ingested event

* upgrade kea and loaders

* do not load if sceneLogic is not mounted

* add test for url sync

* don't load results from the API if none in the insight

* avoid extra queries

* avoid loading the results twice

* update kea-loaders to get payload in async actions
2021-10-14 14:58:17 +00:00
Marius Andra
fc66fc953e
remove all dashboard animations in view mode (#6426) 2021-10-14 15:51:27 +01:00
Paolo D'Amico
44cb3c2d70
Updates storybook to 6.3.11 (#6399) 2021-10-13 11:25:56 +03:00
Harry Waye
88262c0e05
chore(correlation): funnel story with correlation events and properties (#6389)
* chore(correlation): funnel story with correlation events and properties

This commit:

 1. adds msw so we can easily mock the API requests
 2. starts msw on storybook page load
 3. adds the `mockServiceWorker.js` to storybook public folder so it can
    be loaded by the frontend
 4. adds a Funnel story that defines the funnel and correlation
    responses

Note that we also define types for requests and responses. These could
be shared with the actual application code, so we can explicitly couple
the application changes to updating storybooks, i.e. to help avoid
stories going stale.

The requests and responses are quite basic, but they are sufficient to
be able to easily see and make changes. It has a requirement that it
should be easy for anyone else who comes to the code to easily parse and
be able to make updates. We don't want these to be rotten stories but
*the place* that people go to first when making their changes.

Having simple handwritten request/responses also introduces the
stability needed to, for example, use regression tests. Changes are
deliberate.

* refactor(storybook): move funnel stories to their own file

This also does quite a bit of cleaning up of the storybook and funnel
story code. Trying to come down on an acceptable way to manage the
sample data.

* dev(storybook): specify public dir when building storybook

I'm hoping this means that chromatic will function properly 🙏

* chore: add back the withApi decorator

* setup msw first

* dev(storybook): Make posthogjs work in chromatic

* dont use as cast for response types

* make hot module reload work
2021-10-13 04:45:51 +00:00
PostHog bot
12ce2d61d0
Update posthog-js to 1.14.3 (#6393) 2021-10-12 18:11:04 +01:00
Li Yi Yu
c0d7f1e17d
Paths Viz: horizontal scroll, path card item display on link hover, adding typing (#6323)
* allow for horizontal scrolling on paths viz

* wip

* add axis lines

* move more paths util functions over

* do not shorten urls without parameters

* show hidden path cards on link hover

* convert file to typescript

* small fixes and prettier

* es lint fixes

* more typing fixes

* typing

* final fix
2021-10-11 20:30:25 -04:00
Marius Andra
00633412cc
Insight logic refactor version 1 - keyed insightLogic (#6310)
* kea test "toNotHaveDispatchedActions"

* fix dashboard logic test

* add props and key to insight logic (has no effect)

* inform about is_sample's uniqueness

* use common InsightLogicProps

* persist state via BindLogic and shared insightProps

* persist hashParams

* remove cached Urls

* upgrade new to saved logic

* upgrade typegen

* patch metadata logic

* always show title if saved insights active

* fix negative bug

* fix interval filter

* go to view mode after saving

* full reload when going from dashboard to insight

* use clean filter

* createInsight is no longer used

* fix tests

* fix setAllFilters

* clean retention table duplicate code, fix test

* scene has its own key

* unify insightLogicProps key logic

* consolidate logic fetching

* fix test

* fix reloads

* clears the scene funnel

* move setInsight to reducer

* stronger clicks on menu items

* remove wait

* clarify testcases
2021-10-08 12:13:23 +00:00
PostHog bot
5da276d849
Update posthog-js to 1.14.1 (#6274) 2021-10-06 11:43:43 +01:00
PostHog bot
e1a8a29d68
Update posthog-js to 1.14.0 (#6246) 2021-10-05 10:13:13 +01:00
PostHog bot
ff58d6277a
Update posthog-js to 1.13.17 (#6226) 2021-10-04 12:20:45 +01:00
PostHog bot
5223ea0aa0
Update posthog-js to 1.13.16 (#6222)
Co-authored-by: posthog-bot <posthog-bot@users.noreply.github.com>
2021-10-04 10:12:40 +01:00
PostHog bot
707fc51bf1
Update posthog-js to 1.13.15 (#6174) 2021-09-29 12:24:11 +01:00
Guido Iaquinti
f4e47abb09
Bump prettier and eslint-config-prettier versions (#6167)
* Bump 'prettier' and 'eslint-config-prettier' version

* Run 'yarn prettier' with the new bumped version
2021-09-29 11:49:29 +01:00
Guido Iaquinti
085593d1cd
Edit 'prettier' command in package.json (#6147) 2021-09-28 14:11:12 +00:00
PostHog bot
9de0551285
Update posthog-js to 1.13.14 (#6143) 2021-09-28 11:36:54 +01:00
Marius Andra
ef70592603
Usable logic tests (works now!) (#5990)
* mockup usable logic tests

* actually filter

* a little verbosity never hurt anyone

* await

* sync toDispatchActions and toMatchValues working

* get at least one test working

* should await this

* better action awaiting

* cleanup

* smarter logic test action matching

* cleanup

* delete snapshots

* fix titles

* remove .run(), add .then-magic

* cleanup

* more cleanup

* refactor into multiple files

* refactor into multiple files WIP

* finish refactor

* make nodejs compatible

* funnel logic test WIP

* delay and printActions

* fix label

* add more mocks

* only call action if it makes sense

* fix reload issue with funnels and actions

* explicitly connect to this logic

* listener and mount functions for kea-test-utils

* improve tests

* mock out scss files

* rename antd es/ to lib/ for compatibility in jest

* add breakdown test

* funnel test updates

* set pointer to now if running a block with expectLogic

* fix mock

* more mock

* ignore if breakpoint

* reset window history and posthog-js with logic tests

* one more breakpoint

* add test mode ecxeptions

* update kea

* improve funnel test

* merge, but break

* add safeguard

* safer props

* fix test bugs

* clarify window.crypto polyfill

* simplify api.mock

* simple throw if unmocked api

* use a global actionMap pointer, so we could query between logics

* use the global querying

* remove "Scene" hack

* fix type bug

* clarify some variables
2021-09-21 13:39:05 +02:00
PostHog bot
085424a619
Update posthog-js to 1.13.12 (#5956) 2021-09-15 09:12:39 +01:00
PostHog bot
b1c6d51f03
Update posthog-js to 1.13.11 (#5939) 2021-09-14 11:50:53 +01:00
Marius Andra
9da6ee3b5f
ClickHouse M1 Docker (#5215)
* m1 clickhouse support

* add clickhouse arm64 compilation dockerfile

* use clang-12 and 2 parallel builds

* working clickhouse docker image

* this needs to be committed out for CH to work... a known issue. WIP

* move things around

* move things around again

* add arm64 build scripts

* comment out broken line in DEBUG mode, still make it break production builds

* update readme

* timeless text

* add issue in comment

* way way way too much white space

* zookeeper restarts sometimes needed
2021-09-13 13:01:24 +02:00
PostHog bot
fb66d49762
Update posthog-js to 1.13.10 (#5913) 2021-09-13 11:09:38 +01:00
PostHog bot
118100e56c
Update posthog-js to 1.13.9 (#5905) 2021-09-10 19:16:21 +01:00
PostHog bot
8a69d6a28f
Update posthog-js to 1.13.8 (#5885) 2021-09-09 20:42:28 +01:00