Skip to content

Conversation

@erunion
Copy link
Member

@erunion erunion commented Oct 25, 2023

🧰 Changes

With the work I did in https://github.com/readmeio/httpsnippet/releases/tag/8.1.0 this slightly refactors1 httpsnippet-client-api to now be a proper new HTTPSnippet plugin so it can now be installed as a one-liner:

import { HTTPSnippet, addClientPlugin } from '@readme/httpsnippet';
import plugin from 'httpsnippet-client-api';

addClientPlugin(plugin);

Previously the way it was installed was as such:

import { HTTPSnippet, addTargetClient } from '@readme/httpsnippet';
import plugin from 'httpsnippet-client-api';

addTargetClient('node', plugin);

This plugin refactor allows us to move the target that we're targeting, node, directly onto the client plugin. This refactor, and the addition of an installation message on the client will allow us to do some fun stuff in @readme/oas-to-snippet and accept plugins from outside sources.

Footnotes

  1. Very much a breaking change refactor but because we're still in beta land with this work I'm not going to bother versioning this to another major.

@erunion erunion added enhancement New feature or request refactor Issues about tackling technical debt area:snippets Issues related to code snippets labels Oct 25, 2023
@erunion erunion marked this pull request as ready for review October 25, 2023 23:24
@erunion erunion requested a review from kanadgupta October 25, 2023 23:24
@erunion erunion added this to the v7 milestone Oct 25, 2023
Copy link
Contributor

@kanadgupta kanadgupta left a comment

Choose a reason for hiding this comment

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

i'm having a little trouble wrapping my head around how all these changes fit together lol but on the whole excited for this!

@erunion erunion merged commit 0b88a3b into main Oct 26, 2023
@erunion erunion deleted the feat/snippet-plugin-refactor branch October 26, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:snippets Issues related to code snippets enhancement New feature or request refactor Issues about tackling technical debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants