Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions src/docs/output-targets/custom-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,11 @@ export const config: Config = {
};
```

| Option | Description |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `default` | No additional re-export or auto-definition behavior will be performed.<br><br>This value will be used if no explicit value is set in the config, or if a given value is not a valid option. |
| `single-export-module` | All component and custom element definition helper functions will be exported from the `index.js` file in the output directory (see [Defining Exported Custom Elements](#defining-exported-custom-elements) for more information on this file's purpose). This file can be used as the root module when distributing your component library, see [below](#distributing-custom-elements) for more details. |

<!-- TODO(STENCIL-457): Move this info to the appropriate option on `customElementsExportBehavior` -->

### autoDefineCustomElements

By default, consumers of the `dist-custom-elements` output target need to
register each Stencil component that they want to use in the bundle manually.
Setting this flag to `true` will define a component automatically with the
`CustomElementRegistry` when the component's module is imported. Note that this
will also automatically recursively define any child components as well.

This flag defaults to `false` when omitted from a Stencil configuration file.
| Option | Description |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `default` | No additional re-export or auto-definition behavior will be performed.<br><br>This value will be used if no explicit value is set in the config, or if a given value is not a valid option. |
| `single-export-module` | All component and custom element definition helper functions will be exported from the `index.js` file in the output directory (see [Defining Exported Custom Elements](#defining-exported-custom-elements) for more information on this file's purpose). This file can be used as the root module when distributing your component library, see [below](#distributing-custom-elements) for more details. |
| `auto-define-custom-elements` | A component and its children will be automatically defined with the `CustomElementRegistry` when the component's module is imported. |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does it make sense for us to order this alphabetically? I'm kind of on the fence here, since "default" is kind of a special value and I don't know if I'd prefer to differentiate it here by having it at the top. I suppose that doesn't prevent us from doing something like

  • default
  • auto-define-custom-elements
  • single-export-module

At the same time, there's really nothing wrong with

  • auto-define-custom-elements
  • default
  • single-export-module

either. Thoughts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I like keeping default at the top, but alphabetizing the others makes sense.


> Note: At this time, components created not using JSX may not be automatically
> defined. This is a known limitation of the API and users should be aware of
Expand Down