-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add compatibility addon for shape drawing #1
Comments
Hi @davepagurek! I'm not sure if we discussed keeping vs. removing the old Since the purpose of the new API is to make the vertex functions easier to understand, I'm thinking that a reference page documenting both the old and new syntax would be problematic. Were you thinking we'd link to the 1.x reference page for people who want to continue to use the old syntax? Using documentation for an old version to document a feature that's still in the current version feels like it could cause problems down the line. Also, we're already removing I do understand the desire to reduce breaking changes as much as we can, but I'm not sure if it makes sense here. I'm open to discussing it more. What do you think? I've been going through updates that'll need to be made to the reference, so I thought it'd be good to ask now rather than later. |
I think that's a pretty good reason to move the old |
We actually already handle the old syntax in the shapes addon here, so all we'd need to do is remove it from p5.js-compatibility/src/shapes.js Lines 25 to 42 in 4b6108c
|
I've not been following the vertex implementation very closely and I'm a bit confused about a few things. From what is currently in dev-2.0 branch, For older Also I'd like to prevent any additional breaking changes if at all possible at the beta stage since I will be opening issues with other addon libraries about updating their library, if the API is still unstable it would be difficult to accurately gauge breakage with them. If there are things that still need to be removed from dev-2.0 do complete them sooner rather than later so that I can do another beta release. |
This approach also makes sense, although currently it's a little difficult on a technical level to put a deprecation note next to a specific overload in the list of overloads at the bottom -- it would currently have to be mentioned in the body of the description. I think it's possible within JSDoc, since each overload is like its own doc comment, but we don't handle it yet in the schema on the website repo, so I could update our doc generating script in this repo + edit the website source code to handle per-overload deprecations if we want to go this route. |
Yes, description for any deprecation note is fine for now. |
Thanks @limzykenneth for pointing this out! I'll share some context and updates. Deprecation vs. compatibility add-onCommunity feedbackWe offered two options in the discussion for the new vertex API:
We never made a final decision. However, as Dave noted in the linked comment, we did some research into the impact of removing the old API, and we found it would be minimal. When we looked at OpenProcessing and The Nature of Code, for example, "We found very little use of the changed methods compared to single standalone curves like bezier()" (quoting Dave here). In fact, not a single example in Nature of Code would be affected. This may be partly because these are relatively advanced features, partly because of the complexity of the legacy API, and partly because the vertex versions did not allow Bézier curves to be mixed with other curve types. We also reached out to multiple library authors regarding the new API, as well as the advisory committee. We received responses in all cases (1, 2, 3). None included a request for the old API to be kept in 2.0 itself. On the other hand, there was a comment indicating support for using a compatibility add-on. Based on all this, I think it would be okay to go with the compatibility add-on rather than deprecation (unless feedback from the Google Form survey provides new information). AnalysisFor what it's worth, my own thoughts on the matter are as follows. The purpose of the new API is to make the vertex functions easier to understand, and keeping the old API in 2.0 would partly defeat that purpose.
On the other hand, if we use the compatibility add-on, the change will likely impact a very small number of users. All public feedback so far indicates this group is okay with removal, and they'll be able to use a compatibility add-on if they want to keep using the old API. This may be less confusing, since the compatibility add-on could direct them to the website for 1.x, where the legacy API is documented in full, without being mixed with 2.0 features. Vertex implementation cleanupA cleanup phase is still planned for the custom-shape refactor, including the removal of the Vertex submodule (vertex.js), in favor of the Custom Shapes submodule (custom_shapes.js). Right now, the vertex functions are split across these two files, which I think would result in two separate sections appearing in the website's reference pages. There are functions in Vertex that we're keeping, so as part of the documentation updates, I can move those over to Custom Shapes before removing Vertex. |
I'm fine with removing the legacy API in 2.0 and reimplementing it in the compatibility addon. The main thing is that the legacy API is still in the 2.0 betas and people are testing against it (both sketches and addons) so if they are to be removed, I would like it to be done as soon as possible so we don't create false impression on what to expect in this part of 2.0. It would also be removing the reference of the removed legacy API so that it is clearer on your documentation project that this part don't need updates. |
If we're ok taking it out then I can remove that |
By the way, did you consider
|
Good catch, I added those to the to do list in the issue! I'll make an update soon. |
Ok added those in #7. I'm going to close this issue for now and we can make new ones if we find new things to handle |
Hi Dave! Not sure if you'd want to start a new issue, but I though maybe we could reopen this one, to address some other breaking changes we made. It's possible that, like the removal of the old syntax for Removal of
|
Thanks @GregStanton!
|
Hi @davepagurek! Thanks for your quick reply! Before I forget, here's another issue that's left over from our previous discussions: New Bézier closing behaviorThis is an issue we discussed, but I don't think we ever totally settled on it. Here's a summary of our discussion:
This would be pretty easy to implement, I think. We also discussed trying to get a smoothly closed curve, but there were some subtleties with that, and I'm not certain if it's necessarily better? I'm not sure if I have a record of that conversation. We could potentially flesh that out again, though. |
Now I'll reply to your comments :) Quick points
|
Just made two PRs (links shown above this comment on Github):
For shapes/detail: I definitely think this is really promising! I'm a little hesitant only because we'll have less time for community feedback and testing for bugs/performance, given also that there are other things that have to get done too. There are also a few details to iron out, e.g.: But also I believe this is true:
That might justify allowing a breaking change in a minor version, if the benefit is high, the current implementation is not fully functional everywhere, and the change doesn't affect much? Another way to reduce the affected sketches even further is to only use |
quadraticVertex
bezierVertex
(already done -- we were able to make the old syntax available in 2.0.)curveVertex
(alias tosplineVertex
)curveTightness
endContour()
with no args toCLOSE
endShape(CLOSE)
whencurveVertex()
is usedThe text was updated successfully, but these errors were encountered: