-
Notifications
You must be signed in to change notification settings - Fork 25
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
base: master
Are you sure you want to change the base?
[Docs] General updates #1629
Conversation
|
||
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> |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
This PR suggests some doc updates and fixes some typos.
The main updates would be: