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

feat: add abby .js script #101

Merged
merged 1 commit into from
Dec 3, 2023
Merged

Conversation

cstrnt
Copy link
Member

@cstrnt cstrnt commented Dec 3, 2023

This PR introduces the option to load the project data using a script via the API. This allows the browser in SPAs to load the data before the App is mounted and rendered. This can reduce a flash of content

Copy link

vercel bot commented Dec 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
abby-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 3, 2023 4:48pm
abby-opensource ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 3, 2023 4:48pm

@cstrnt
Copy link
Member Author

cstrnt commented Dec 3, 2023

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

typeof req.query.projectId === "string" &&
req.query.projectId.endsWith(".js")
) {
const jsContent = `window.${ABBY_WINDOW_KEY} = ${JSON.stringify(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should sanitize this at some point, but this could be done in a seperate PR, if we want to quickly merge this now. You should just trust your colleagues :D

@cstrnt cstrnt merged commit 1e5c164 into main Dec 3, 2023
3 checks passed
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.

2 participants