-
Notifications
You must be signed in to change notification settings - Fork 641
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
v1.3 contains breaking changes #401
Comments
I don't have strong feelings about the version numbering, but I'll note one other breaking change in 1.3 that would have been useful to list in the release notes: the shift from |
@yoshokatana it shouldn't be looking at the filesystem root, since that's dangerous. We try to only allow including templates from inside the base "view" path. I'll take a look and see if it's a bug or not. @carljm oh, that's a good point. We probably need better docs about this, but that was considering an internal API. The intention was that if you accept a string and return a string, you use the A minor bump can have breaking changes if they are small (most apps should keep working but a few might break), I thought. I'd say @yoshokatana's description might be a big change and did warrant a major change. The |
@jlongster thanks for taking a look! :-) |
@jlongster if you're trying to follow the semver standard, all bc breaks require a new major version. Minor versions can introduce new features but can't change existing APIs (unless via optionally setting a flag to turn on the new behavior, etc). This is a very strict standard which we are nowhere near ready to follow ourselves with Apostrophe, but FYI. |
When I say "can't change existing APIs," that's slightly too strict - you could introduce new properties to an options object, or add an additional non-required parameter to the end of a method, etc. But changing the behavior of the "public API" in a way that causes existing code to fail isn't supposed to be cool under semver. See the underscore kerfluffle: |
@SamyPesse can you take a look at the first issue? I see why it happens in the code, and I think we should make it work for now. We can remove the hack later. I can't figure out where the best place is it make it work. We should be able to see if a template name starts with @yoshokatana any reason why you use it? that just happened to work before, but it should work exactly the same with the forward |
@boutell ah I may have misunderstand that a little bit. I'll keep that in mind for the future, thanks! |
@jlongster I don't think |
@jlongster I think it was just a shorthand for [view path] + '/path/to/template'. We're changing those to be less ambiguous, but it sorta threw us for a loop when we In the new logic, [view path] + './path/to/template' would work, correct? |
@yoshokatana if you include a template with |
@carljm sorry for letting this go for a bit, do you think we should add a getter for |
@jlongster I dunno how much value there is in doing that now - it certainly wouldn't make any difference to me, since I've already updated the affected code. I think it's more relevant to agree that user filters do need to access that value, so its location should be documented and covered by backwards compatibility in the future. |
Yup, I agree with @carljm |
ok I documented the autoescape property: 6469c4d I think we're done here, as the breaking change was really just unspecified before |
Calling
include
on an absolute path (e.g./path/to/tpl.nunjucks
) works in v1.2, but not in v1.3. In v1.2 it builds the path from the web root (or possibly cwd?), whereas in v1.3 (because of the relative paths) I think it's looking at the filesystem root. This is a good and reasonable change (and relative paths are incredibly useful), but it's a breaking change and probably shouldn't be a minor release.The text was updated successfully, but these errors were encountered: