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

npm config map is not being set properly #1208

Closed
1 of 5 tasks
BigAB opened this issue Jun 5, 2017 · 3 comments
Closed
1 of 5 tasks

npm config map is not being set properly #1208

BigAB opened this issue Jun 5, 2017 · 3 comments

Comments

@BigAB
Copy link

BigAB commented Jun 5, 2017

How often can you reproduce it?

  • Always
  • Sometimes
  • Rarely
  • Unable
  • I didn’t try

Description:
Steal config map does not seem to be being set properly.

Steps to reproduce:

  1. Include a link to your project (if possible)

Here is a gist you can clone to show the issue.
https://gist.github.com/BigAB/ae311de12272af411969f477e6f8c1a5

preact-compat should be a drop in replacement for react and react-dom and so map should swap them out fine. But in the gist, if you serve it you can see steal is still trying to import react.

The relevant part of the gist is mostly this in `package.json:

  "steal": {
    "map": {
      "react": "preact-compat",
      "react-dom": "preact-compat"
    }
  }
  1. Detail the exact steps taken to produce the problem

Clone the gist. Run npm install. Serve the root. See in the console that react is trying to load and System.map only has @loader/@laoder and @steal/@steal keys.

screen shot 2017-06-05 at 9 45 50 am

  1. Include a gif if applicable

steal-config-map-issue

Expected results:

I expect everything to work, for every call to import React from 'react would return the preact-compat module instead

Actual results:
Steal fails to load react because it isn't there, and the config in npm does not even appear to be merged into System.map

Environment:

Software Version
Steal version 1.5.2
Steal-tools version 1.3.5
node -v v8.0.0
npm -v 5.0.2
Browser Chrome 58.0.3029.110
Operating system macOS Sierra 10.12.5
@BigAB BigAB added the bug label Jun 5, 2017
@matthewp matthewp self-assigned this Jun 6, 2017
@matthewp
Copy link
Member

matthewp commented Jun 6, 2017

This is caused by progressive fetching of package.jsons. The problem is that the left-hand side is not an npm module, so the code that is supposed to load preact-compat is never triggered. I suppose the fix is that we should fetch the right-hand side packages right away and not wait, if the left-hand side isn't npm. Going to look into what this would take to fix.

@matthewp
Copy link
Member

matthewp commented Jun 6, 2017

Blocked by #1210

matthewp added a commit that referenced this issue Jun 6, 2017
This restructions the npm normalize tests, putting the different
QUnit.modules into their own test files to make it easier to add new
tests.

Also adds a breaking test for #1208
@matthewp
Copy link
Member

matthewp commented Jun 6, 2017

Breaking test added in ff9c28d

matthewp added a commit that referenced this issue Jun 12, 2017
This restructions the npm normalize tests, putting the different
QUnit.modules into their own test files to make it easier to add new
tests.

Also adds a breaking test for #1208
@matthewp matthewp removed their assignment Aug 14, 2017
m-mujica pushed a commit that referenced this issue Sep 18, 2017
This restructions the npm normalize tests, putting the different
QUnit.modules into their own test files to make it easier to add new
tests.

Also adds a breaking test for #1208
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants