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

Trigger a CustomEvent on config load #60

Closed
humitos opened this issue Apr 24, 2023 · 1 comment · Fixed by #64
Closed

Trigger a CustomEvent on config load #60

humitos opened this issue Apr 24, 2023 · 1 comment · Fixed by #64
Assignees

Comments

@humitos
Copy link
Member

humitos commented Apr 24, 2023

This would be useful for theme authors

https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent

@humitos
Copy link
Member Author

humitos commented Apr 26, 2023

The idea behind this is to communicate that the API call is done and the data is available for usage. This is, window.readthedocs object is ready.

This object will have the same data structure than the API response. This is on purpose to avoid maintaining multiple data structures. Authors will pin the version they are compatible with by using the meta tag: #61

humitos added a commit that referenced this issue Apr 27, 2023
Let users to define `<meta name="readthedocs-api-version" content="1.0">` to
tell Read the Docs client what is the API scheme version supported by them.

When our client request the API data, if the `api_version` returned does not
match with the one expected by the user, another request is done to force a
particular API scheme version.

Then, we dispatch a `readthedocsdataready` custom event and expose
`window.readthedocs`, to let our users know this data is ready to be consumed by
their own integrations.

Closes #60
Closes #61
humitos added a commit that referenced this issue Apr 27, 2023
Let users to define `<meta name="readthedocs-api-version" content="1.0">` to
tell Read the Docs client what is the API scheme version supported by them.

When our client request the API data, if the `api_version` returned does not
match with the one expected by the user, another request is done to force a
particular API scheme version.

Then, we dispatch a `readthedocsdataready` custom event and expose
`window.readthedocs`, to let our users know this data is ready to be consumed by
their own integrations.

Closes #60
Closes #61
humitos added a commit that referenced this issue Apr 27, 2023
Let users to define `<meta name="readthedocs-api-version" content="1.0">` to
tell Read the Docs client what is the API scheme version supported by them.

When our client request the API data, if the `api_version` returned does not
match with the one expected by the user, another request is done to force a
particular API scheme version.

Then, we dispatch a `readthedocsdataready` custom event,
to let our users know this data is ready to be consumed by their own
integrations.

Closes #60
Closes #61
@humitos humitos self-assigned this Oct 19, 2023
humitos added a commit that referenced this issue Apr 15, 2024
…Event` (#64)

Let users to define `<meta name="readthedocs-api-version"
content="1.0">` to tell Read the Docs client what is the API scheme
version supported by them.

When our client request the API data, if the `api_version` returned does
not match with the one expected by the user, another request is done to
force a particular API scheme version.

Then, we dispatch a `readthedocsdataready` custom event ~~and expose
`window.readthedocs`~~, to let our users know this data is ready to be
consumed by their own integrations.

Closes #60
Closes #61
Closes #17 
Closes readthedocs/readthedocs.org#9957
Closes #250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant