-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
angular2.dev.js contains incorrect SystemJS config #3826
Comments
I agree with @IgorMinar - I don't see any reason for this config after migration to a newer SystemJS. More generally, I don't think we should be in business in providing System config. Going to send Pr to remove this. |
Just a quick question, using the new version of SystemJS shouldn't all modules be registered with the JS extension? Example: Before (system ~0.16)
After (system ~0.18)
|
@jpsfs while it is true that never systemjs moves to URLs as module modifiers it doesn't matter much in a bundled version since everything is pre-loaded and no HTTP / Ajax request should be done at runtime for ng2-specific resources. We could register things with .js extension but this would be non-trivial (?) with out current setup in the repo where imports are shared between *.ts and *.dart files. |
I added that line, as the original goal of the bundle was to make getting off the ground as quick and painless as possible. That allowed for demoes to have zero So why not replace it with the 0.18 version |
@rkirov I see your point about trying to make it easier on users. The pb I can see with this approach is that we are enforcing config that impacts all dependencies / everything that goes through SystemJS. So I'm afraid that it might mess up things for more experienced SystemJs users. I'm not against adding |
the thing is that the bundle should be usable even without systemjs and in that case the config doesn't do anything. I approved the PR to remove this. If this causes more friction elsewhere we need to find a different solution. |
@pkozlowski-opensource I'm not an expert on SystemJS, please correct me if I'm wrong, but if the modules are not registered with ".js", then using defaultJsExtension: true, SystemJS will try to look for the modules with the extension and will not find them. Actually,I think this is not happening right now because of
When you remove it, the problem I just describe will appear. Example:
will trigger a search for "angular2/src/di/metadata.js" (because of the defaultJsExtension: true flag) and that will not be registered. (if you don't use the "":".js" config) My vote would be to generate the bundle with the .js extension on the register. Something like:
|
@jpsfs I don't think it works like this. SystemJS will first consult its internal registry to see if a dependency is there. Only if a dependency is not registered SystemJS will try to fetch it and this is where Did you run into actual problems somewhere? If so, could you share a plunk demonstrating those? |
@pkozlowski-opensource yes, you are right. But the fact is that a dependency named "angular2/src/di/metadata.js" is not registered, only "angular2/src/di/metadata" is. I will try to reproduce this is in a plunk asap. |
@IgorMinar sounds good, lets revisit if we end up having to remind people to set |
I think that using defaultJsExtensions is now discouraged. I'm looking into On Thu, Aug 27, 2015 at 10:47 AM Rado Kirov notifications@github.com
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
At the end of the file we have:
I'm not sure how we ended up with the
"*":"*.js"
mapping, but we shouldn't be configuring paths not belonging exclusively to Angular.This is especially confusing as of a SystemJS 0.17 when
defaultJSExtension
was flipped to false.The text was updated successfully, but these errors were encountered: