Port to snap




  • administrators

    Nope! However, I have a few suggestions:

    • I would make a custom block for RPCs to minimize the amount of JS that needs to be copied into each of the custom blocks. This would make it easier to add support for other RPCs (though some will have issues as outlined below).
    • Hardcoding the project ID, uuid in the HTTP request is going to have some issues if you try to use a service that maintains some data based on the project (such as TicTacToe or Battleship).
    • Implementing async JS in the JS blocks is tricky. The challenging part is to make sure that the block doesn't finish until the promise has resolved. For more info, check out https://github.com/NetsBlox/NetsBlox/issues/3452
    • Another tricky thing is async + shared state. Specifically, setting window.sync = true will be problematic when making multiple async requests at once since sync will be overwritten by the last call.

    Happy Coding!



  • @brian said in Port to snap:

    Nope! However, I have a few suggestions:

    • I would make a custom block for RPCs to minimize the amount of JS that needs to be copied into each of the custom blocks. This would make it easier to add support for other RPCs (though some will have issues as outlined below).
    • Hardcoding the project ID, uuid in the HTTP request is going to have some issues if you try to use a service that maintains some data based on the project (such as TicTacToe or Battleship).
    • Implementing async JS in the JS blocks is tricky. The challenging part is to make sure that the block doesn't finish until the promise has resolved. For more info, check out https://github.com/NetsBlox/NetsBlox/issues/3452
    • Another tricky thing is async + shared state. Specifically, setting window.sync = true will be problematic when making multiple async requests at once since sync will be overwritten by the last call.

    Happy Coding!

    Thanks!

    @brian said in Port to snap:

    • Implementing async JS in the JS blocks is tricky. The challenging part is to make sure that the block doesn't finish until the promise has resolved. For more info, check out https://github.com/NetsBlox/NetsBlox/issues/3452
    • Another tricky thing is async + shared state. Specifically, setting window.sync = true will be problematic when making multiple async requests at once since sync will be overwritten by the last call.

    Yeah its a lot confusing!I had to learn the whole branch of promises to do that!XMLHTTPREQUEST JUST DID NOT WORK!!!!!!!!!!!!!!!!!
    (im a cloud variable ensuthiast that always reies to induce cloud vars into snap while not finding any practical uses for it XD )



  • This post is deleted!


  • This post is deleted!


  • With some help over the internet,I did it!
    well it was actually the snap guy(or the jounce guy) that did it
    i was still struggling on promises untill i found out that ur code does not include the actuall fetch and i should not pass a callback to it
    https://snap.berkeley.edu/snap/snap.html#present:Username=18001767679&ProjectName=netbloxx