npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-fastboot-form-rehydration

v0.1.3

Published

The default blueprint for ember-cli addons.

Downloads

31

Readme

ember-fastboot-form-rehydration

Build Status npm version

This addon tries to mitigate a common problem of FastBoot rendered Ember apps containing form controls.

Installation

ember install ember-fastboot-form-rehydration

The Problem

For users on a slow (mobile) connection there will be some considerable delay between the time of the first paint, where the browser displays the static FastBoot-rendered content, and the time when all the app's JavaScript has been loaded, parsed and evaluated. At that time - at the current state of Ember and FastBoot, see "Outlook" below - the existing static DOM will be destroyed, loosing all its state, and Ember will take over and render the whole application again.

One common problem of this is when you have some form controls on your page, and the user might have started to enter some data into them while still working with the static DOM. When Ember has rerendered your application, all that entered data will be lost! Also any previously focused input will have lost its focus.

The Solution

This addon will workaround this problem, by collecting all the form controls values (currently supported are <input> and <textarea> elements) and the currently focused element just before the static DOM is destroyed, and reapply those values and the focused state after Ember's first render.

Note that you have to add name attributes to all your form controls, so this addon knows how to identify and match them before and after the rerendering!

Outlook

At some point in time, the described problem will have been solved by Ember itself, when it starts to ship with a version of its Glimmer rendering engine that properly supports DOM rehydration, i.e. it will reuse the existing DOM and thus retain its previous state.

When that happens, this addon can be deprecated. But for the time being it can serve as a stop gap solution.