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

chore: add embed function for bundled cdn dispatch #369

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

islxyqwe
Copy link
Member

Added new embed function for GraphicWalker, GraphicRenderer, TableWalker, and PureRenderer.
add data or fields will automaticly change a fullgraphicwalker into a simple graphic walker.
the new function is embedGraphicRenderer, embedTableWalker, embedPureRenderer.

<script type="module">
import gw from 'https://cdn.jsdelivr.net/npm/@kanaries/graphic-walker@0.4.60/+esm'
gw.embedGraphicWalker(document.getElementById('root'), { data: [], fields: [] })
</script>

Copy link

vercel bot commented Apr 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
graphic-walker ❌ Failed (Inspect) Apr 10, 2024 0:51am

Copy link
Contributor

github-actions bot commented Apr 10, 2024

Risk Level 2 - /home/runner/work/graphic-walker/graphic-walker/packages/graphic-walker/src/root.tsx

The changes in this file are mostly about adding new components and types. However, there is a potential risk in the use of useState for shadowRoot. If the shadowRoot is not properly managed, it could lead to unexpected behavior. Consider using a more robust state management solution if this becomes a problem.


Risk Level 3 - /home/runner/work/graphic-walker/graphic-walker/packages/graphic-walker/src/vanilla.tsx

  1. The changes in this file are mostly about adding new functions and components. However, there is a potential risk in the use of ReactDOM.createRoot and ReactDOM.render. If these are not used correctly, it could lead to unexpected behavior. Consider using a more robust rendering solution if this becomes a problem.

  2. The use of console.warn in production code is not recommended. Consider using a logging library that can be configured to log warnings only in development mode.

  3. The throw 'DOM element not found.'; statement should be replaced with throw new Error('DOM element not found.'); to throw an actual Error object.


📁🔍⚠️


Powered by Code Review GPT

@islxyqwe islxyqwe merged commit d391382 into main Apr 10, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants