max-mapper / max-mapper/yo-yo

hot module reload : yoyo webpack

Open
#12 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
JavaScript
Stars
1.3k
Forks
46
PR merge metrics
No merged PRs in 30d

Description

Anyone have any ideas about adding hot module reload for yoyo template objects?

My current incomplete code:

//   ./yoyo-hot-loader.js
module.exports = function(source) {
  if ((source.indexOf('yo`') > -1 || source.indexOf("yo-yo") > -1) && source.indexOf("module.hot") === -1) {
    source += "if(module.hot) {";
    source += "   module.hot.accept();";
    source += "}";

    return source;
  }

  return null;
}

I'm not to familiar with the webpack hot reload plugin. Currently, this does hot reload but does not remove the old code. Ideas?

Here is the API: https://webpack.github.io/docs/hot-module-replacement.html

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the incomplete yoyo-hot-loader.js code in the issue and read webpack's Hot Module Replacement API documentation. Determine how yoyo template objects should be replaced so old code is removed rather than only accepted. Done means hot reload updates the affected template objects without leaving the previous code active.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
frontend, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.