-
Notifications
You must be signed in to change notification settings - Fork 50
Support loading files from GitHub repositories #218
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
Conversation
I've tested and confirmed that this works as expected using the production build. I haven't been able to get the local dev server working properly, however -- I'm getting "Module Not Found" compilation errors for things that ought to be found, like |
client/examples/Main.purs
Outdated
] | ||
where | ||
fromExample { title, source } = | ||
link ("https://github.com/purescript/trypurescript/load-from-github/client/examples/" <> source) (text title) |
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.
I think this ought to use a tag from some kind of configuration rather than hardcoding the branch name, so that we can change these without breaking the currently released version. In practice we will want this to be the tag from the current 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.
Yea — I could thread this in as an argument to main, so that it can be accessed in various places taken from outside the PureScript 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.
Sounds good 👍
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.
I could also do that with the entire dev / prod configurations in that case — thoughts?
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.
If that makes the overall setup simpler, sure, I don't see why not.
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.
On second thought, doing this would require some kind of text replacement processing pass to work. After all, this example is code loaded literally into the Try PureScript editor.
Otherwise, we'd have to do something like read the current tag from data in the index.html file or something like that, but this would be user-visible code and I'm not a huge fan of that.
Another option is to manually hard-code the tag as part of the release process and document where the tag would need to be updated -- we release so infrequently that this feels legitimately like an option.
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.
True - I think manually hardcoding the tag and documenting that it needs updating will work.
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.
Perhaps we should split the repository README so that the main README is for users and there's a separate development guide. It could include instructions for developing, like we already have, but could also have a release guide which includes:
- Updating the hardcoded tag
- Checking externs sizes
- Running the deployment
What do you think?
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 now I've just added a note about the hardcoded tags to the README, but I think we probably do want a dedicated, separate development + release guide.
Supersedes #194 and #181 and fixes #164. This PR:
github
, which accepts a path to a source file in a GitHub repository and loads its contents.examples
directoryI also updated the 0.14 package set we use as a few new packages have been added since the last update.
This is the last change necessary before we can release Try PureScript for PureScript 0.14, in my opinion.