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

Proper import chain for Meteor packages to app #6931

Merged
merged 1 commit into from
May 29, 2016

Conversation

gadicc
Copy link
Contributor

@gadicc gadicc commented Apr 28, 2016

Addresses #6907.

@benjamn, this is what I had in mind and solves the issue for me. Pending any comments from you I'll play with it for a few more days then add some tests to the PR and rebase.

gadicc added a commit to gadicc/meteor-hmr that referenced this pull request Apr 28, 2016
#57)

* move stuff from hot to modules-runtime-hot to run sooner
* clean up duplicate methods between these two packages
* don't try resolve moduleIds when adding to modulesRequiringMe
  rather do this lazily and try match with different patterns

requires meteor/meteor#6931.

let mainModule = _.find(info.files, file => file.mainModule);
mainModule = mainModule ?
`meteor/${name}/${mainModule.targetPath}` : false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can just be mainModule.installPath, I think, since that includes meteor/${name}/ prefix already.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick look! installPath isn't available yet, since currently the code runs just before the import-scanner. Would you prefer to move it to after? The import scanner takes the existing map as input, so not sure if any side effects here, or on mutating the generated scannerMap.

I did a quick test and started getting "Can't find npm module" errors for e.g. 'meteor/underscore', but I might have rushed too much. Also installPath is like node_modules/meteor/... so would need to either strip the node_modules/ or prefix with /.

@gadicc
Copy link
Contributor Author

gadicc commented May 5, 2016

Hope the tests are ok. Happy to rename the two new packages (in tests/apps/package-tests) or test for other things, per your guidance.

gadicc added a commit to gadicc/meteor-babelrc that referenced this pull request May 24, 2016
…g (#57)

* move stuff from hot to modules-runtime-hot to run sooner
* clean up duplicate methods between these two packages
* don't try resolve moduleIds when adding to modulesRequiringMe
  rather do this lazily and try match with different patterns

requires meteor/meteor#6931.
gadicc added a commit to gadicc/meteor-babelrc that referenced this pull request May 24, 2016
…g (#57)

* move stuff from hot to modules-runtime-hot to run sooner
* clean up duplicate methods between these two packages
* don't try resolve moduleIds when adding to modulesRequiringMe
  rather do this lazily and try match with different patterns

requires meteor/meteor#6931.
@gadicc gadicc changed the title [WIP] Proper import chain for Meteor packages to app Proper import chain for Meteor packages to app May 28, 2016
@gadicc
Copy link
Contributor Author

gadicc commented May 28, 2016

@benjamn, this would be appropriate for 1.3.3 I think, yeah?

In light of my earlier comments, I think better to leave the code as is.

Re failing tests, they're not mine:

C: tinytest - livedata stub - reconnect non-idempotent method : !!!!!!!!! FAIL !!!!!!!!!!!
selftest:  - package-tests: change packages during hot code push

Unfortunately that last test breaks the CI process, but locally, my test passes.

It's possible to squash directly via github merge now, but happy to rebase if you prefer (I guess that would trigger a new CI run, iirc you and others have made the CI testing more stable recently).

@abernix
Copy link
Contributor

abernix commented May 28, 2016

@gadicc Please rebase. While 2-3 reruns of the old (flakier) tests would probably go through, a rebase will almost certainly work the first time and will trigger the build.

Don't include the ", false" for install() on traditional packages

add tests
@gadicc gadicc force-pushed the package-mainModule-import branch from 91045d7 to dfee727 Compare May 28, 2016 18:31
@gadicc
Copy link
Contributor Author

gadicc commented May 28, 2016

@abernix, done; tests passing :D definitely big improvements in testing... and this community issue management is a game changer! thanks!

@benjamn benjamn merged commit 38a119f into meteor:devel May 29, 2016
@gadicc
Copy link
Contributor Author

gadicc commented Jun 1, 2016

Awesome, thanks @benjamn for getting this in 1.3.3!
cc: @clayne11, think it will help with your current project.

@clayne11
Copy link

clayne11 commented Jun 1, 2016

Yes that's amazing! Great work 👍

@gadicc gadicc deleted the package-mainModule-import branch June 2, 2016 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants