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

WIP - Add scripts support #24

Closed

Conversation

devinrhode2
Copy link

This is VERY much a work-in-progress.

Opening early for visibility/feedback/etc

@justinfagnani
Copy link
Owner

Generally, I think issues are a great way to start the conversation. I'm happy to start on the PR.

The big thing to consider with scripts is security. I think it's probably a bad default to run scripts, certainly from a different origin. Is there an attribute to run scripts? Then, how does this work with CSP?

@@ -0,0 +1,47 @@
/** @type {import('eslint').Linter.BaseConfig} */
Copy link
Owner

Choose a reason for hiding this comment

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

let's keep the PR focused on one thing, and make project setup changes a different PR.

@@ -0,0 +1,122 @@
import React, { useEffect, useState } from 'react'
Copy link
Owner

Choose a reason for hiding this comment

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

Why is there React code in this PR?

I didn't even include Lit in the first version because this component didn't need dependencies. I'd be very against including React. What's it for?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this PR LLM spam?

Copy link

Choose a reason for hiding this comment

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

Too harsh Benny, IMO.

A React shim for seems like it should live in a separate package, and possibly not in the html-include-element git repo. As this is written, it seems that html-include would need to take a dependency on React, when currently it has zero deps.

Copy link
Author

Choose a reason for hiding this comment

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

Originally this was written in a react app, before I knew about html-include-element.

I'll use co-pilot for trivial suggestions, but that's it. I got burned a couple times on medium-size snippet suggestions and it was just the WORST!

Copy link
Author

Choose a reason for hiding this comment

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

Never intended to suggest this project add react, but I know there's a lot of goofs out there that may frolic along thinking adding react to everything is fine and normal lol.

I think a react-shim doesn't even need to use html-include per se.

I'm actually going in a different direction, creating my own soup-to-nuts react shim for my projects specific use case. In that shim, I may create some options around <ReactShadow>, or let the consumer of some widget decide if they want to wrap it in <ReactShadow> or not.

Copy link
Author

Choose a reason for hiding this comment

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

The shim will be for a solid-js based "micro-frontend"

@devinrhode2 devinrhode2 force-pushed the devin/add-scripts-support branch from 17d7f00 to d0aedcd Compare August 1, 2023 17:46
@devinrhode2 devinrhode2 closed this Aug 1, 2023
@devinrhode2
Copy link
Author

I won't delete this branch, in case anyone that stumbles upon this is also interested in adding some sort of scripts support.

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.

4 participants