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
Rename Symbol and PlacedSymbol to something else, now that it clashes? #770
Comments
@puckey what do you think? |
Symbol
and PlacedSymbol
to something else, now that it clashes?
How about: |
Just an idea, because a symbol wraps an item: ItemSymbol / PlacedItemSymbol |
Or maybe: Or (hopefully my last suggestion): |
@iconexperience the first are quite long... And I think we should refrain from abbreviations in class names. @puckey: the funny thing about
Maybe we should just call it Some more to consider:
J |
Maybe MetaItem and MetaItemInstance or MetaInstance Keeping Symbol in the name provides some continuity with the previous implementation but also some overloading of ES6 Symbol(). |
I don't think it's important to keep the reference to Symbol necessarily. We can announce the change in the change-log : )
And an |
All fair concerns. I'm trying to widen the options as nothing really seems to resonate with all. TemplateItem and TemplateInstance? |
Is |
|
I'm thinking from the end-user perspective, so it seems like a TemplateItem to me. I guess some of it depends on whether the naming is for the developers or the end-users. Clip makes me think of ClipArt or Video Clips. It ultimately can work, but it doesn't bring its purpose to mind when I read it. |
But a template is something you start with and change, while clip art is something you cut and paste... I think that's more like it, actually? The problem with In Flash, i tused to be called a In SVG they are wrapped by a |
When I said end-user I meant as a developer-end-user of the library. The web browser end-user won't see any of this. I see it as more of a template or a prototype - it's not actually cut and pasted, it's instantiated with specific positions. (At least that's how I have viewed them as a user of the library.) It also seems to me like a shared library, like a .DLL or a .SO file. I have no experience whatsoever with Flash, so if that is a major concern I can't weigh in at all. I think the SVG SharedItem and SharedInstance?
|
I think I've added about all I can. Whatever you decide will go in the change log :) |
Does this help from https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol ? "The symbol element is used to define graphical template objects "
|
I think I like |
The sketch parser already warns that I should not use Symbol() as a constructor. |
@iconexperience I also think that's the best so far, and the closest to what we currently have. @bmacnaughton oh wow, I wasn't aware of it, but you're right! |
So here's the decision after a Skype session with @puckey about this:
→ var path = new Path.Circle({
center: [0, 0],
radius: 100,
strokeColor: 'red'
});
var symbolItem = new SymbolDefinition(path).place([100, 00]);
var symbolDefintion = project.symbols[0];
console.log(symbolDefintion.item === path); // true Sounds good? |
Sounds very good to me. |
We were considering this, but it's just oh so very long: var symbolDefintion = project.symbolDefinitions[0]; |
Not much longer than |
Hahaha true! Is that too long, too? |
I see all the logic behind that and it will be easier to learn, but of course I have gotten used to the old, shorter names. I did not even know until recently that t means curvetime. If I had to choose, I would probably use |
And |
(BTW, this is the wrong place for that discussion) |
I have answer this at #563 (comment) |
I am thinking of also removing But I think it's wrong if our API tries to address this use case. What we could do instead is offer the And SVGImport would require a way to give access to the dictionary on import, which holds these definitions. This could be added to the onLoad callback as a second argument, for example. @puckey, @iconexperience: what do you think about this suggestion? |
One more thing: The current But is this then confusing? var path = new Path.Circle({
center: [0, 0],
radius: 100,
strokeColor: 'red'
});
var symbolDefinition = new SymbolDefinition(path);
var symbolItem = symbolDefinition.place([100, 00]);
console.log(symbolItem.definition == symbolDefintion); // true
console.log(symbolDefintion.item == path); // true, as it points to the actual definition
console.log(symbolDefintion.item != symbolItem); // true, because it's not pointing to placed items |
Reason:
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Symbol
Possible new names:
Clip
Definition
MovieClip
The text was updated successfully, but these errors were encountered: