Skip to content

feat(apps): transpile frontend.tsx #9828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 58 commits into from
May 19, 2022
Merged

Conversation

mariusandra
Copy link
Collaborator

Problem

To get apps to work, we need to transpile the frontend React components via a new frontend.tsx entrypoint.

Changes

How did you test this code?

  • Built new tests for the plugin server
  • Tested locally by editing code and seeing the values update in the database, and the plugin get reloaded

Final step:

  • Loading the transpiled JS in the frontend

@mariusandra mariusandra requested review from Twixes and yakkomajuri May 17, 2022 23:56
@mariusandra
Copy link
Collaborator Author

This is also ready for a look. There's a failing tests saying to merge the migrations, but it's a PR on a PR, so once one PR is merged, I'll rebase accordingly, depending on what gets ✅ first.

@yakkomajuri yakkomajuri changed the base branch from plugin-source-db-model to master May 18, 2022 08:44
@yakkomajuri
Copy link
Contributor

Changed base as I believe was the intention? I was not about to review 5000 lines :D

@Twixes
Copy link
Member

Twixes commented May 18, 2022

Not sure which changes are from this PR and which from #9825, so I'll review once that other one's in, is that OK?

@yakkomajuri yakkomajuri changed the base branch from master to plugin-source-db-model May 18, 2022 10:52
@yakkomajuri yakkomajuri changed the base branch from plugin-source-db-model to master May 18, 2022 10:52
@yakkomajuri
Copy link
Contributor

Actually can you get the branches lined up so the changes in each of the PRs are clear? @mariusandra

@mariusandra mariusandra changed the base branch from master to plugin-source-db-model May 18, 2022 14:15
@mariusandra
Copy link
Collaborator Author

Indeed, something is borked. Will fix in an hour when back at my desk

Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me (with one nit)

@mariusandra mariusandra changed the base branch from plugin-source-db-model to master May 19, 2022 12:09
@mariusandra mariusandra changed the base branch from master to plugin-source-db-step2 May 19, 2022 12:09
Base automatically changed from plugin-source-db-step2 to master May 19, 2022 13:51
Copy link
Collaborator Author

@mariusandra mariusandra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Twixes still ✅ for this?
@macobo any feedback, and/or reasons to HODL for the migration?

@mariusandra
Copy link
Collaborator Author

Gonna merge it in the end to unblock the final 🤞 PR #9831

@mariusandra mariusandra merged commit c204a32 into master May 19, 2022
@mariusandra mariusandra deleted the plugin-frontend-transpilation branch May 19, 2022 16:49
fuziontech added a commit that referenced this pull request May 19, 2022
* master:
  refactor(ingestion): Make `KAFKA_ENABLED` true by default and set `KAFKA_HOSTS` default (#9844)
  feat(apps): transpile frontend.tsx (#9828)
  feat: show api call status when adding insights to dashboards (#9817)
  feat: track metrics on zapier hook firings (#9866)
  fix(onboarding): instrumentation (#9845)
  feat(whitelabel-shared-dashboard): Hide branding on shared dashboards paid (#9849)
  fix(apps): plugin source quickfix (#9862)
  refactor(plugin-server): Remove `ts-jest`, use `jest.mocked` (#9861)
  refactor(plugin-server): Trigger public jobs with graphile insted of celery queue (#9811)
  chore: upgrade pip tools (#9859)
  feat(apps): plugin source in its own model, part 2 (#9854)
  chore: Update sprint_planning_retro.md (#9791)
  feat(apps): plugin source in its own model, part 1 (#9853)
  feat(matrix): Add option to save `simulate_matrix` like `setup_dev` (#9836)
  fix(cohort): add mapping from event to person (#9841)
  feat(person-on-events): Enable CI to run using both old and new queries (#9814)
alexkim205 pushed a commit that referenced this pull request May 23, 2022
* create plugin source model

* edit source via plugin_source model

* deprecate "source"

* test plugin source updates

* add support for index.ts and index.js

* refactor plugin loading, support plugin sources from db

* fix source code in tests

* remove transpilation code

* reload plugin after saving

* store defaults in the db instead of persisting in form

* remove fields that don't exist

* feat(apps): transpile frontend.tsx

* update timestamp even if no local fields changed

* yarn.lock

* remove unused fields

* commit suggestion

* rename to PluginSourceFile

* rename to PluginSourceFile

* remove dead code

* fix code feedback

* add comments

* make it safer to call

* convert to upsert

* convert to upsert

* comment on the null

* revert plugin server changes

* get source from new model behind the scenes

* simplify

* revert accidental changes

* revert accidental changes

* remove defaults

* sync the old source field

* use the source model in the plugin server

* cache the source from pluginsourcefile

* test that getPluginSource gets data from the database

* safer null check that doesn't override `{}` in the db with `null`

* use enum

* fix error from migration 0233 ([] is falsy in python!)

* fix merge

* error as null

* use the explicit "source__index_ts" field

* cache transpiled code

* remove unused type

* cleaner query

* remove extra line

* fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants