Skip to content

Document CORS config, promise plugins/adapters, and legacy template warning - #52

Open
ricardo-devis-agullo wants to merge 1 commit into
masterfrom
docs-cors-plugins-adapters
Open

Document CORS config, promise plugins/adapters, and legacy template warning#52
ricardo-devis-agullo wants to merge 1 commit into
masterfrom
docs-cors-plugins-adapters

Conversation

@ricardo-devis-agullo

Copy link
Copy Markdown
Contributor

Summary

Docs updates covering user-facing behavior from recently merged opencomponents/oc PRs that weren't yet reflected on the docs site:

  • Configurable CORS (opencomponents/oc#1545) - new cors registry option (origin, credentials, allowedHeaders, methods), documented in the config reference table plus a new "CORS Configuration" example. Defaults match the registry's existing hardcoded headers when omitted.
  • Promise-based plugin registration (opencomponents/oc#1542) - register(options, dependencies) can now return a Promise instead of calling next(); documented with an example and a deprecation note for the callback form.
  • Promise-based HTTP server adapter lifecycle (opencomponents/oc#1544) - listen()/close() on the Express/Fastify adapters now support a promise form (supportsPromiseLifecycle), documented in the server adapters guide for custom-adapter authors.
  • Adapter-neutral error event code (opencomponents/oc#1547) - the registry error event now emits SERVER_ERROR instead of EXPRESS_ERROR; updated the registry events table and added a callout.
  • oc init legacy template deprecation warning (opencomponents/oc#1546) - bare jade/handlebars template names now emit a one-time deprecation warning pointing to oc-template-es6; documented under the init CLI command.

opencomponents/oc#1543 (isolating deferred plugin loads across concurrent registry instances) is an internal correctness fix with no observable config/API surface, so it isn't covered here.

Test plan

  • npm run build in website/ completes successfully with no new errors.

…arning

Reflects several recently merged oc registry PRs that weren't yet covered
by the docs site:

- Configurable `cors` registry option (origin/credentials/allowedHeaders/
  methods), including a new example and defaults table entries
  (opencomponents/oc#1545).
- Plugins' `register` can now return a Promise instead of using the
  `next()` callback; callback style remains supported with a deprecation
  warning (opencomponents/oc#1542).
- HTTP server adapters (Express/Fastify) support a promise-based
  `listen()`/`close()` lifecycle via `supportsPromiseLifecycle`, alongside
  the deprecated callback form (opencomponents/oc#1544).
- The registry `error` event's `code` is now the adapter-neutral
  `SERVER_ERROR` instead of `EXPRESS_ERROR` (opencomponents/oc#1547).
- `oc init` emits a one-time deprecation warning when given the bare
  `jade`/`handlebars` template names, pointing to `oc-template-es6`
  (opencomponents/oc#1546).

opencomponents/oc#1543 (isolating deferred plugin loads across concurrent
registries) is an internal correctness fix with no user-facing config or
API change, so it isn't documented here.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.

1 participant