Giter Site home page Giter Site logo

Comments (13)

girba avatar girba commented on June 18, 2024 2

Nice conversation!

from bloc.

syrel avatar syrel commented on June 18, 2024

Since one of the first versions of Bloc it is forbidden to copy visual elements.
Unfortunately, #copy and #deepCopy methods got lost at some point.
I restored them with a method comment in #copy that describes that decision :)

Thanks for the reminding! 👍

from bloc.

dionisiydk avatar dionisiydk commented on June 18, 2024

from bloc.

syrel avatar syrel commented on June 18, 2024

It will not :)
We don't see a point in #duplicate for a real world apps. How often do users duplicate UI elements?
Supporting copying in all widgets and visualisations is somehow too much for a fancy demo-only feature.

I am looking forward to learn arguments why #duplicate is so important 😉

from bloc.

syrel avatar syrel commented on June 18, 2024

Talking about halos. We are not sure if they will exist in their current form.

from bloc.

StephanEggermont avatar StephanEggermont commented on June 18, 2024

As a developer, I see use in #duplicate. It provides an excellent direct way of building applications. For end users it definitely makes sense to be able to clone visual representations of actions. I understand that it is difficult to get the context-dependent semantics right

from bloc.

syrel avatar syrel commented on June 18, 2024

Aha, interesting input, @StephanEggermont 👍 Thanks!

Here is what I wrote as method comment in #copy:

"Visual elements can not be copied.
	The reason for that is unpredictable amount of conflicting copying behaviours.
	For example, what should happen if a copied element is added to the parent?
	Should we create a new element without the parent or add a copied one to the parent of
	the original element? What should we do with View Models? How to deal with event handlers? ...
	
	Thus, we decided that the most consistent behaviour is to forbid all kind of copying
	and let users instantiate elements by themselves in the way they want it"

The problem with copy is that it is difficult to maintain it... Let's come back to it later when there is nothing else to do 😉

from bloc.

dionisiydk avatar dionisiydk commented on June 18, 2024

from bloc.

dionisiydk avatar dionisiydk commented on June 18, 2024

from bloc.

syrel avatar syrel commented on June 18, 2024

@dionisiydk I see. So the use case is prototyping. Very interesting 🤔
We will need to think if #copy fits there. I like the final goal!

Does it mean that if I will call #copy on element I will got error?

Yes, self shouldNotImplement

from bloc.

dionisiydk avatar dionisiydk commented on June 18, 2024

from bloc.

dionisiydk avatar dionisiydk commented on June 18, 2024

from bloc.

girba avatar girba commented on June 18, 2024

Currently, we see the issue of copying elements as being tightly related to the one of serializing elements. Thus, we will come back to this after we figure out the larger problem. In the meantime, we close the issue.

from bloc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.