-
Notifications
You must be signed in to change notification settings - Fork 138
Conversation
This changes allows the examples to serve two purposes, to be used for fast local development with budo served in-memory builds, and also so that examples can be statically hosted next to the built distributions.
Because GitHub pages are not served from a root URL on anything other than a user or organisation repo, the relative URL to the parent directory is nessesary. This still permits sites that are served from a root URL as a source URL starting with `../dist/` on a root webpage with resolve to `/dist/`. As such this does not break the local dev command `npm run dev`. This also has the additional advantage that if a developer simply clones the repo to view examples, then they do not need to serve the files from a local server, they can simply access them through `file://` protocol.
I have updated the workflow in a9b24cb to only build distributions when the actual source files change. This makes sense because we don't need or want attempts to build distributions if we are only changing auxiliary files like This change may actually mean we will need to perform a one-off manual |
Additional changes proposed
|
I think this is great, but I have one concern: I think that it might be confusing to have a version of aframe-physics-system.js loaded in memory that's different from the one in the file system. I experimented with a different version of dev:
The difference is that it saves aframe-physics-system.js every time there's a change. You mentioned recommending that developers not commit files in dist, but unless it's enforced, we have to account for that possibility anyway. There are two possibilities if a commit does include dist: the automated build creates identical versions or different versions. In the latter case, the automated versions will replace the previous ones, which is good. In the former, I think the commit will fail because there will be no changes. I don't know the best way to deal with that, but I think we need to handle it, even with your solution. Now, maybe there are other reasons not to save the built files, such as performance. I'm not convinced my suggestion is better, I just wanted to propose it. |
examples/README.md
Outdated
# Examples | ||
|
||
To help demonstrate the features and capabilities of `aframe-physics-system` | ||
the follow collection of examples that have been prepared. |
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.
the following collection of examples has been prepared.
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.
Thanks for catching this 😊 I've fix this grammar in 79d3ada.
Thanks @MignonBelongie again I really appreciate the time you have taken to look through all my changes.
Thanks so much for you're alternative proposal for the But looking around some of the libraries that I use there is no one common choice. In A-Frame it is not saved to disk every time, however for Vue.js and three.js is saved every time. For those two repos it seems the only way they enforce preventing I'am grateful for you bringing this point up. I do personally prefer it the current way, and I can't see a use case that would benefit from having the development build written to disk every time. However if there is a majority that would prefer writing to file every time, and there is a reason to do it, I'm happy to figure out an appropriate change based on your suggestion. Do you have a use case that would benefit from having it written to disk every time? If this is changed, I would advocate for having two dev commands, one in-memory and one not.
Yes I again agree with you on this. We can make sure to clearly state not to commit the
Thanks for raising this point. Yeh I agree it will fail because there are no changes, in my test branch there is an example of this happening. I was happy with the outcome because, unlike the automated tests in #168 that will eventually hopefully be merged soon, if the So we could add in a guard to the CI that checks to see if there are uncommitted changes. Based on an answer from VonC I think the following would work
I just need to check what shell the GitHub The |
No, I don't have a use case. It's just that I can imagine myself, before I understood how budo worked, being utterly confused about why the code in the browser was different than in the file. I suppose it's something you just have to learn, and we can try to help in the documentation.
If this works, it would be nice, but I think based on your example above, the behavior as-is is acceptable. |
Thanks @MignonBelongie 😊 I will go ahead a make that |
Yeh I think there is a lot we can do documentation wise to make this repo more inviting to new contributors, from code's of conduct to detailed contributors guide lines. I completely agree that |
I closed this repo prematurely, just a mistake I made, sorry guys, I've opened it back up, and we will have a meeting about this and the other PR's soon! |
Thanks again @MignonBelongie @Micah1 for taking a look at this PR. I've made the final modification in If you take a deeper look at the workflow logs, for the first triggered workflow you can see the commit of the built distribution. For the second triggered workflow you can see that there is no attempt to commit due to the extra condition introduced in 99c3940 as desired. I have no more changes I would like to make, so this is ready to merge from my side. Please let me know if you have any other questions. |
I understand that it's not in scope to fix the broken links, but wouldn't it be better to leave them out until they work? In any case, we should add another issue, to either add or fix these links. |
Thanks so much @MignonBelongie yeh I agree with your suggestion, it makes sense to not include those extra links that are not critical, untill there's a solution that makes them valid both through GitHubs repo interface and deployed through GitHub pages. I'll remove those links and push that shortly 😊 All the example links will still work, with them linking to live deployed examples when viewing the documentation deployed through GitHub pages, or linking to the HTML source when viewing in GitHubs repo interface. And I think that makes sense, as you probably want to see the live example when on GitHub pages, but you want to see the source when in the repo interface. But please let me know if you disagree. |
@Galadirith Sorry, I forgot about this. Do you have time to remove the links? If not, we might merge this tomorrow anyway and just create another issue to fix them. As for your question, I think having the links go to the source when you're in the GitHub repo is good. I'm actually trying to find a good way to also have links to the examples when running locally (i.e. after running |
@MignonBelongie I really apologise for not having been able to reply sooner. Thanks so much for merging this in, I didn't have time in the end to remove the partially broken links. However I agree, I think it's useful to have them there when browsing the GitHub repo, and they can be updated to be applicable to both the GitHub repo, GitHub pages, and local render in another PR. Thanks so much again 😊 Really awesome to now see live examples at https://n5ro.github.io/aframe-physics-system/examples/ that will keep in sync with the automatic master dist build as features get added and bugs fixed 😊 |
Description
Add automated distribution building for master. This supports deploying the examples via GitHub pages. Because this PR is designed to operator on on the
master
branch it cannot be tested directly in the fork. However a demonstration branchGaladirith:deploy-master-examples-fork
has been added with minimal changes to test and demonstrate this fork. You can view the minimal changes and the automated distribution build at Galadirith/aframe-physics-system@deploy-master-examples...Galadirith:deploy-master-examples-fork.Once this PR is merged, simply go to https://github.com/n5ro/aframe-physics-system/settings, scroll down to the GitHub Pages section, select the
master
branch and/ (root)
folder, and finally press save.Changes proposed
Update
dev
commandThe dev command is now serving the built distribution from
dist/aframe-physics-system.js
. This makes it consistent with the updated examples so that now the examples can be used locally for development or hosted on GitHub pages without having to manually modify thesrc
location of the script.Update
src
location in examplesAgain to make things consistent between local dev and GitHub pages hosted. In theory this could have been changed to any url as long as it was consistent, but as @MignonBelongie and others have suggested
/dist/*
is the standard location to commit built distributions, so it makes sense to use that url for both local and hosted files.Add builder workflow
This new GitHub workflow will build the following files every time commits are pushed to master (either through a merge or direct push).
This means developers do not have to manually run
npm run dist
and commit the updated/dist/*
files, and I would recommend that developers do not manually build and commit their own distributions. Of course there will be instances where it is useful to manually build dist's, like on development branches. In general the idea is to minimise the number of update dist commits.To enable this, GitHub Actions will need to be enabled in this repo, as also mentioned in Add GitHub workflow to test Chrome and Firefox #168.