ember-engines icon indicating copy to clipboard operation
ember-engines copied to clipboard

Adding new file to lazy-engine while server is running doesn't get added to engine build

Open rjschie opened this issue 6 years ago • 1 comments

Description

If I run ember serve and then add a file to my lazy-engine's addon/controllers folder (or anywhere), the file is not included in the resulting engine.js folder.

It looks like the area that causes this is at the buildEngineJSTreeWithoutRoutes function. In the broccoli-dependency-funnel it's running fs-tree-diff patch calculations, but it's not correctly issuing a 'create' patch, it's issuing a 'change' patch which is a no-op for symlinked files (in the tmp folder).

This looks to be because on the creation of DependencyFunnel in that engine-addon function is only saving that FSTree at a the point of creation, and then continuing to compare against that. I'm not sure if this is a bug with FS-Tree-Diff / Broccoli Dependency Funnel, or with the use of the DependencyFunnel inside the buildEngineJSTreeWithoutRoutes function.

Repro Steps:

Setup ember-engines repo

git clone https://github.com/ember-engines/ember-engines; cd ember-engines; npm install
  1. Serve the app
ember serve
  1. Navigate to http://localhost:4200/routable-engine-demo/ember-blog/new

  2. Move template file out

mv tests/dummy/lib/ember-blog/addon/templates/new.hbs tmp
  1. Wait for rebuild and then move file back in
mv tmp/new.hbs tests/dummy/lib/ember-blog/addon/templates

Notice the template isn't loaded/shown in the served application

This could be rebuilt with the new.hbs starting outside the project, and then added in (moving step 3 to step 1) and the same effect would happen.

A couple of notes:

  • I am running an out of repo engine
  • I am symlinking my engine into the node_modules of the parent application

rjschie avatar Aug 01 '18 21:08 rjschie

Thanks for sharing the reproduction!

stefanpenner avatar Aug 02 '18 03:08 stefanpenner