Skip to content

add livecodes.io plugin#684

Open
hatemhosny wants to merge 1 commit into
itteco:devfrom
hatemhosny:dev
Open

add livecodes.io plugin#684
hatemhosny wants to merge 1 commit into
itteco:devfrom
hatemhosny:dev

Conversation

@hatemhosny

Copy link
Copy Markdown

Scope

Category: N/A (external contribution — new domain plugin)
Task: No task — adds a domain plugin for LiveCodes, a registered oEmbed provider (oembed.com registry entry)

Demo and staging

Demo link: https://iframely.com/try?url=https%3A%2F%2Flivecodes.io%2F%3Ftemplate%3Dreact

Screenshot:

/debug?uri=https%3A%2F%2Flivecodes.io%2F%3Ftemplate%3Dreact:

image

About the changes

  • New feature (non-breaking change which adds functionality)

What has changed

Please describe what the code is doing (in this repo):

  • Adds plugins/domains/livecodes.io.js, a domain plugin for LiveCodes code playgrounds.
  • LiveCodes serves oEmbed (JSON, rich type) with per-URL discovery tags at https://livecodes.io/oembed. The domain is already in the central whitelist (oembed.rich: allow, horizontal, reader, resizable), so generic oEmbed works today — this plugin adds embed options on top of it.
  • The regex is fully anchored because the playground lives at the root URL: it matches livecodes.io/ and versioned/permanent-URL subdomains (e.g. v49.livecodes.io/) with an optional index.html, query string and hash, while deliberately not matching other paths such as /docs/* or /blog/* (regular content pages, no embeds).
  • getLink takes the iframe extracted from the oEmbed html (via the oembed-iframe mixin) and exposes three user-facing options:
    • height — defaults to the oEmbed height (400);
    • click_to_load — toggles loading=click, LiveCodes' native deferred-loading mode for embeds;
    • themelight / dark via the theme query param, with auto (param removed) as default, read through the standard players.theme request option.
  • Skips oembed-author (LiveCodes responses have no author fields) and description (not provided).
  • All four test URLs are permanent: two are template starters, one is a short share-ID URL backed by the share API, and one targets a versioned subdomain. They are covered by our registry schemes and will remain live.

Related PRs in other repos

  • N/A

Checklist

  • I have performed a self-review of my code, including Files Changed view
  • Fix/feat branches in all related repos are named the same (single repo)
  • All related PRs are submitted (none required)
  • Task is DONE and links back to this PR or no task

Review

Please note any risks, caveats, migration steps, release notices or additional tasks.

  • PRs have been tested on staging by DEV
  • PRs have been tested on staging by QA
  • PRs have been tested on staging by PRODUCT

Testing done locally (self-hosted instance from this branch):

  • GET /iframely?url=https://livecodes.io/?template=react returns the app link, correct href, height, and the three options; theme/height/click_to_load option changes round-trip into the iframe URL as expected.
  • Non-playground URLs (https://livecodes.io/docs/features/embeds) correctly fall through to generics.
  • theme=dark, theme=light and loading=click verified against the live embed URLs.

Notes for maintainers:

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