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

24 Commits

Author SHA1 Message Date
Ben White
7bfb0cff15
fix: Docker build not reporting errors (#20892) 2024-03-13 12:29:19 +00:00
Paul D'Ambra
d5df038f16
fix: reduce toolbar bundle size by 60% (#20122)
* output analyzable build info for the toolbar

* don't use code snippet it adds half a meg

* Update UI snapshots for `chromium` (2)

* use esbuild visualizer instead

* fix

* allow treeshaking and remove circular dependency from imports toolbar uses

* fix

* lint the mjs files at the root of frontend folder

* no need to mention lemonui at all

* no ned to specify metafile

* don't allow posthog-js to sneak into the toolbar

* simpler date picker so fewer dependencies

* maybe this

* like this?

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* ragE

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* too easy to break things this way

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* around the houses

* Reset snapshots to master

* explain why there's a plugin

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* fix

* fix

* Update UI snapshots for `webkit` (2)

* fix

* Update UI snapshots for `webkit` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-19 11:39:15 +00:00
Michael Matloka
6112daf720
chore(dev): Immediately pick up new Tailwind classes being used (#19736)
* chore(dev): Pick up new Tailwind classes being used

* Remove `postcss.config.js` from production

It's only used in Storybook.
2024-01-15 09:45:26 +00:00
Michael Matloka
5c51230ea4
chore(frontend): Real Tailwind + Autoprefixer (#19051)
* chore(frontend): Real Tailwind + Autoprefixer

* Align some non-standard utility class usage with Tailwind

* Start using container queries

* Update tailwind.config.js

* Move PostCSS packages into prod dependencies

* Add EE

* Add larger spacings for properties other than width

* Fix spacing backward compat

* Add max-w-1/2

* Remove Tailwind normalization

* Ensure JIT analysis works

* Actually we don't need a container query for this

* Clean up more

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update production.Dockerfile

* Extend `fontSize` instead of replacing

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Fix production build

* Add clarification comment

* Update trends.cy.ts

* Fix `scale` usage

* Fix minor styling issues

* Upgrade to Tailwind 3.4

* Actually use `cssnano`

* Don't use `cssnano` in dev

* Solve annoying Tailwind logs

* Add comment explaining plugins being defined twice

* Fix side panel icon rotation

* Reset snapshots

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update query snapshots

* Update query snapshots

* Fix dockerfile

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Fix up flag wrap

* Update UI snapshots for `chromium` (2)

* Fix

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ben White <ben@posthog.com>
2024-01-08 13:26:12 +01:00
Paul D'Ambra
16323959fd
feat: add ee licensed replay transformer (#18874)
first pass through using the EE licensed replay transformer in playback

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: David Newell <d.newell1@outlook.com>
2023-11-29 10:41:18 +00:00
Paul D'Ambra
a3ba101a54
chore: update es build (#18917)
* chore: update ESBuild

* chore: update ESBuild

* more logging collapsing

* Fix

* fiddling

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* end when finished if not --dev

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-28 14:33:21 +00:00
Marius Andra
3f1fab00d8
feat(hogql): errors for large full select queries (#15957)
* feat(hogql): errors for large select input

* parse syntax error positions better

* fix metadata test

* this was causing tooltips to hide

* one less hook

* disable if error

* typegen alias
2023-06-09 19:05:36 +02:00
Michael Matloka
08eab1f9c0
style: Fix "Posthog" capitalization (#15426)
* style: Fix "Posthog" capitalization

* Update UI snapshots for `chromium` (1)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-09 18:31:34 +02:00
Michael Matloka
5c783c744c
chore: Add debug info to JSX output (#12295)
* chore: Add debug info to JSX output

* Pin React to `^16.14.0` instead of `^16.13.0`

* Remove redundant `React`s

* Add `@babel/preset-react` for Storybook

* Update babel.config.js
2022-10-17 19:30:31 +02:00
Marius Andra
4ab14a83c0
feat(frontend): build that reload, multiple build scripts (#10175)
* use better paths

* move more logic to `utils.mjs`, support builds scripts from other folders
2022-06-07 13:33:32 +00:00
Marius Andra
6ba92b4766
feat(frontend): use lottie for animation (#9904)
* add lottie-react

* test loading states

* add new animations

* adopt the laptophog as the loadinghog

* handle opacity via a class

* move all lottiefiles to lib/animations

* new animation component

* add storybook

* use sportshog and laptophog animations for loading

* jest also wants to ignore these files

* clarify text

* support canvas in jsdom / jest

* add width/height to animations

* clarify

* use a mocked canvas instead of installing new debian packages to get this to compile

* I posted a wrong answer on the internet

Co-authored-by: Michael Matloka <dev@twixes.com>
2022-06-06 12:50:13 +02:00
Marius Andra
a43a89a809
chore(frontend): yeet sass vars (#9938)
* chore(frontend): yeet sass vars, starting with $default_spacing

* more css vars

* refactor the third axis of evil

* even more refactored vars

* deprecate scss color transformations

* remove ~/vars imports

* add back a few imports to get sass mixins working

* separate vars and mixins

* even more var refactor

* simplify build

* don't rely on node_modules aliases

* Prevent `.text-ellipsis` from being included multiple times

* Refactor last `~/vars` out

* Fix `--text-muted-alt`

* Restore `-alt` in `DropdownSelector.scss`

* Fix `.ma`

* Fix `--depr-purple-300`

* Prefix Sass vars with `_` to mark them as internal

* Add `--font-semibold`

Co-authored-by: Michael Matloka <dev@twixes.com>
2022-05-30 14:43:18 +02:00
Harry Waye
04f19e42eb
chore(js-loading): Make JS_URL be used at runtime for js loading (#8299)
* chore(static-assets): set JS_URL for ECS

This is the breakaway change
[here](https://github.com/PostHog/posthog/pull/8299#pullrequestreview-864974223)

This will need to be merged in before the other change, as otherwise we
will end up using the default of /static/ to serve up the frontend in
production.

* chore(js-loading): Make JS_URL be used at runtime for js loading

Previously we would bake the JS_URL in at build time. Instead this
changes such that we can change this at runtime by specifying a `JS_URL`
env variable.

* comment on css loader snippet

* Default js_url to /

* Leave leading / when concatenating to JS_URL

I'd accidentally left this out before

* Remove trailing forward-slash from `JS_URL` django setting

Prior to the change to make JS_URL applicable at runtime, this variable
had no effect, hence the railing slash wasn't an issue.

This change fixes the frontend when running with debug true, i.e. when
we should be using the dev server for serving the frontend

* remove trailing slashes from JS_URL

* avoid unexpected concat behaviour

* add some comments around style sheet loading

* explicitly handle JS_URL not set for css as well
2022-01-27 16:45:26 +00:00
Marius Andra
8c78afc6f5
do not use entrypoint hashes in dev mode for faster reloads (#7637) 2021-12-10 12:51:39 +00:00
Marius Andra
b45fb94fbf
Revert "add script tag before body (#7545)" (#7551)
This reverts commit 5e8c828f20.
2021-12-07 11:01:29 +01:00
Marius Andra
5e8c828f20
add script tag before body (#7545) 2021-12-07 10:41:12 +01:00
Marius Andra
397f6281ac
log errors when failing to load initial chunk (#7525) 2021-12-06 14:35:22 +01:00
Marius Andra
47f330881a
Use chunked entrypoints (#7485)
* use chunked entrypoints when possible

* shared dashboard entrypoints

* refactor createHashlessEntrypoints

* extract parallel building logic

* clean html writing function

* improve clarity
2021-12-03 09:45:12 +01:00
Karl-Aksel Puulmann
27fc81c8cb
Single group page breadcrumbs (#7423)
* Stable ordering for group types

* Update breadcrumbs logic to work with groups pages

* Solution no 2

* move breadcrumb titles into individual logics

* breadcrumbs for actions

* breadcrumbs for feature flags

* breadcrumbs for dashboards, insights, persons

* breadcrumbs for groups

* unify names

* breadcrumbs into the logic

* Fix persons breadcrumb, remove unused `here`, clarify `lastBreadcrumbs`

Co-authored-by: Marius Andra <marius.andra@gmail.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
2021-12-02 16:29:58 +01:00
James Greenhill
610f3dcb77
Set JS_URL for cloud (#7480)
* Set JS_URL for cloud

* use STATIC_HOST over JS_HOST

* use STATIC_HOST over JS_HOST

* use static assets for head

* back to JS_URL

* tweak utils.mjs

* format

* pretty it up
2021-12-01 21:38:20 -08: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
a8ecf33be8
Preload chunks when loading scenes (#6942)
* preload chunks when loading esbuild scenes

* fix TS error

* fix license title

* fix scene identifiers in menu

* lowercase data-attr

* make the events menu have the old data-attr

* change var name to clarify its usage
2021-11-09 10:37:01 +00:00
Marius Andra
b8e88dce9d
add build timestamp (#6813) 2021-11-03 12:37:35 +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