electron-userland / electron-compilers

DEPRECATED: Compiler implementations for electron-compile
35 stars 52 forks source link

Jade compiler doesn't implement determineDependentFiles() #80

Open eliseshaffer opened 7 years ago

eliseshaffer commented 7 years ago

I am currently experiencing an issue that I think I have been able to track back to electron-compilers. I think the issue is that the electron-compilers/src/html/jade.js compiler doesn't implement the determineDependentFiles() function. It is also possible that I'm mistaken. If that's the case, then I apologize.

I found this by trying to use electron-forge which uses electron-compile for compiling jade. I created a jade template that called out to a partial. Updating the partial would not cause the parent file to be recompiled as I expected. However, updating the parent file would cause the partial to be recompiled.

I am pretty new to node.js and electron. I have more experience with Ruby. But I'm willing to take a stab at implementing this, with a little guidance.

For reference, I have created a repo to showcase the problem here: https://github.com/alexshenoy/jade-compiler-troubleshooting

Steps To Reproduce:

  1. Run npm start
  2. Modify partial.jade
  3. Run npm start again
  4. See cached index.html instead of new version.

Relevant code from the repo:

createWindow() from index.js:

const createWindow = () => {
  mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
  });
  mainWindow.loadURL(`file://${__dirname}/index.jade`);
  mainWindow.on('closed', () => {
    mainWindow = null;
  });
};

index.jade:

doctype html
html
  head
    title Electron Playground
  body
    include ./partial
    Hi Mom!! Test of some kind

partial.jade

h4 This is a title
p.
  Changes in this file will not be reflected in the above partial.