3
1
Fork
You've already forked experimental-plugins
1

Add rendering during build for React plugin hydration attribute #41

Merged
qustrolabe merged 4 commits from main into main 2025年03月03日 17:36:52 +01:00
qustrolabe commented 2025年03月03日 15:37:58 +01:00 (Migrated from github.com)
Copy link
  • Added style.css from original react-todo
  • Slightly tweaked how state initializes to prevent hydration errors
  • Added build-time rendering for divs that have hydrate attribute

Current appPath relies on position of mod.ts file and would definitely need tweaking when put into actual lume/plugins, I couldn't figure out better way to get that path yet

- Added style.css from original react-todo - Slightly tweaked how state initializes to prevent hydration errors - Added build-time rendering for divs that have ```hydrate``` attribute Current appPath relies on position of mod.ts file and would definitely need tweaking when put into actual lume/plugins, I couldn't figure out better way to get that path yet
@ -59,6 +60,16 @@ export default function (userOptions?: Partial<Options>) {
script.setAttribute("type", "module");

Lume has the function site.src() to return a path for any file in the src folder.
So site.src(src) returns the full path. Then you can convert it to a file url so it can be imported dynamically:

const appPath = toFileUrl(site.src(src)).href;
Lume has the function `site.src()` to return a path for any file in the src folder. So `site.src(src)` returns the full path. Then you can convert it to a file url so it can be imported dynamically: ```js const appPath = toFileUrl(site.src(src)).href; ```

thank you!

thank you!
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lume/experimental-plugins!41
Reference in a new issue
lume/experimental-plugins
No description provided.
Delete branch "main"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?