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

Move apps and team page scripts out of landing-page.js #27137

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

amanagr
Copy link
Member

@amanagr amanagr commented Oct 10, 2023

Follow up on #27079 (comment)

web/src/page_params.ts Outdated Show resolved Hide resolved
@timabbott
Copy link
Member

This seems like good progress, but see the note above on page_params types.

@amanagr amanagr added the integration review Added by maintainers when a PR may be ready for integration. label Oct 11, 2023
web/src/page_params.ts Outdated Show resolved Hide resolved
This helps us run the script independent of the URL path.
This is to make tests for channel work.

Channel mocks `$` to be an object, so it cannot be called as an
function in sentry.ts if it is imported in channel.ts.

So, to avoid it, we extract the functions which channel.ts uses
and fortunately they don't use `$`, so it works out.
@@ -10,7 +10,8 @@ import * as Sentry from "@sentry/browser";
import $ from "jquery";

import {BlueslipError, display_stacktrace} from "./blueslip_stacktrace";
import {page_params} from "./page_params";

const development_environment = $("#page-params").data("params").development_environment;
Copy link
Member

Choose a reason for hiding this comment

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

This change seems dangerous, in that page_params.ts removes it from the DOM in the web app itself. Also, we really really don't want to have jQuery parse the params twice; it is an expensive operation for large organizations like chat.zulip.org.

Probably a good #frontend conversation about what we want to do with this detail.

Copy link
Member

Choose a reason for hiding this comment

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

I think the most likely theory for how to fix this is to put the actual app parameters into a separate data-app-params bucket from the "common" stuff used by Sentry/Blueslip and smaller pages, and those things can be parsed multiple times safely as they would not be huge. But I'm not sure and it deserves a proper discussion.

@zulipbot
Copy link
Member

zulipbot commented Nov 1, 2023

Heads up @amanagr, we just merged some commits that conflict with the changes you made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/main branch and resolve your pull request's merge conflicts accordingly.

@timabbott
Copy link
Member

So the page_params typescript part of this was I think resolved in #28389, so this might be easier to pick apart now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has conflicts integration review Added by maintainers when a PR may be ready for integration. size: XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants