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

Add examples #446

Closed
Razican opened this issue Jun 2, 2020 · 5 comments
Closed

Add examples #446

Razican opened this issue Jun 2, 2020 · 5 comments
Labels
API documentation update documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@Razican
Copy link
Member

Razican commented Jun 2, 2020

Current situation
We currently have no code examples to use the API externally both in the API documentation and in the nonexistent examples folder.

What do we need?
As mentioned in #445, we should be creating a new API, but in any case, we would need to create examples for some common use cases of Boa. I'm extracting here part of that discussion:

When a user wants to use Boa for their projects, I can imagine the following use cases:

  • They want to interpret JavaScript from a file or a stored String and get the result.
  • They want to interpret JavaScript that is coming from a socket with a Read interface and get the result by streaming the bytes.
  • They want to extend our engine by providing new global functions and objects, so that with the JavaScript they can either perform more rich things in their setup (for example by providing an API for a browser window), or because they want to add JavaScript helpers for common actions in their setup. This also includes things as being the scripting language of a complex platform.
  • They want to change the global object, for example, because they want it to be the window or a frame.

I think we need at least one example of each, that gets tested on each commit, in the examples directory of the boa crate. Then, I would add parts of those examples to the library-level documentation, in order to make life easier for our users.

@Razican Razican added enhancement New feature or request help wanted Extra attention is needed documentation update documentation API good first issue Good for newcomers labels Jun 2, 2020
@elasmojs
Copy link
Contributor

@Razican I can help with this.

@Razican
Copy link
Member Author

Razican commented Aug 13, 2020

@Razican I can help with this.

Go ahead! Thanks :)

@Razican Razican assigned Razican and elasmojs and unassigned Razican Aug 13, 2020
elasmojs added a commit to elasmojs/boa that referenced this issue Aug 14, 2020
Added boa examples as per issue boa-dev#446
@elasmojs
Copy link
Contributor

@Razican the examples are completed except for point 4, i am not sure if I have figured that out. I will raise a pull request now

@jasonwilliams
Copy link
Member

@Razican should this be on hold until we know what the public API will look like?

@Razican
Copy link
Member Author

Razican commented Sep 28, 2020

I think so, yes. But the public API is already pretty good, so some examples can be added.

@Razican Razican added this to the v0.12.0 milestone Jan 11, 2021
jasonwilliams pushed a commit that referenced this issue Mar 7, 2021
Added boa examples as per issue #446
jasonwilliams pushed a commit that referenced this issue Apr 5, 2021
Added boa examples as per issue #446
Razican pushed a commit that referenced this issue May 22, 2021
Added boa examples as per issue #446
@Razican Razican modified the milestones: v0.12.0, v0.13.0 May 22, 2021
@raskad raskad modified the milestones: v0.13.0, v0.14.0 Sep 25, 2021
jasonwilliams pushed a commit to jasonwilliams/boa that referenced this issue Nov 2, 2021
Added boa examples as per issue boa-dev#446
jasonwilliams pushed a commit that referenced this issue Nov 2, 2021
Added boa examples as per issue #446
jasonwilliams pushed a commit that referenced this issue Dec 15, 2021
Added boa examples as per issue #446
jasonwilliams pushed a commit that referenced this issue Feb 7, 2022
Added boa examples as per issue #446
jasonwilliams pushed a commit that referenced this issue Feb 7, 2022
Added boa examples as per issue #446
jasonwilliams pushed a commit to jasonwilliams/boa that referenced this issue Mar 3, 2022
Added boa examples as per issue boa-dev#446
@bors bors bot closed this as completed in 44b5617 Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API documentation update documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants