RaspberryPiFoundation / editor-ui

Code Editor web component
https://editor-static.raspberrypi.org
Apache License 2.0
37 stars 9 forks source link

Split identifiers into asset and code identifiers #896

Closed sra405 closed 6 months ago

sra405 commented 6 months ago

2. Split identifiers into asset and code identifiers

Assets are loaded by:

Code is loaded by:

This has been done by:

  1. Update editor-ui to allow two identifiers: asset-identifier and code-identifier
  2. Update editor-api to add endpoint for assets only (easy, as above)
  3. Update editor-api to add endpoint for code only (easy)

Draft spike

This has been drafted out in the associated branch which splits out the asset loading from the project loading.

Using Redux devtools we can see the assets from the specified project are available to the user.

For HTML projects, as we can't provide the project type via props, this can be achieved loading a blank HTML project which will in turn set the project type.

You can preview this using these project identifiers:

  <editor-wc
    code_identifier="top-5-emoji-list-step-5" 
    class="c-editor__wc" 
    asset_identifier="anime-expressions"
    output_only
    data-editor-target="editor"
  >

Pros

Considerations

Originally posted by @conorriches in https://github.com/RaspberryPiFoundation/editor-ui/issues/868#issuecomment-1895657837

Notes

create-issue-branch[bot] commented 6 months ago

Branch issues/896-Split_identifiers_into_asset_and_code_identifiers created!