React-sketchapp: Throw error on non-https images

Created on 25 Apr 2017  路  8Comments  路  Source: airbnb/react-sketchapp

Fun fact - you can only load images over https in Sketch!

We should throw an error if you try to load an image over http.

bug technical

All 8 comments

Hey @jongold I would love to work on this! Can you give me more info to start so I can start working on it? Thank you in advance for creating such tool!!

Here's where we're extracting the URL from props and instantiating MSImageData from it

This is the function that actually makes the image data.

I think it might be enough to just shortcircuit that function if the URL doesn't start with https:// or file:// (or maybe better to shortcircuit if it _does_ start with http://). check it doesn't break anything else!

development workflow -

  • make a branch, install the dependencies, check npm run check is working
  • npm link
  • npm run watch to build the library
  • cd into one of the examples (or any react-sketchapp project itself), npm install and then npm link react-sketchapp
  • make changes, try to break it! testing is kinda brittle due to the nature of it being built upon Sketch!
  • if you change any of the examples, please don't commit them!

Thanks @jongold I will keep you updated on that one. Oh, it didn't start well. Any idea what is happening here?
screen shot 2017-04-28 at 02 37 13

looks like you're not in the right directory?

@jongold Yup you were right! but after that I got another error... Weird:
screen shot 2017-04-29 at 01 53 55

Nvm, I just fixed it! I had to 'npm update' when I was inside that directory!

Ok my progress so far @jongold:

  • [x] Make a branch & install dependencies & check npm run check
  • [x] npm link
  • [x] npm run watch
  • [x] cd into one of the examples (or any react-sketchapp project itself), npm install and then npm link react-sketchapp
  • [ ] make changes, try to break it! testing is kinda brittle due to the nature of it being built upon Sketch!
  • [ ] if you change any of the examples, please don't commit them!

P.s I had some problems with npm and stuff but I fixed them by now. That's what caused the delay.

This is fixed in #111 / 0.11.1 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaridmargolin picture jaridmargolin  路  6Comments

LincMitch picture LincMitch  路  7Comments

varya picture varya  路  5Comments

kirill-konshin picture kirill-konshin  路  7Comments

apexskier picture apexskier  路  3Comments