Optional param dependencyBaseUrl (inlineView and noVIew) is never honoured
- Dominant language
- TypeScript
- Stars
- 113
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
**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
https://github.com/aurelia/templating/blob/5fe7e46b112519af28726ac46444274f7605a7d9/src/view-strategy.js#L144
`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
```javascript
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?**
Contributor guide
Research direction
Start in src/view-strategy.js at the two duplicated lines identified around 144 and 237, and trace how noView and inlineView construct their TemplateRegistryEntry. Verify the behavior for a relative dependencyBaseUrl and a full URL, then confirm that the chosen fix matches the webpack limitation and that both strategies honor the documented parameter.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, webpack
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100