Skip to content
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

Add dynamic sdk options to JavaScript loader backend #44225

Closed
5 tasks done
Tracked by #6944
AbhiPrasad opened this issue Feb 7, 2023 · 1 comment · Fixed by #44876
Closed
5 tasks done
Tracked by #6944

Add dynamic sdk options to JavaScript loader backend #44225

AbhiPrasad opened this issue Feb 7, 2023 · 1 comment · Fixed by #44876
Assignees

Comments

@AbhiPrasad
Copy link
Member

AbhiPrasad commented Feb 7, 2023

Playground PR: #44237

Tasks

  1. Scope: Backend
    AbhiPrasad
  2. Scope: Backend
    AbhiPrasad
  3. Scope: Backend
    AbhiPrasad
  4. Scope: Backend
    AbhiPrasad
  5. Scope: Backend
    AbhiPrasad
@AbhiPrasad AbhiPrasad changed the title Add checkbox loader endpoint to Sentry Add JsSdkDynamicLoader as new django view Feb 7, 2023
@AbhiPrasad AbhiPrasad transferred this issue from getsentry/sentry-javascript Feb 7, 2023
@AbhiPrasad AbhiPrasad self-assigned this Feb 7, 2023
@AbhiPrasad AbhiPrasad changed the title Add JsSdkDynamicLoader as new django view Add JsSdkDynamicLoader to sentry backend Feb 9, 2023
AbhiPrasad added a commit that referenced this issue Feb 16, 2023
ref #44225

Building on the work from
#44346, this PR adds
`dynamicSdkLoaderOptions`, a dictionary of options for the new dynamic
SDK loader.

The `dynamicSdkLoaderOptions` live on the data `JSONField` on the
`ProjectKey` model, as the there is a dynamic loader unique to each DSN.

`dynamicSdkLoaderOptions` is also a dictionary, for ease of use, with 3
keys:

1. `hasReplay`: If the loader should include the replay sdk in the
bundle
2. `hasPerformance`: If the loader should include the tracing sdk in the
bundle
3. `hasDebug`: If the loader should load the debug bundle

In the future we could migrate this onto the model directly (as a
`BitField` or something), but for now for iteration speed and fluid
schema, adding it as a JSON is good enough.

To validate we are using the correct fields, `dynamicSdkLoaderOptions`
is validated in the `ProjectKeySerializer` via a custom serializer.

These new options are used by the `_get_bundle_kind_modifier` method in
the `JavaScriptSdkDynamicLoader` view, but for now are not used since
the templates are not added (we render a no-op template instead). In the
next PR we will add templates for the loader view, alongside tests to
validate this all together.
wmak pushed a commit that referenced this issue Feb 16, 2023
ref #44225

Building on the work from
#44346, this PR adds
`dynamicSdkLoaderOptions`, a dictionary of options for the new dynamic
SDK loader.

The `dynamicSdkLoaderOptions` live on the data `JSONField` on the
`ProjectKey` model, as the there is a dynamic loader unique to each DSN.

`dynamicSdkLoaderOptions` is also a dictionary, for ease of use, with 3
keys:

1. `hasReplay`: If the loader should include the replay sdk in the
bundle
2. `hasPerformance`: If the loader should include the tracing sdk in the
bundle
3. `hasDebug`: If the loader should load the debug bundle

In the future we could migrate this onto the model directly (as a
`BitField` or something), but for now for iteration speed and fluid
schema, adding it as a JSON is good enough.

To validate we are using the correct fields, `dynamicSdkLoaderOptions`
is validated in the `ProjectKeySerializer` via a custom serializer.

These new options are used by the `_get_bundle_kind_modifier` method in
the `JavaScriptSdkDynamicLoader` view, but for now are not used since
the templates are not added (we render a no-op template instead). In the
next PR we will add templates for the loader view, alongside tests to
validate this all together.
@AbhiPrasad AbhiPrasad changed the title Add JsSdkDynamicLoader to sentry backend Add dynamic sdk options to JavaScript loader backend Feb 24, 2023
@AbhiPrasad
Copy link
Member Author

AbhiPrasad commented Feb 24, 2023

Once #44876 has been merged in, the backend changes to get the loader working are all done.

All that is left is for the frontend to update the project key settings to enable the different bundles (replay, performance etc.)

The project key settings are detailed in #44496

  1. hasReplay: If the loader should include the replay sdk in the bundle
  2. hasPerformance: If the loader should include the tracing sdk in the bundle
  3. hasDebug: If the loader should load the debug bundle

@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant