Skip to content

json and code plugin callbacks do not run when building Lit components #1709

Description

@taylorfsteele

I am interested in helping provide a fix!

Yes

Which generators are impacted?

  • All
  • Angular
  • HTML
  • Preact
  • Qwik
  • React
  • React-Native
  • Solid
  • Stencil
  • Svelte
  • Vue
  • Web components

Reproduction case

N/A

Expected Behaviour

When writing a plugin to run against Lit components, the json and code callback functions don't run.

With the plugin:

/**
 * @type {import('@builder.io/mitosis').MitosisConfig}
 */
module.exports = {
  files: "src/**",
  targets: ["lit"],
  dest: "../",
  commonOptions: {
    typescript: true,
  },
  options: {
    lit: {
      plugins: [
        () => ({
          name: "hello-plugin",
          order: 1,
          build: {
            pre: () => console.log("pre build"),
            post: () => console.log("post build"),
          },
          json: {
            pre: () => console.log("pre json"),
            post: () => console.log("post json"),
          },
          code: {
            pre: () => console.log("pre code"),
            post: () => console.log("post post"),
          },
        }),
      ],
    },
  },
};

The CLI should print during the pre and post steps of the build, json, and code steps.

Actual Behaviour

Plugin callbacks with code and json steps do not run against lit components.

With the above example, the CLI prints:

pre build
Mitosis: lit: generated 1 components, 1 regular files.
post build
Mitosis: generation completed.

Additional Information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions