Code Monkey home page Code Monkey logo

dom-compare-temp-vue-patch's Introduction

Patch for 'dom-compare-temp' on Sage + Vue configurations

The default dev config of Sage's wordpress theme uses dom-compare-temp as a transitive dependency to live-update the page while you develop. Using Vue, the node process crashes when this dependency encounters document fragments.

This patch allows to use Vue a bit better, at least without crashes. See here :

https://discourse.roots.io/t/sage-9-vue-js-no-jquery/14162/3

Usage

Add dom-compare-temp as a dev dependency to be able to require it directly without ESLint complaining :

yarn -D add dom-compare-temp

sage/resources/assets/build/config.js before

const path = require('path');
const { argv } = require('yargs');
const merge = require('webpack-merge');
const desire = require('./util/desire');
// etc..

sage/resources/assets/build/config.js after

const path = require('path');
const { argv } = require('yargs');
const merge = require('webpack-merge');
const patch = require('./dom-compare-patch');
const domCompare = require('dom-compare-temp');
patch(domCompare);
const desire = require('./util/desire');

Method

Since the code of dom-compare-temp/compare resides in an IIFE we're duplicating it here to be able to replace it.

Crashes are then "resolved".

dom-compare-temp-vue-patch's People

Contributors

documents-design avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

ierso

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.