Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isobuild watch and build unnecessary files - under Meteor > v1.2 #7842

Closed
theosp opened this issue Sep 29, 2016 · 6 comments
Closed

Isobuild watch and build unnecessary files - under Meteor > v1.2 #7842

theosp opened this issue Sep 29, 2016 · 6 comments
Labels
confirmed We want to fix or implement it Type:Bug

Comments

@theosp
Copy link
Contributor

theosp commented Sep 29, 2016

Issue posted first on Meteor forum.

I'd like to raise your attention to two key differences in the way isobuild works between v1.2.1 to v1.3.5.1:

  1. Meteor watches packages files that are not referenced by package.js .
  2. Meteor build plugins build files not referenced by package.js .
    These two differences caused me some issues when upgrading to v1.3.5.1 (before upgrading to v1.4, where the issue exist as well).

I refined an example project that demonstrate the issues.

In the repository, you can find two Meteor projects, one of v1.2.1 and another of v1.3.5.1 (also v1.4.1.1, where the results are similar to v1.3.5.1).

In each of these projects I've installed a package 'example:aaa-compiler' with build plugin that uses the legacy build plugins api (which my legacy code and 3rd party packages that I am using still use) to build files that ends with .aaa , the build process adds to the bundle the js code: "console.log('I should be printed only once!')".

example:aaa-compiler's package.js has only the build plugin, and reference only to the build plugin file.

In the package folder there's a /docs/example-aaa folder with example aaa file.

That example file is symlinked to the app root in both projects.

Running results:

V1.2.1 - Web

1 2 1-web

V1.2.1 - Server

1 2 1-server

V1.3.5.1 - Web

1 3 5 1-web

V1.3.5.1 - Server

1 3 5 1-server

Workaround:

As a workaround, for now, I added .# prefix to the folder that shouldn't be watched. This is a very hacky/not-documented workaround, which make the folders hidden for regular operations which might interfere with the project maintenance.

Questions:

  1. Why packages files that are out of package.js scope are watched? Two issues with that:

a. If I have big documentation folder (think something > 5mb with lots of files) why should it be watched?

b. Maybe this is a cause for increase in build time in > v1.2?

c. I used to have common code residing in packages which I symlinked to the main app, now I can't do that without getting warnings from the builder (since it now watch duplicates).

  1. Is there a reason why these out-of-scope files are built? Test folders and documentation folders under a package folder can't assume they are isolated and out of scope any longer?
  2. Is this a bug or intended behaviour? I couldn't find any serious discussion about this issue, or any place where it's documented.

Thanks,
-Daniel

@lucfranken
Copy link
Contributor

Ah see you posted it here as well next to the forums. Try: #7668

@theosp theosp mentioned this issue Oct 2, 2016
@theosp
Copy link
Contributor Author

theosp commented Oct 2, 2016

A test added in the repository to 1.4.2-beta.7 , same issue.

@theosp
Copy link
Contributor Author

theosp commented Oct 24, 2016

A test added in the repository to 1.4.2-rc3 , same issue.

@theosp
Copy link
Contributor Author

theosp commented Oct 26, 2016

@mitar is it possible that this issue relates to your need for .* files ignoring mentioned here #7668 (comment) or is this another usecase?

@abernix
Copy link
Contributor

abernix commented Nov 21, 2016

From an issue triage standpoint, I haven't investigated this beyond confirming this reproduction however, it's worth pointing out in your reproduction that when you first run it, it actually only prints the message once (reported as app.js):

I should be printed only once!

If you then stop the server and start it again, only then will you start seeing the second message from example_aaa-compiler.js. While I'm fairly sure the duplication is due to the differences you noted, I found this to be confusing in running your reproduction.

@abernix abernix added Type:Bug confirmed We want to fix or implement it labels Nov 21, 2016
@hwillson
Copy link
Contributor

hwillson commented Nov 2, 2017

There have been several file watcher changes made since Meteor 1.4.2. Please try things out with a current version of Meteor (>= 1.6), and post back if you're still having this problem. Closing for now - thanks!

@hwillson hwillson closed this as completed Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed We want to fix or implement it Type:Bug
Projects
None yet
Development

No branches or pull requests

4 participants