Skip to content
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

feature/issue 119 constructor props #120

Merged
merged 5 commits into from
Oct 28, 2023

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Oct 14, 2023

Related Issue

resolves #119

Summary of Changes

  1. Support constructor props as renderToString param
  2. Add documentation and test case

TODO

  1. Add test case
  2. Document constructor props
  3. Needs upgrade CI to Node 18 and 20 #121 if we want to use fetch in our specs
  4. Does this apply to renderFromHTML? (moved to discussion)
  5. proof read docs
  6. getData deprecation issue tracking - Data Loading Strategies #123

@thescientist13 thescientist13 added the feature New feature or request label Oct 14, 2023
@thescientist13 thescientist13 self-assigned this Oct 14, 2023
@thescientist13 thescientist13 added documentation Improvements or additions to documentation question Further information is requested labels Oct 14, 2023
@thescientist13 thescientist13 force-pushed the feature/issue-119-constructor-props branch from 0cb9e9e to c84e35a Compare October 14, 2023 20:23
@thescientist13 thescientist13 marked this pull request as ready for review October 14, 2023 20:27
const { html } = await renderToString(new URL(moduleUrl), false, request);
```

This pattern plays really with file-based routing and SSR.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar

For example, you could preload a counter component with an initial counter state
### Constructor Props

Often for frameworks that might have their own needs for data loading and orchestration, a top level "constructor prop" can be provided to `renderToString` as the final param. The prop will then be passed to top level custom element definition's `constructor`.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar

@thescientist13 thescientist13 merged commit a0a7f3e into master Oct 28, 2023
12 checks passed
@thescientist13 thescientist13 deleted the feature/issue-119-constructor-props branch October 28, 2023 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

provide component data through render method params (constructor props)
1 participant