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

feat: add addDevToolbarPlugin and addIntegration utilities #64

Merged
merged 36 commits into from
Feb 29, 2024

Conversation

jdtjenkins
Copy link
Collaborator

@jdtjenkins jdtjenkins commented Feb 18, 2024

Hey all!

The long awaited Dev Toolbar Framework App PR is here 🎉 !

So this PR adds two utilities:

addDevToolbarFrameworkApp and addIntegration.

Starting with addIntegration - this is a small util that simply adds an integration from an integration. Very useful for `addDevToolbarFrameworkApp. It's useful to add the Astro framework integrations from your integration meaning you're not relying on your user then also having to install and add it. But it will check if it's already installed, and if it is it won't add it again.

addDevToolbarFrameworkApp, as I'm sure can all guess, adds a dev toolbar plugin. But it allows you to define a framework and a path to a framework component so you can load framework components into a dev toolbar plugin.

The addDevToolbarFrameworkApp API also has an added benefit of being close(r) to what the Astro teams wants the addDevToolbarApp API to be in the future. So when we go to core.... This may be good? I dunno, but it's cool though!

All examples of the plugins are available in the playground!

Cheers all!

Closes #13

Copy link

netlify bot commented Feb 18, 2024

Deploy Preview for astro-integration-kit ready!

Name Link
🔨 Latest commit 71e0512
🔍 Latest deploy log https://app.netlify.com/sites/astro-integration-kit/deploys/65e0a2f97cf38f00083f5543
😎 Deploy Preview https://deploy-preview-64--astro-integration-kit.netlify.app/utilities/add-devtoolbar-framework-app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

package/package.json Outdated Show resolved Hide resolved
Copy link
Owner

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

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

can't review more just yet but a few comments! also i'm not sold on the utility name, plugin could be confusing with aik plugins. i get that you can't just use addDevToolbarApp but may be worth tinkering a little bit

docs/src/content/docs/utilities/add-devtoolbar-plugin.mdx Outdated Show resolved Hide resolved
docs/src/content/docs/utilities/add-devtoolbar-plugin.mdx Outdated Show resolved Hide resolved
docs/src/content/docs/utilities/add-devtoolbar-plugin.mdx Outdated Show resolved Hide resolved
docs/src/content/docs/utilities/add-devtoolbar-plugin.mdx Outdated Show resolved Hide resolved
Copy link
Owner

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

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

  1. my comments on the preact stub applies to all of them
  2. may be worth documenting how to load the icon from a file, or even provide an helper. that's a bit nicer dx imo

docs/src/content/docs/utilities/add-devtoolbar-plugin.mdx Outdated Show resolved Hide resolved
docs/src/content/docs/utilities/add-integration.mdx Outdated Show resolved Hide resolved
docs/src/content/docs/utilities/add-integration.mdx Outdated Show resolved Hide resolved
package/src/utilities/add-devtoolbar-plugin.ts Outdated Show resolved Hide resolved
package/src/utilities/add-devtoolbar-plugin.ts Outdated Show resolved Hide resolved
package/src/utilities/add-devtoolbar-plugin.ts Outdated Show resolved Hide resolved
package/src/utilities/add-integration.ts Show resolved Hide resolved
package/src/utilities/addDevToolbarPluginStubs/preact.ts Outdated Show resolved Hide resolved
package/src/utilities/addDevToolbarPluginStubs/preact.ts Outdated Show resolved Hide resolved
package/src/utilities/addDevToolbarPluginStubs/preact.ts Outdated Show resolved Hide resolved
package/src/utilities/add-devtoolbar-framework-app.ts Outdated Show resolved Hide resolved
package/src/utilities/add-devtoolbar-framework-app.ts Outdated Show resolved Hide resolved
package/src/utilities/add-devtoolbar-framework-app.ts Outdated Show resolved Hide resolved
package/src/utilities/add-integration.ts Outdated Show resolved Hide resolved
package/src/utilities/add-integration.ts Outdated Show resolved Hide resolved
package/src/utilities/add-integration.ts Outdated Show resolved Hide resolved
package/package.json Show resolved Hide resolved
package/package.json Outdated Show resolved Hide resolved
package/src/core/types.ts Outdated Show resolved Hide resolved
package/src/utilities/add-devtoolbar-framework-app.ts Outdated Show resolved Hide resolved
package/src/plugins/add-integration.ts Show resolved Hide resolved
package/src/utilities/add-devtoolbar-framework-app.ts Outdated Show resolved Hide resolved
Copy link
Owner

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

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

We're getting real close this time! Btw, what is test-vue-app?

docs/astro.config.ts Outdated Show resolved Hide resolved
package/package.json Outdated Show resolved Hide resolved
package/src/utilities/add-devtoolbar-framework-app.ts Outdated Show resolved Hide resolved
package/src/plugins/add-integration.ts Outdated Show resolved Hide resolved
@jdtjenkins
Copy link
Collaborator Author

@florian-lefebvre test-vue-app was just a test to be more like an actual package with it's own deps. I can remove it... but it probably is good to test things work from a separate app too. Especially when when doing deps stuff. Like for example then I could remove the "vue" dep from playground but have it as a dep of test-vue-app

@florian-lefebvre
Copy link
Owner

Sounds good! Could that be nested inside a new top level folder? Like playground-packages or whatever

Copy link
Owner

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉

Copy link
Collaborator

@Fryuni Fryuni left a comment

Choose a reason for hiding this comment

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

So we won't check dependencies ourselves for now. It is great to reduce the scope.

Docs and comments LGTM, I have zero expertise with UI frameworks so it's all sorcery in my eyes. The sorcery is looking pretty though.

@florian-lefebvre florian-lefebvre changed the title Issue 13 - Adds addDevToolbarPlugin and addIntegration utilities feat: add addDevToolbarPlugin and addIntegration utilities Feb 29, 2024
@florian-lefebvre florian-lefebvre merged commit 2863031 into florian-lefebvre:main Feb 29, 2024
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.

Make Dev Toolbar App development easier
3 participants