Skip to content
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

Rework #36

Merged
merged 7 commits into from Dec 26, 2020
Merged

Rework #36

merged 7 commits into from Dec 26, 2020

Conversation

hammerhai
Copy link
Contributor

@hammerhai hammerhai commented Dec 21, 2020

What is it?

This PR is to address some of the issues that users have experienced pertaining to 2.1.0.


Review

Deprecations

Multiple functions were deprecated in favor of replacements that are either enhanced or have a new name that better fits the functionality. These will still be rendered (they will not be outlined in red), they will not break your project, but it is suggested you migrate to the new events and functions because some of the old ones may no longer return proper results!

  • ComponentCreated: This was deprecated in favor of the new ComponentBuilt event. It includes 1 extra parameter and gets called at a more accurate time than ComponentCreated could be.
  • GetName: This was deprecated in favor of the new GetComponentMeta function. The key is named "type" from GetComponentMeta, not "name". Projects can continue to use this as the appropriate response will continue to be returned! Take a look here to view an example response.
  • ListDetails: This was deprecated in favor of the new GetComponentMeta, GetEventMeta, GetFunctionMeta, GetPropertyMeta functions. Projects should immediately migrate, this will return an empty string.
  • RandomUUID: This was deprecated in favor of the new GenerateID function. Projects can continue to use this as the appropriate response will continue to be returned!

Behavioral changes of non-deprecations

  • ChangeId: When replacing an ID, it will loop through ALL IDs and replace each one that contains the old ID! Even if the ID you're wanting to replace is "Timmy", but there are IDs like "Timmy-truck". To be clear again, only "Timmy" from "Timmy-truck" will be replaced, the "-truck" part will stay the same!
  • Keys using the Create function: A new format is available, you can now use "%keyName" and it will also be replaced! Both "{keyName}" and "%keyName" will work.
  • LastUsedID: Has reverted back to using v2.0.0s method. If you delete a component with the last used ID, it will stay the same.
  • Thread: Async was replaced in favor of Thread, however it's only available from the Designer. You have 2 choices... "Main" and "UI". "UI" would be asynchronous creation and removal.
  • Remove: Works asynchronously based on thread choice.

New functions

  • GetComponentMeta, GetEventMeta, GetFunctionMeta, GetPropertyMeta: You can find an example of the responses here.
  • GetId: Get a components ID by specifying the component.
  • GenerateID: Generate an ID to use when creating a component.

Internal

  • Comments were removed, you are expected to look at the descriptions of blocks to understand their child functions.

StormiFire added 6 commits December 21, 2020 17:27
Signed-off-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>
Signed-off-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>
Signed-off-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>
Signed-off-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>
Signed-off-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>
Signed-off-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>
Copy link
Owner

@ysfchn ysfchn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found these so far:

versionName = "2.1.1"
description = "Dynamic Components is an extension that creates any component in your App Inventor distribution programmatically, instead of having pre-defined components. Made with &#x2764;&#xfe0f; by Yusuf Cihan.",
category = ComponentCategory.EXTENSION,
helpUrl = "https://github.com/ysfchn/DynamicComponents-AI2/issues",
Copy link
Owner

@ysfchn ysfchn Dec 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to set this to the main repository link then add a link to README to go to the Issues if that's the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem!

Comment on lines 174 to 177
@SimpleEvent(description = "Is called after a schema has finished creating all/most of it's components.")
public void SchemaFinished(YailList parameters, String schema) {
EventDispatcher.dispatchEvent(this, "SchemaFinished", parameters, schema);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how it will be useful to get the full schema after being created, because I think people will prefer comparing the schema names instead of comparing the full schema data.

package com.yusufcihan.DynamicComponents;
package com.yusufcihan.dynamiccomponents;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this won't break anything when upgrading the extension or during compiling the app?

Copy link
Contributor Author

@hammerhai hammerhai Dec 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually have experienced issues with this over the past few days. For me if I had run into issues, I simple reimported the extension again and it was fine, but I did change the package name back to what it was originally for what I'll commit later.

@ysfchn
Copy link
Owner

ysfchn commented Dec 23, 2020

And I personally like having comments because it can be useful for future contributions, and people (including us) can still understand the code after a long time, maybe years 😅

P.S - But I'm okay with it as block descriptions explain what it does.

…nd reverse package name change

Signed-off-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>
Copy link
Owner

@ysfchn ysfchn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I need to do some tests before merging. 😄

@hammerhai
Copy link
Contributor Author

Is your test done yet? Because it's passed December 24th which was the date I promised many people a fix.

@ysfchn ysfchn merged commit 898671f into ysfchn:beta Dec 26, 2020
@ysfchn ysfchn added status: done Implemented already with a commit and removed status: under review labels Dec 26, 2020
ysfchn added a commit that referenced this pull request Dec 26, 2020
* Fix indent to 4 spaces

* Rework (#36)

* Rewrite

Signed-off-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>

* Remove .sh files from root

Signed-off-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>

* Replace old icon.png for README

Signed-off-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>

* Remove .placeholder

Signed-off-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>

* Convert indentations to spaces (2)

Signed-off-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>

* Reword description for GetName

Signed-off-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>

* Change 'helpUrl' to README, reverse deprecation of 'SchemaCreated', and reverse package name change

Signed-off-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>

Co-authored-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>

* Lower the version name due it is not a major release

* Lower the version code because it is bumped twice

* Update docs

* Add information about thread to docs

* Replace badge locations

Co-authored-by: Nathan <43486313+StormiFire@users.noreply.github.com>
Co-authored-by: StormiFire <7520363-StormiFire@users.noreply.gitlab.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: done Implemented already with a commit type: code refactor Code refactor type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants