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

Optional param dependencyBaseUrl (inlineView and noVIew) is never honoured #605

Open
3cp opened this issue Mar 19, 2018 · 1 comment
Open

Comments

@3cp
Copy link
Member

3cp commented Mar 19, 2018

I'm submitting a bug report

  • Library Version:
    1.7.0

  • JSPM OR Webpack AND Version
    All

Current behavior:
aurelia/webpack-plugin#140

Take noView as example,

  1. @noView(['a.css'], 'base/url');, this looks unnecessary, but should be supported.
  2. @noView(['a.css'], 'http://cdn.com/path'), this looks like the designed usage.

But right now, the optional baseUrl is never honoured, due to the line

this.entry = entry = new TemplateRegistryEntry(this.moduleId || this.dependencyBaseUrl);

moduleId is always present, so dependencyBaseUrl is never used.

Expected/desired behavior:
Since this api feature is never used by anyone, (because it never worked), we have option to

  1. remove optional dependencyBaseUrl param. It is practically not breaking change.
  2. fix the line to
this.entry = entry = new TemplateRegistryEntry(this.dependencyBaseUrl || this.moduleId);

Update, two duplicated lines. Need to update both line 144 and line 237.

But option2 has limitation. If baseUrl is full url (http...), webpack app doesn't support it.

  • What is the expected behavior?

  • What is the motivation / use case for changing the behavior?

@3cp
Copy link
Member Author

3cp commented Mar 23, 2018

Since cli+requirejs uses stub on "text" module, by default, those apps doesn't support @noView(['a.css'], 'http://cdn.com/path') too. That can be easy fixed by not using stub.

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