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

Editor: Changed createObjectUrl to createBlobURL #10135

Merged
merged 2 commits into from Sep 28, 2018

Conversation

Projects
None yet
2 participants
@gziolo
Member

gziolo commented Sep 24, 2018

Follow-up for the work started by @caxco93 in #7734.

Description

Changed createObjectUrl to createBlobURL from the @wordpress/editor package.

How has this been tested?

Included tests and manually

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@gziolo gziolo self-assigned this Sep 24, 2018

@gziolo gziolo requested review from aduth and WordPress/gutenberg-core Sep 24, 2018

@gziolo gziolo added the Code Quality label Sep 24, 2018

@@ -131,7 +132,7 @@ export function mediaUpload( {
// Set temporary URL to create placeholder media file, this is replaced
// with final file from media gallery when upload is `done` below
filesSet.push( { url: window.URL.createObjectURL( mediaFile ) } );
filesSet.push( { url: createBlobURL( mediaFile ) } );

This comment has been minimized.

@jorgefilipecosta

jorgefilipecosta Sep 24, 2018

Member

Each call to createBlobURL should eventually have a revokeBlobURL to make sure the file used by the blob is removed from the memory when not need anymore. In this case, revokeBlobURL should be called as soon as createMediaFromFile finishes with success or fails.

@jorgefilipecosta

jorgefilipecosta Sep 24, 2018

Member

Each call to createBlobURL should eventually have a revokeBlobURL to make sure the file used by the blob is removed from the memory when not need anymore. In this case, revokeBlobURL should be called as soon as createMediaFromFile finishes with success or fails.

This comment has been minimized.

@gziolo

gziolo Sep 24, 2018

Member

Added with 80ebf4a 👍

@gziolo

gziolo Sep 24, 2018

Member

Added with 80ebf4a 👍

@gziolo gziolo added this to the 4.0 milestone Sep 25, 2018

@jorgefilipecosta

jorgefilipecosta approved these changes Sep 26, 2018 edited

I tested with successful uploads and uploads that should fail and in both cases, everything went as expected 👍

@gziolo gziolo merged commit 22534e8 into master Sep 28, 2018

2 checks passed

codecov/project 48.81% (+<.01%) compared to fd9bfa5
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@gziolo gziolo deleted the update/use-create-blob-url branch Sep 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment