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

[Docs] General updates #1629

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

[Docs] General updates #1629

wants to merge 9 commits into from

Conversation

CassioMG
Copy link
Contributor

@CassioMG CassioMG commented Nov 8, 2024

This PR suggests some doc updates and fixes some typos.

The main updates would be:


export const VersionedUrl = () => (
<p>
<code>{`<head><script src='https://cdnjs.cloudflare.com/ajax/libs/stellar-freighter-api/${packageJson.version}/index.min.js' /></head>`}</code>
<code>{`<head><script src='https://cdnjs.cloudflare.com/ajax/libs/stellar-freighter-api/{version}/index.min.js' /></head>`}</code>
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the difference between these two? I couldn't find much on the global version.

Copy link
Contributor

Choose a reason for hiding this comment

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

For context, I added the original logic around grabbing the package json file because cdnjs creates a url based on the latest version. So, for ex, to get v3.0.0 of freighter-api, you would need a url of: https://cdnjs.cloudflare.com/ajax/libs/stellar-freighter-api/3.0.0/index.min.js

How does the version var accomplish that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah, so there isn't a global version. I changed it to be consistent with the text instructions here which mentions {version} . This is the only place importing this VersionedUrl component.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Humm maybe we should just put a plain html code like it's being done here instead of importing this VersionedUrl component. Wdyt?

Something like:

<head><script src="https://cdnjs.cloudflare.com/ajax/libs/stellar-freighter-api/{version}/index.min.js"></script></head>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And leave the VersionedUrl component "as is" or delete it if it's not being used

Copy link
Contributor

@piyalbasu piyalbasu Nov 8, 2024

Choose a reason for hiding this comment

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

Oh, just to give further context: I did originally have it as plain html with the {version} var in it as you suggested, but I got complaints from people in the org that the link should be dynamic and include the latest version so users can just copy and paste without having to insert the version number themself

Copy link
Contributor

Choose a reason for hiding this comment

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

This is the original ticket that caused me to add this: #829

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