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

Separate code out into an implementaiton file that does not activate when imported. #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rictic
Copy link

@rictic rictic commented Sep 15, 2022

The main index file behaves the same so this is backwards compatible.

I'm working on using this library at google, and I want to make sure we only use it in development (using a technique similar to if (process.env === 'dev') { activate() }). We also patch HTMLElement in the custom elements es5 shim, and we need to apply that patch before we apply this one, and exporting the activate function makes it somewhat easier to ensure that the patches are applied in the correct order.

…when imported.

The main index file behaves the same so this is backwards compatible.

I'm working on using this library at google, and I want to make sure we only use it in development (using a technique similar to `if (process.env === 'dev') { activate() }`). We also patch HTMLElement in the custom elements es5 shim, and we need to apply that patch before we apply this one, and exporting the activate function makes it somewhat easier to ensure that the patches are applied in the correct order.
If redefine_custom_elements has already been activated, it's now a no-op to activate it again.
@caridy
Copy link
Owner

caridy commented Nov 30, 2022

@rictic thanks for the PR, I'm fine with this separation.

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.

None yet

2 participants