Comments (9)
Might want to add "Embed JavaScript functions in C/C++"... This may not be used very often, but there is cases where the implementation of a function is a lot easier to use JavaScript than it is C/C++.
// This is the toString function defined using JavaScript,
// but is embedded in C/C++ code.
function toString() {
return `Point (${this.x}, ${this.y}, ${this.z})`
}
from chakracore-wiki.
NOTE: new edits to the list will be added to the main post instead of to this comment.
Good input. I think I've done all of those in this sample, but some documentation with small code snippets would've been more helpful. I'll look into it when I'm free.
Creating a list of topics,
- Expose native functions / external objects to JavaScript
- Handle object lifetime
- Implement a simple event-loop and task queue + using promises in JSRT
- Script serialization with lazy source loading
- Resource throttling
- Define non-writable property from C/C++(a.k.a. using descriptor)
- Define C/C++ Getter and Setter
- TypedArray handling in C/C++
Edited:
Add some stuff per microsoft/Chakra-Samples#51 @kphillisjr
from chakracore-wiki.
Something that would provide a lot of value. Something quiet common is how to wrap a c++ object so it is accessible from js.
Something similar to https://chromium.googlesource.com/v8/v8/+/master/samples/process.cc would be good.
from chakracore-wiki.
Yeah. I think this one (I added "external objects" just now) on my list would help,
Expose native functions / external objects to JavaScript
from chakracore-wiki.
Great :)
from chakracore-wiki.
Updated list in the main post so we get the progress meter from the issues page as we complete these items.
from chakracore-wiki.
@dilijev It would be good to call out that the samples should be accessible cross platform as well as just windows. The opengl sample is great, but uses some windows only features.
from chakracore-wiki.
@jaredwy -- Makes sense. For the APIs that are xplat-compatible, the samples should be xplat-compatible. But because they are example snippets, they might not compile on their own without setting up a project like the samples do. Short samples in documentation will not be perfect and super easy, but may be possible to copy-paste into an existing project.
For the Windows-only APIs, they'll obviously only work on Windows. There are a few of these.
from chakracore-wiki.
@dilijev Yup. It would be good just to avoid things like JSPointerToString
and JsGetPropertyNameFromId
even in projects that are windows only and c++. That is what threw me the most. I was using the opengl sample as a guide and ended up being thrown when attempting to compile copy and pasted code :)
from chakracore-wiki.
Related Issues (16)
- Embedding ChakraCore - sample link aka.ms/jsrtwrapper points to 404 HOT 2
- Update Build Status tables to new names after ChakraCore#1962 is merged HOT 1
- Add a page describing post-release support lifecycle. HOT 2
- Update "NuGet Packages" page for updated spec files and NuGet package layout. HOT 1
- Add release/2.0 Build Status table
- Mark Windows-only APIs in JSRT API reference HOT 1
- Add wiki for interesting derivative projects
- Add usage examples for each API's documentation page.
- Clarify JsCallFunction pointer argument is an array of JsValueRefs HOT 2
- Software Write Barrier should clarify need for software solution on non-Windows
- Update Jenkins-Build-Triggers and Jenkins-Repro-Steps with OSX steps
- This repo is missing important files HOT 1
- Wiki needs a help page on how to run tests. HOT 4
- Improve documentation for linking against static and dynamic linux libraries.
- Create a README with instructions for contributing to the Wiki
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chakracore-wiki.