Closed joscha closed 6 years ago
~assets are now under static/$SHA.js
instead of the preview part~ (edit: that was incorrect, the preview is still there, just the order different, see below) - what is the reason we read them from iframe.html
instead of using the output dir as the truth @timhaines ?
Hi @joscha. Thanks for mentioning this.
I've just tried updating our integration tests to 3.3.3 this morning, and still get a file called preview.144ff5a30b19d92931f3.bundle.js
. Could you send me a gist (privately if you prefer) of your iframe.html
please?
I think something in your config may be cause the $SHA.js file name variation. Do you know what that may be?
I'm on vacation on Friday, so may be a bit slow to respond.
Dug a bit more. The difference is the order. Pre 3.3. orders preview.$SHA.bundle.js
and then the other chunks. Post 3.3. orders other chunks, then preview.$SHA.bundle.js
, meaning that the regex needs to match non-greedy from the end and it will work.
gist is here: https://gist.github.com/joscha/9b1b9a716d46dc5509d586c962a97b85 (also note the missing newlines are part of the change, scroll to the very end to see the preview bundle)
Thanks @joscha - we'll get a fix out for this in the next few hours.
Should do it:
<script [^>]*src\s*=\s*["']([^"']*static\/preview[^"']*)["'][^>]*>
Have checked that regex against your gist @joscha, both pre and post 3.3, and it should work. Going to push a PR now.
Storybook 3.3 was released over the holidays (see https://medium.com/storybookjs/announcing-storybook-3-3-9972c4bc87ac).
It seems as if percy-storybook has a few problems dealing with it. I haven't dug into it in detail, but it seems as if some regex or else is matching a but too much, e.g. the error looks like this:
where
[...]
are all additional JS resources.I will try to reproduce the issue in this repo and open a PR if I can.