Skip to content

Commit

Permalink
fix: hotreloading .dhtml
Browse files Browse the repository at this point in the history
resolve #453
  • Loading branch information
nobkd committed Feb 1, 2025
1 parent 5964c54 commit 4860af7
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lychee.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nue build -pr packages/nuejs.org/
nue -pr packages/nuejs.org &
links=$(find packages/nuejs.org/.dist/prod -name "*.html" -printf "http://localhost:8080/%P ")
echo $links | xargs lychee --no-progress --include-fragments --accept "403, 429, 503, 999" --remap "http://localhost:8080/@ https://nuejs.org/@" --remap "http://localhost:8080/todomvc https://nuejs.org/todomvc" --remap "http://localhost:8080/glow-demo https://nuejs.org/glow-demo" --exclude "http://localhost:8080/404.html" --
2 changes: 1 addition & 1 deletion packages/nuekit/src/browser/hotreload.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sse.onmessage = async function(e) {
// if (data.is_js) import('/' + path + '?' + Math.random())

// reactive component
if (data.is_nue || data.is_htm) remount('/' + data.path.replace(data.ext, '.js'))
if (data.is_dhtml || data.is_htm) remount('/' + data.path.replace(data.ext, '.js'))


// styling (inline && stylesheets)
Expand Down
52 changes: 52 additions & 0 deletions push-spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Tero:
would you be interested on implementing a nue push command that would automate the setup and deployements to <username>.github.io? This would make a huge difference. If not, I’ll make that in any case.

The flow:
1. Check if the user ssh access. If not -> print a link to guide
1. Check if the <username> rpository exists, if not confirm (Y/N) create one trough GH API
1. Confirm potential overrides to existing repository
1. Push .dist/prod

nobkd:
I can give it a try.
8:29
But the gh api repo creation could cause some issues. if i remember correctly for e.g. creation action it needs a token, that a user would have to create himself, to have the permissions to create the repo.
But maybe I'm wrong.
8:32
But wouldn't it make more sense just creating a github actions workflow file that can build and publish the site to github pages instead?
Then the source would be version controlled in the repo, and files are just built using nue.
The workflow could look similar (I have some changes in mind that should be done) to my (not very usable) nue-editor repo.
File: https://github.com/nobkd/nue-editor/blob/85b2ec3a518f96997b6f8a3d419116d969fa1a7b/.github/workflows/deploy.yaml
8:34
I understand, that the push command would be for building and pushing built files, but I don't think it is the best solution at least for github pages.
8:34
I'll think about it a bit more.


Tero Piirainen
Nov 30th, 2024 at 1:21 AM
Actions sound great! I’m not familiar with them so they didn’t occur to my mind. The key thing is to hide all these complexities from the user, who would only interact with the push (or deploy) command
1:23
Would the build happen on GitHub servers on this case?
1:25
There are benefits in local builds too, such as pushing small typo fixes quickly and hiding all the github command complexity
1:25
But that would not be ideal for teams obviously


nobkd
Nov 30th, 2024 at 1:29 AM
When using actions, yes, it uses the gh servers.
You're probably right. Maybe just adding a workflow guide to the docs would be enough.
I think, pages can be configured to use another branch's files. So maybe building locally, and automatically updating another branch would be fine...
I think, I'll have to dwell on that a bit more. There's so much to take into account...
1:30
I currently have my mind on just fixing a few last bugs on the publish workflow for nuejs.org and examples.


Tero Piirainen
Nov 30th, 2024 at 1:34 AM
Yeah. Lot of options here. And sure thing, no rush!



0 comments on commit 4860af7

Please sign in to comment.