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

Move internal dynamic categories to use JSON #5580

Closed
BeksOmega opened this issue Oct 3, 2021 · 21 comments
Closed

Move internal dynamic categories to use JSON #5580

BeksOmega opened this issue Oct 3, 2021 · 21 comments
Labels
help wanted External contributions actively solicited size: small Bugs that can be picked up and completed in 1-3 days
Milestone

Comments

@BeksOmega
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

The XML serializaation system is being iceboxed, so internal usages of the XML system should be moved to the new JSON system.

In particular, dynamic categories which are internal to Blockly should be changed to use JSON

Describe the solution you'd like

Describe alternatives you've considered

N/A

Additional context

Note that currently we suport dynamic categories being defined in JSON or XML, but it's good to move the internal definitions to JSON.

@BeksOmega BeksOmega added issue: feature request Describes a new feature and why it should be added issue: triage Issues awaiting triage by a Blockly team member labels Oct 3, 2021
@maribethb maribethb removed the issue: triage Issues awaiting triage by a Blockly team member label Oct 15, 2021
@rachel-fenichel rachel-fenichel added this to the Feature Fest milestone Oct 12, 2022
@BeksOmega BeksOmega added ghc-osd Reserved for open source day: https://anitab-org.github.io/open-source-day/ and removed rrf-internal labels Sep 22, 2023
@bhsingla
Copy link

Hi team, I would love to work on this. Thanks

@rachel-fenichel
Copy link
Collaborator

Hi @bhsingla! This is being worked on in the blockly-badger breakout room.

@coolcoder03
Copy link

how can i work on this?

@BeksOmega BeksOmega moved this to Ready for Work in Blockly GHC OSD Sep 29, 2023
@BeksOmega BeksOmega added good first issue and removed ghc-osd Reserved for open source day: https://anitab-org.github.io/open-source-day/ labels Oct 11, 2023
@Apoorvgarg-creator
Copy link
Contributor

Apoorvgarg-creator commented Nov 2, 2023

Is this issue still available ? @BeksOmega

@BeksOmega
Copy link
Collaborator Author

Yep go for it @Apoorvgarg-creator !

@Apoorvgarg-creator
Copy link
Contributor

@BeksOmega Thanks for Assigning it to me, Since it's a feature request and I am new to blockly, I would appreciate if you could give me a brief on how to get started with the feature ! What all should I know and how to test my features.
Thanks once again !

@BeksOmega BeksOmega removed the issue: feature request Describes a new feature and why it should be added label Nov 3, 2023
@BeksOmega
Copy link
Collaborator Author

@BeksOmega Thanks for Assigning it to me, Since it's a feature request and I am new to blockly, I would appreciate if you could give me a brief on how to get started with the feature ! What all should I know and how to test my features. Thanks once again !

Oh whoops, this shouldn't have been marked as a feature request!

The issue is to convert toolboxes categories which are currently defined using XML to use JSON. You can see here how XML is being constructed for the variable category. You should refactor the flyoutCategoryBlocks function to construct a JSON toolbox instead.

We want to switch all three functions linked in the original issue to use JSON. You can do that all at once, or you can submit PRs for each individual function. Whatever works better for you!

Let me know if you have any further questions =)

@Apoorvgarg-creator
Copy link
Contributor

@BeksOmega Thank you for the help !

@BeksOmega
Copy link
Collaborator Author

@Apoorvgarg-creator are you still interested in working on this?

@Apoorvgarg-creator
Copy link
Contributor

@BeksOmega Yes, I took a little break. Sorry for the inconvenience.

@BeksOmega
Copy link
Collaborator Author

@BeksOmega Yes, I took a little break. Sorry for the inconvenience.

You're good no rush! I was just going through the active issues and seeng if there were any I could mark as available again :P Thanks for your interest in this!

@Apoorvgarg-creator
Copy link
Contributor

@BeksOmega, do we have to add unit test cases for this issue ?

@BeksOmega
Copy link
Collaborator Author

@BeksOmega, do we have to add unit test cases for this issue ?

It would be great to add unit tests for this if you have time =) But otherwise that can be split off into a separate issue!

@Apoorvgarg-creator
Copy link
Contributor

@BeksOmega, I saw you created common functions to createElement in Xml in a file xml.ts. Should I Use the same approach for creating in JSON ?

@BeksOmega
Copy link
Collaborator Author

@BeksOmega, I saw you created common functions to createElement in Xml in a file xml.ts. Should I Use the same approach for creating in JSON ?

You should just be able to return plain old object literals! so no helpers necessary for JSON.

@Apoorvgarg-creator
Copy link
Contributor

@BeksOmega Thank you for the help !
I Want to know how Can I test after making my changes, I know a little silly question to ask ! Sorry !

@BeksOmega
Copy link
Collaborator Author

@BeksOmega Thank you for the help ! I Want to know how Can I test after making my changes, I know a little silly question to ask ! Sorry !

To manually test the variables you can open up the variable category, click the "create variable" button, and test that a variable block properly shows up in the flyout.

To manually test the procedures you can open up the function category, drag out a function definition block, and then reopen the procedure category and test that the procedure caller block properly shows up in the flyout.

@Apoorvgarg-creator
Copy link
Contributor

@BeksOmega Thank you

@Apoorvgarg-creator
Copy link
Contributor

interface BlockInfo {
  kind: string;
  blockxml?: string | Node;
  type?: string;
  gap?: string | number;
  disabled?: string | boolean;
  enabled?: boolean;
  id?: string;
  x?: number;
  y?: number;
  collapsed?: boolean;
  inline?: boolean;
  data?: string;
  extraState?: AnyDuringMigration;
  icons?: {[key: string]: AnyDuringMigration};
  fields?: {[key: string]: AnyDuringMigration};
  inputs?: {[key: string]: ConnectionState};
  next?: ConnectionState;
}

How to set variable name in JSON structure

@Apoorvgarg-creator
Copy link
Contributor

@BeksOmega, I solved it for variables and dynamic variables, Can you please once check the PR, I am not sure how to proceed for procedures.

@AbhinavKRN
Copy link
Contributor

@BeksOmega is this issue available?

@BeksOmega BeksOmega added help wanted External contributions actively solicited size: small Bugs that can be picked up and completed in 1-3 days and removed good first issue labels Aug 13, 2024
@gonfunko gonfunko closed this as completed Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted External contributions actively solicited size: small Bugs that can be picked up and completed in 1-3 days
Projects
No open projects
Status: Ready for Work
Development

Successfully merging a pull request may close this issue.

8 participants