0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 04:12:23 +01:00
Commit Graph

17 Commits

Author SHA1 Message Date
Ben White
4966def680
fix: Loading toolbar assets in production (#15320) 2023-05-02 15:06:35 +02:00
Marius Andra
dc32a8aa86
fix(toolbar): loading bundle on adobe commerce (#11734) 2022-09-08 14:26:15 +00:00
Marius Andra
de7153e3bb
feat(frontend): remove reference to global define.amd in toolbar.js (#11728) 2022-09-08 13:05:46 +00:00
Yakko Majuri
950ecd3ec7
fix: set explicit globalName for posthog modules (#11664) 2022-09-06 12:05:30 +02:00
Marius Andra
16e62f1004
feat(embeds): various changes (#10597)
* upgrade storybook

* flip the "legend" option, enable by default on png exports

* noHeader sharing mode for insights

* fix storybook 6.5 issue

* split exporter component and rendering

* remove `fitScreen` from options - it was not used anywhere from what I can tell

* storybook with no data

* get an actual iframe into storybook

* export insight

* dashboard mock

* load dashboard directly, not via window

* add dashboard story

* tweaks

* code fixes

* fix type
2022-07-04 10:02:52 +02:00
Marius Andra
875a3a7540
feat(exports): unify export bundles (#10329)
* move everything under src/exporter

* use a common exporter entrypoint

* fix styles for image exports

* add styles

* move embed info out of the frontend

* unify whitelabel

* remove "?." to tree-shake it away

* load dashboards in a bit cleaner way

* consolidate

* typing
2022-06-17 16:38:42 +02:00
Marius Andra
2069c4cd8b
feat(frontend): build @posthog/lemon-ui and @posthog/apps-common (#10120)
* fix dayjs

* fix timeouts (we're not strictly speaking running in nodejs)

* export unexported type

* consolidate on a single FormInstance

* no need to rename

* fuse

* forminstance 2

* locationChanged

* BuiltLogic

* remove Type.ts exception

* fix duh

* playing with common apps

* playing with common apps

* fix some scss deprecations 🤷

* revert

* move packages/apps-common

* remove compiled json file

* build apps-common before other packages

* mkdirp, build types before running

* build types before the rest

* move imports json to packages folder

* mark some packages as external, saving 200kb

* revert nonsense

* remove ant dep

* make app source editor types optional for speed

* move dev server reloads to utils.mjs

* remove webpack start scripts (unused)

* refactor build/utils to support various dirs

* apps package

* revert some stuff

* yarn

* go back to the old location and commit packages.json in

* commit it in

* out of scope

* fix bad imports

* fix some postcss mess

* move to @posthog/apps-common

* add more stuff to apps

* include that in packages.json

* simple cjs build

* export everything

* simplify

* make separate package for lemonade

* more lemonade

* fix jest imports

* fix jest imports

* yarn as well

* src

* write types before building

* rename lemon-ui, part 1

* add readmes

* rename to lemon-ui, part 2

* this app source editor tsd is committed into the repo, so we don't need it before a build
2022-06-10 17:03:06 +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
Ben White
57874f9db2
feat(exports): Dashboard / Insight exporting (#9830)
* Adds chromium / selenium for image exporting
* Added uploading of downloads folder to artefacts
* Adds ExportButton to generate desired asset
2022-05-27 14:31:17 +02:00
Marius Andra
e84b23afa2
chore(apps): pretty-print packages.json (#9965) 2022-05-24 19:00:31 +00:00
Marius Andra
604f23d8e4
feat(apps): app editor improvements (#9912)
* wait close to 2min

* add Link to exports

* export kea stuff

* prettier options

* add typing support for react

* export types automatically

* update export
2022-05-24 11:00:10 +02: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
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
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
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