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

Allow sharing a student file by URL #2239

Open
hawkrives opened this issue Jul 23, 2018 · 1 comment
Open

Allow sharing a student file by URL #2239

hawkrives opened this issue Jul 23, 2018 · 1 comment

Comments

@hawkrives
Copy link
Owner

hawkrives commented Jul 23, 2018

This came out of a bit of discussion in #2225

Prior art

prettier:

prettier.io/playground/#N4Igxg9gdgLgprEAuEAzArlMMCW0AEAEnADYkQDqEATiQCYAUwA5tXHLlM-gLz4A6IABalyggDT5W7eHV74A5IKq06ghZIDOOEghjzUAQxKa4k6AFkI6UwHkAbnGriAvgEp8wflG-58OVAYAQmkOHC43YDYYdGoofCh0MhcAbm9fPz8Aeiz8ABVbABFbJHxC6AV9Gzh8akMoOggAW394tganDN19RJa+C0MYIQA6VHIafAYBoeG6huaGDwAqfABGAFEAagB2N2GYCABlGGpw5kXZuAAHEkMwOAYs-n5h57pNrJxmSUFBN3T4rUOLF4gAeOg4ez4MC3TSaAByhiacB4CmIZEoNHoCnwuBguh4wAABgBNaz4QxsfD2HDaA7UBLoJoAIyc+AAJMBGS0XESXPhLNY7I5qITBdUHE4XAA+AGZfCgzQnaDMaVc0KcZjDTQkHD3Bj4AAMklW+D2BwAqlcrk4AMKGUyLfCbKRsMJcbW6-Wrc0QAAyEAA7naHQ8PC5QVkldQVbLAX4WG7NcMEHRNBQcEMGBI-vgAPwCECF-ClRVXer4JUATwJwGAkHI1FKSn40irChcMokhcjmnLUGl+BcGT8oLgTTj-Bg6qTcDkw58MEj47j8q5DG0ulg-3jmQLgleIBHmVKgiCggXx8jEPs0rSPigLhA4hAECuuGgmmQoEpMcDAAVKQQL8UEMewIBwOhnxAZk6jAABrDhDnLMAzmQE50DMEBwlMagYH-OpmCaQxkCMEwsIAK00AAPAAhODEJgQ4kTgP1wjgUjjFMF9y2oXDkBgwxmRraBoKuU5YAzOghmQAAOY0QHEiBTAoOorgE8S4FwxxoLYABHdAcDYAjDCIkikDI7iQFMJocHQ6hMJfbQuF0ABFdAIHgTjyJfGAhKkmSkAAJl8uodDOW1mmIgSoGgDiX2qPIhJAyy4E7IA

babel:

http://babeljs.io/repl#?babili=false&browsers=&build=&builtIns=false&spec=false&loose=false&code_lz=FAFwngDgpgBACgJwPYQM4wLwwN4F8DcoksAyiAIYixbbAwwCWAdlUwCZRsBKUAxgxAZQWALhioQCZgHMANHRgI-AoSwCSTAGZIxAfjzz6g3gGsZAVQhiSUEAB4JUptIB8hmOQBu5BgBtyAEa-UGIAgggI5GB2cCbSGtpuCqgArgEAtgwgIDJiAUhIweRMwATAwFAAHhBICCAwvP6o6HAMpikQMFWsbOg85LwgAHQAwkjpNUzC9ogoqLIwZJRQLjjJFFSYa_T0zD2cPPyC02IARKfu9EpHqiAJOjBMKb6-lzDGZs6WYlMA7ou2BySGQuAAUAG0ALoASjeXh8_iCIRgULeqQyWRyzjEmnIvlQUAUZVwwCAA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&sourceType=module&lineWrap=true&presets=react%2Cstage-2%2Cstage-3&prettier=false&targets=&version=6.26.0&envVersion=

Babel and Prettier, and Flow, all have online REPLs that allow you to copy/paste a link with the configuration and code that was entered, for easy viewing by other people.

This is facilitated by encoding the state of the playground into query string parameters, so that there's no server-side state needed.

Both Prettier and Babel take it a step further and compress the state with zlib (then base64), so that the query string becomes shorter. We would probably also need to do that.

So, the workflow I'm thinking of:

  • hit Share
  • pick Copy as Link
  • copy the link
  • paste into browser
    • if the ID exists, open that student? or notify? should the existing student be updated?
    • if the ID does not exist, import/persist the new student and open it, handling import errors in the UI
@hawkrives
Copy link
Owner Author

Further thinking on this: I think this would be a URL generated by the Share Student modal, and then you could copy it from there.

Furthermore, I think that it would either:

  1. Import the copied student into the destination browser, or
  2. Display a read-only view of the hashed student, with an option to import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Upcoming
  
To Do
Development

No branches or pull requests

1 participant