Skip to content
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

Getting Started example uses deprecated pyscript.write() method. #973

Closed
3 tasks done
jasonwashburn opened this issue Nov 22, 2022 · 6 comments · Fixed by #981
Closed
3 tasks done

Getting Started example uses deprecated pyscript.write() method. #973

jasonwashburn opened this issue Nov 22, 2022 · 6 comments · Fixed by #981
Labels
tag: docs Related to the documentation type: bug Something isn't working

Comments

@jasonwashburn
Copy link
Contributor

Checklist

  • I added a descriptive title
  • I searched for other issues and couldn't find a solution or duplication
  • I already searched in Google and didn't find any good information or help

What happened?

What happened:

While following along and executing examples from the getting-started page, I discovered that the fourth example, Writing into labled elements, produces the following deprecation warning

PyScript Deprecation Warning: PyScript.write is
        marked as deprecated and will be removed sometime soon. Please, use
        Element(<id>).write instead.

What should happen:

The example should be rewritten to execute without producing errors or warnings.

What browsers are you seeing the problem on? (if applicable)

Chrome

Console info

PyScript Deprecation Warning: PyScript.write is
        marked as deprecated and will be removed sometime soon. Please, use
        Element(<id>).write instead.


### Additional Context

I will submit a PR shortly after submitting this issue.
@jasonwashburn jasonwashburn added needs-triage Issue needs triage type: bug Something isn't working labels Nov 22, 2022
@FabioRosado
Copy link
Contributor

Thank you for raising this issue to us!

Would you be interested in opening a PR to fix this?

@FabioRosado FabioRosado added tag: docs Related to the documentation and removed needs-triage Issue needs triage labels Nov 22, 2022
@jasonwashburn
Copy link
Contributor Author

Thank you for raising this issue to us!

Would you be interested in opening a PR to fix this?

Absolutely, you beat me by 4 minutes 😄 . Submitted #974 to fix this issue.

On a related note, there's another reference to pyscript.write() on line 269 which I left alone as I wasn't sure if the statement was still accurate, or if it had been changed. I think the intent of the <pyscript output="plot"> is still clear either way.

@JeffersGlass
Copy link
Member

I think the intent of the is still clear either way.

For what it's worth, the <py-script output='...'> was deprecated when the display() syntax was rolled out. A similar syntax may be reintroduced as the plugin API grows (see #944), but at the moment it isn't possible.

@jasonwashburn
Copy link
Contributor Author

I think the intent of the is still clear either way.

For what it's worth, the <py-script output='...'> was deprecated when the display() syntax was rolled out. A similar syntax may be reintroduced as the plugin API grows (see #944), but at the moment it isn't possible.

Ah...now I see it. Ok, in that case, if I understand it correctly, that example should probably be updated use display(fig) similar to a number of other examples that were updated in #749

@antocuni
Copy link
Contributor

btw, we should detect the output attribute of <py-script> tags and show a deprecation warning in that case

@madhur-tandon
Copy link
Member

Since #974 is merged, I guess we can close this right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag: docs Related to the documentation type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants