A custom element that aims to make it easier to embed Spring '83 boards

Overview

<spring-board> element

A custom element that makes it simple to embed Spring '83 boards!

Usage

If you are using <spring-board> in a client-side framework you'll likely want to install it via npm, Yarn or pnpm.

npm install spring-board-element
# or
yarn add spring-board-element
# or
pnpm install spring-board-element

Then in your bundle, import the element:

import 'spring-board-element';

However, a simple <script> tag will also work! A UMD build is available via unpkg.com or any other CDN.

<head>
	<!-- Import the element -->
	<script type="module" src="https://unpkg.com/spring-board-element"></script>
	<!-- ... the rest of your <head> -->
</head>
<body>
	<spring-board href="https://bogbody.biz/..."></spring-board>
</body>

Attributes

The <spring-board> element has one optional attribute:

  • href: The URL of the board to embed.

LICENSE

MIT

Comments
  • Love it! Thank you.

    Love it! Thank you.

    Hello, another Ryan! 😄👋

    First of all, I have to say I absolutely love this idea & project. Thank you a million for putting it together, it's a genuinely novel & lovely addition to the Spring-o-sphere, and one I'm certain will have users... as I'm already in need of it! I really want to toss my current embedding code and use this everywhere instead.

    opened by rpj 3
  • <spring-board> should have a :host display style of block

    should have a :host display style of block

    This risks dipping into Spring '83 spec territory, but in my limited experience I've yet to find a reason for <spring-board> to not default to display: block. 🤔 Setting width, height and background-color on the element doesn't really work out the box otherwise.

    enhancement good first issue 
    opened by rdmurphy 2
  • attributeChangedCallback triggers a duplicate fetch of a board

    attributeChangedCallback triggers a duplicate fetch of a board

    This is my bad — I forgot that attributeChangedCallback and connectedCallback will fire when a custom element connects.

    I think the answer is to make sure the current value for this.href and the third parameter of attributeChangedCallback (often called newValue) do not match before allowing the fetch to happen.

    bug 
    opened by rdmurphy 1
  • Inject boards as fragments instead of raw strings

    Inject boards as fragments instead of raw strings

    Closes #15.

    The branch name is a bit misleading because we do still use innerHTML... we're just using it with template elements instead. 😅

    This is technically a more performant approach (though boards are so simple so that's likely pretty moot) but it does make it easier to eventually query these fragments for a <time> element or a link=next and could open the door for clients to intercept the board HTML and make modifications before insertion. This should also make it a bit easier to react to pesky nested <spring-board> elements per #10.

    opened by rdmurphy 0
  • Migrate <spring-board> away from using raw string innerHTML insertion

    Migrate away from using raw string innerHTML insertion

    This is slower than using the modern <template> method and just generally feels dated. The other benefit is it makes it possible to make alterations and run queries against the board HTML without having to inject the whole thing into the live DOM first.

    enhancement 
    opened by rdmurphy 0
  • Add some sort of event/Promise-based notification for loaded boards

    Add some sort of event/Promise-based notification for loaded boards

    A <spring-board> element should be able to "announce" it has loaded. This could solved via an event (this.dispatchEvent(new Event('spring-board-loaded'))) or perhaps via .loaded property with a Promise that resolves once the board is ready. I personally like the second idea a bit more though it's a bit more complex.

    enhancement 
    opened by rdmurphy 0
  • Add test runner and a few basic tests

    Add test runner and a few basic tests

    Closes #11.

    This certainly isn't covering all the bases, but it at least establishes a loose foundation for actually testing improvements and fixes going forward.

    opened by rdmurphy 0
  • Add display: block to :host, add reference version of default CSS

    Add display: block to :host, add reference version of default CSS

    Fixes #5.

    This adds display: block to the default :host styles for <spring-board>. Also added a default-board.css file to make it easier to change/update the spec styles later.

    Could certainly automate away the manual minify step, but no need to complicate it yet, I think!

    opened by rdmurphy 0
  • Make href attribute optional, fix doubled fetch of board HTML

    Make href attribute optional, fix doubled fetch of board HTML

    Fixes #3 and #4!

    They were surprisingly interwoven — to better support the possibility of <spring-board> elements being created at will in JavaScript, pointed at different boards, etc., the expectations around the href attribute needed to be loosened. As originally written the this.fetch call being in two locations was just asking for trouble, and it caused it — the most common way someone will likely use <spring-board> (loaded as HTML with a href attribute) would always trigger them both.

    opened by rdmurphy 0
  • <spring-board> should not throw an error without an href

    should not throw an error without an href

    As currently written a <spring-board> element will always throw an error the moment it gets added to the DOM and activated if it is missing an href attribute. (And if you remove it!) However — this makes it difficult (impossible?) to treat a single <spring-board> as more of a viewer where you change the href to load different boards.

    It's much more "native element"-esque as well to allow this — you are totally free to add an <img> or <video> tag to the DOM and it won't complain a bit.

    enhancement 
    opened by rdmurphy 0
  • Add method for triggering a reload of a board

    Add method for triggering a reload of a board

    Right now it's actually impossible to do this without changing the href to something else and swapping it back to the board you want, possible triggering a mess of network requests. Just need something boring like board.reload().

    enhancement 
    opened by rdmurphy 2
  • Should <spring-board> explicitly not allow itself to be its own child element?

    Should explicitly not allow itself to be its own child element?

    Was absolutely baffled why I was getting a foo is not a valid URL error all of a sudden only to finally trace it back to @robinsloan's dev board that I use in my preview/dev environment. 😅 The <spring-board> example found within the <code> block is a valid element and the custom element is trying to render it.

    I think in this case this is HTML that needs to be escaped when wrapped in <code>, but it did reveal a scenario I didn't think about — boards could just daisy-chain <spring-board> instances like a nesting doll if given the opportunity. 🙃

    Maybe during connectedCallback it audits whether it has a parent of <spring-board> and throws an error if so? Or perhaps right before it attempts to request the board?

    bug question 
    opened by rdmurphy 2
  • Add support for lazy loading of boards

    Add support for lazy loading of boards

    Just like how <img> and <iframe> can defer loading based on distance from the viewport, it may be nice to do the same for boards as well. I think we'd still default to an eager loading strategy.

    enhancement 
    opened by rdmurphy 0
  • Add a getter and event for when a rel=next link is found in a board's HTML

    Add a getter and event for when a rel=next link is found in a board's HTML

    Per the most recent draft of the spec clients should be mindful of when a board communicates that its publisher is moving to a new URL via a <link rel="next"> element.

    It's outside the scope of this element to do something with it in the context of a server, but it certainly should make it easy for the larger client to do so!

    Maybe when the element discovers a <link rel="next"> it should set its own href to what it finds to start the validation and render cycle?

    enhancement 
    opened by rdmurphy 0
  • Should the custom element reject boards above 2217 bytes and if so, how?

    Should the custom element reject boards above 2217 bytes and if so, how?

    It's without question possible to do this as part of the validation step, but what should the element do when a board it is loading fails? It could possibly:

    • Dispatch a spring-board-invalid event and leave it up to the larger client to decide.
    • Refuse to display the loaded HTML at all...
    • ...and instead render some sort of generic "not valid" output...
    • ...or not! I've yet to see (so far) any other client actually attempt to enforce this part of the spec.
    enhancement question 
    opened by rdmurphy 3
Releases(v0.3.0)
  • v0.3.0(Jul 12, 2022)

    What's Changed

    • Add display: block to :host, add reference version of default CSS by @rdmurphy in https://github.com/rdmurphy/spring-board-element/pull/8
    • Add test runner and a few basic tests by @rdmurphy in https://github.com/rdmurphy/spring-board-element/pull/12
    • Add support for a loaded property that resolves when a board is ready by @rdmurphy in https://github.com/rdmurphy/spring-board-element/pull/14
    • Inject boards as fragments instead of raw strings by @rdmurphy in https://github.com/rdmurphy/spring-board-element/pull/16
    • Add getter for a board's publication date by @rdmurphy in https://github.com/rdmurphy/spring-board-element/pull/18

    Full Changelog: https://github.com/rdmurphy/spring-board-element/compare/v0.2.0...v0.3.0

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Jul 2, 2022)

    What's Changed

    • Make href attribute optional, fix doubled fetch of board HTML by @rdmurphy in https://github.com/rdmurphy/spring-board-element/pull/6

    New Contributors

    • @rdmurphy made their first contribution in https://github.com/rdmurphy/spring-board-element/pull/6

    Full Changelog: https://github.com/rdmurphy/spring-board-element/compare/v0.1.0...v0.2.0

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Jul 1, 2022)

Owner
Ryan Murphy
Now @themarshallproject, previously @datadesk + @texastribune
Ryan Murphy
Vanilla Javascript plugin for manage kanban boards

jKanban Javascript plugin for Kanban boards jKanban allow you to create and manage Kanban Board in your project! Please try out the live demo! Install

Riccardo Tartaglia 898 Jan 3, 2023
The Easel Javascript library provides a full, hierarchical display list, a core interaction model, and helper classes to make working with the HTML5 Canvas element much easier.

EaselJS EaselJS is a library for building high-performance interactive 2D content in HTML5. It provides a feature-rich display list to allow you to ma

CreateJS 8k Dec 29, 2022
This experimental library patches the global custom elements registry to allow re-defining or reload a custom element.

Redefine Custom Elements This experimental library patches the global custom elements registry to allow re-defining a custom element. Based on the spe

Caridy Patiño 21 Dec 11, 2022
Kuldeep 2 Jun 21, 2022
JavaScript micro-library: pass in an element and a callback and this will trigger when you click anywhere other than the element

Add a click listener to fire a callback for everywhere on the window except your chosen element. Installation run npm install @lukeboyle/when-clicked-

Boyleing Point 5 May 13, 2021
Make drag-and-drop easier using DropPoint. Drag content without having to open side-by-side windows

Make drag-and-drop easier using DropPoint! DropPoint helps you drag content without having to open side-by-side windows Works on Windows, Linux and Ma

Sudev Suresh Sreedevi 391 Dec 29, 2022
🤝 A set of Persian Helpers for NodeJS to make your life easier

Persian Helpers Persian Helpers is a minimal NodeJS package with a set of helpers/tools specifically for the Persian/Farsi language. If you like the p

Kasra Ghoreyshi 11 Dec 22, 2022
A script that implements a GUI to make cheating on Blooket easier than ever.

BlooketUI What's BlooketUI? A script that implements a GUI to make cheating on Blooket easier than ever. How do i Use This? Copy the code of src.js by

null 66 Dec 24, 2022
An easy-to-use library to make your life easier when working with random numbers or random choices in javascript.

vrandom An easy-to-use library to make your life easier when working with random numbers or random choices in javascript. Table of contents Installati

Valerio Cipolla 1 Aug 16, 2022
A JavaScript Library To Make Your Work Work Easier/Faster

Functionalty.js (beta) About ✍️ This Is A JavaScript Library To Make Your Work Easier/Faster, You Can See Functionalty.js Website From Here Project Cr

Ali-Eldeba 16 Aug 30, 2022
Helps make it easier to utilize flyte from vs-code

Flyte-Wingman This is the repository for the Flyte-Wingman vscode extension. This extension can be used to easily create, serialize, and register pyth

Striveworks Inc 11 Jun 13, 2022
A JavaScript Library To Make Your Work Work Easier/Faster

Functionality.js (beta) About ✍️ This Is A JavaScript Library To Make Your Work Easier/Faster, You Can See Functionalty.js Website From Here Project C

Ali-Eldeba 9 May 25, 2022
A JavaScript Library To Make Your Work Work Easier/Faster

Functionality.js About ✍️ This Is A JavaScript Library To Make Your Work Easier/Faster, You Can See Functionalty.js Website From Here Project Created

functionality 16 Jun 23, 2022
A tampermonkey script that adds functionality to the midjourney.com website to make it easier to do things.

MidJourneyTools A tampermonkey script that adds functionality to the midjourney.com website to make it easier to do things. Setup Instructions Make su

Nikolas 42 Dec 24, 2022
Functions and objects that make it easier to add fields to Portable Text editors for accessibility meta information, like language changes or abbreviations.

Porta11y Porta11y is a collection of accessibility-focused annotations, decorators and validators for Sanity’s Portable Text editor. Portable Text is

Hidde de Vries 21 Aug 25, 2022
Github Actions and Workflows that make maintaining Magento2 projects and modules easier.

Magento 2 GitHub Actions Opinionated Github Actions and Workflows to make building, testing, and maintaining Magento 2 Modules easier. README if you a

Graycore, LLC 35 Dec 21, 2022
A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and configure Typescript on it.

CTSP- Create TS Project A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and conf

Jean Rodríguez 7 Sep 13, 2022
All in one is a CLI to make your journey in web development less painful (it makes your life way easier).

All In One CLI (Aio) The Ultimate CLI for all your needs in web development. Description This is a CLI that has all the commands you need to do anythi

Я♡M...∞ 17 Sep 25, 2022