Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

prepack.io/repl.html doesn't show code in presence of warnings #2285

Closed
NTillmann opened this issue Jul 18, 2018 · 4 comments
Closed

prepack.io/repl.html doesn't show code in presence of warnings #2285

NTillmann opened this issue Jul 18, 2018 · 4 comments

Comments

@NTillmann
Copy link
Contributor

NTillmann commented Jul 18, 2018

Check out:
https://prepack.io/repl.html#BQMwrgdgxgLglgewgAmASmQbwFDOQGwFMZkFkBeLAXwG5dlxp4kH0t68EA6ADwuQBMAZjp48AJ2JhxKBKORV6AfSUIADvAC2cAF6FQaeQHN8CAEYBDfFxD8QdKmnQ0gA

Perfectly prepackable, but the (newly introduced) warning causes the website to not show the generated code.

@enzoferey
Copy link

enzoferey commented Sep 3, 2018

Hi @NTillmann, I would love to take this issue !

As far as I see this would be something like adding another clause here: https://github.com/facebook/prepack/blob/067a378227d0c2034aa963c8981cf243356f349a/website/js/repl.js#L170 with a "warning" type branch and modifying: https://github.com/facebook/prepack/blob/067a378227d0c2034aa963c8981cf243356f349a/website/js/repl-worker.js#L40 to dispatch a "warning" instead of just success/error, right ?

I will need to look further on Prepack code to know how warnings are formatted in order to know which kind of result to dispatch.

Do you we want to display the generated code as well as the warning message underneath ?

Btw, I come from the React podcast, very interesting episode !

EDIT:

found that severity: "Warning" in the buffer can be used to fix these issue. I'm fixing it and opening a PR.

facebook-github-bot pushed a commit that referenced this issue Sep 17, 2018
Summary:
cc NTillmann

Following up #2285, website shows the generated coded even when there are some warnings.

Lot of changes because prettier wasn't applied to the files, but I basically only checked for the error buffer containing only items with `severity === 'Warning'` and create the `warning` result type to behave the same than `success` one.

Next step would be to show the code AND warning messages. Either using the same display than error messages or creating a variation of it (changing text color to yellow for example). I can do it if you want.

Let me know if this is what you were looking for.

Have a nice day !

P.S: not sure if this PR was supposed to be into `gh-pages` or `master`. Let me know if that needs to be changed.
Pull Request resolved: #2528

Differential Revision: D9882040

Pulled By: NTillmann

fbshipit-source-id: bc8266a673e6def023bfa65b93b94ea9c7ad5b1d
@bencooper222
Copy link

Shouldn't this be closed or is there still something I can help with?

@enzoferey
Copy link

It should be closed, yes. And same than @bencooper222, let me know if there is anything else you need help with !

@NTillmann
Copy link
Contributor Author

Already fixed. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants