Skip to content

Commit

Permalink
feat: v2 (#98)
Browse files Browse the repository at this point in the history
* chore: updates

* updates

* updates

* updates

* updates

* updates

* 2d working

* updates

* updates

* updates

* working webgl

* updates

* updates

* updates

* updates

* Update Cargo.toml

* updates

* updates

* updates

* updates

* Update webgl.rs

* updates

* updates

* Update .gitignore

* updates

* updates

* updates

* working much better :D

* updates

* updates

* chore: refactor

* chore: clean up

* chore: clean up

* chore: clean up

* feat: JSI

* chore: updates

* chore: updates

* chore: updates

* chore: updates

* chore: updates

* chore: updates

* chore: updates

* chore: clean up

* chore: updates

* chore: clean up

* chore: clean up

* chore: clean up

* chore: updates

* chore: clean up

* chore: clean up

* chore: updates

* chore: updates

* chore: updates

* Update WebGL2RenderingContext.cpp

* chore: use namespace

* chore: updates

* chore: updates

* chore: fix build

* chore: initial 2d support

* fix: gl alive!!!

* fix: updates

* fix: working 3D

* fix: 2d

* fix: video rendering

* fix: 2d context to 2d context drawing

* feat: v2 alpha.0

* chore: updates & trying another op

* fix: remove extra conversion

* chore: clean up

* chore: updates

* chore: updates

* chore: bump

* feat: initial dom view

* feat: expose skia dom

* chore: ios updates (#99)

* chore: ios updates

chore: replaces Arc with Rc

* fix(android): updates

* chore: ios updates

* chore: ios updates

* chore: ios updates

* chore: updates

* chore: updates

* chore: updates

* fix: ios

* chore: updates

* chore: updates

* fix(ios): missing pods

* fix(ios): build

* chore: updates

* chore: updates

* chore: updates

* fix(ios): improve fileop

* chore: updates

* chore: updates

* chore: updates

* chore: updates

* Chore v2 perf op (#104)

* chore: updates

* chore: updates

* chore: nx migrate @nativescript/plugin-tools

* release: 2.0.0-alpha.17

* fix: fenceSync

* fix(jsi): fenceSync

* chore: updates

* chore: upgrade skia

* feat: v8 refactor (#103)

* feat: v8 refactor

* chore: updates

* chore: updates

* chore: updates

* chore: updates

* chore: updates

* chore: updates

* chore: updates

* chore: updates

* chore: updates

* chore: improve code sharing

* chore: updates

* chore: updates

* chore: updates

* chore: updates

* chore: working ios

* chore: update

* fix: running on both platforms

* chore: updates

* chore: 2.0.0-alpha.21

* feat:  the frantic run of the valorous rabbit demo game

* chore: alpha 22

* chore: updates

* chore: updates

* chore: updates

* chore: update

* fix: package building

* chore: updates

* chore: updates

---------

Co-authored-by: Nathan Walker <[email protected]>
  • Loading branch information
triniwiz and NathanWalker authored Nov 4, 2023
1 parent cc723b4 commit b23b821
Show file tree
Hide file tree
Showing 1,288 changed files with 311,909 additions and 653,460 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
15 changes: 15 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Canvas Native

on: [workflow_dispatch]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-18.04

steps:
- name: Checkout
- uses: actions/checkout@v3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ Thumbs.db
*.tgz
packages/**/angular/dist
apps/demo/times.html
rust-skia
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ npm run setup
npm start
```

- @nativescript/canvas
- @nativescript/canvas-babylon
- @nativescript/canvas-media
- @nativescript/canvas-phaser
- @nativescript/canvas-phaser-ce
- @nativescript/canvas-pixi
- @nativescript/canvas-polyfill
- @nativescript/canvas-three
- [@nativescript/canvas](packages/canvas/README.md)
- [@nativescript/canvas-babylon](packages/canvas-babylon/README.md)
- [@nativescript/canvas-chartjs](packages/canvas-chartjs/README.md)
- [@nativescript/canvas-media](packages/canvas-media/README.md)
- [@nativescript/canvas-phaser](packages/canvas-phaser/README.md)
- [@nativescript/canvas-phaser-ce](packages/canvas-phaser-ce/README.md)
- [@nativescript/canvas-pixi](packages/canvas-pixi/README.md)
- [@nativescript/canvas-polyfill](packages/canvas-polyfill/README.md)
- [@nativescript/canvas-three](packages/canvas-three/README.md)

# How to use?

Expand Down
35 changes: 18 additions & 17 deletions apps/demo-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"main": "./src/main.ts",
"dependencies": {
"@nativescript/canvas": "file:../../dist/packages/canvas",
"@nativescript/canvas-babylon": "file:../../dist/packages/canvas-babylon",
"@nativescript/canvas-media": "file:../../dist/packages/canvas-media",
"@nativescript/canvas-phaser": "file:../../dist/packages/canvas-phaser",
"@nativescript/canvas-phaser-ce": "file:../../dist/packages/canvas-phaser-ce",
"@nativescript/canvas-pixi": "file:../../dist/packages/canvas-pixi",
"@nativescript/canvas-polyfill": "file:../../dist/packages/canvas-polyfill",
"@nativescript/canvas-three": "file:../../dist/packages/canvas-three",
"@nativescript/core": "file:../../node_modules/@nativescript/core",
"three": "file:../../node_modules/three"
},
"devDependencies": {
"@nativescript/android": "~8.4.0",
"@nativescript/ios": "~8.4.0"
}
"main": "./src/main.ts",
"dependencies": {
"@nativescript/canvas": "file:../../dist/packages/canvas",
"@nativescript/canvas-babylon": "file:../../dist/packages/canvas-babylon",
"@nativescript/canvas-media": "file:../../dist/packages/canvas-media",
"@nativescript/canvas-phaser": "file:../../dist/packages/canvas-phaser",
"@nativescript/canvas-phaser-ce": "file:../../dist/packages/canvas-phaser-ce",
"@nativescript/canvas-pixi": "file:../../dist/packages/canvas-pixi",
"@nativescript/canvas-polyfill": "file:../../dist/packages/canvas-polyfill",
"@nativescript/canvas-three": "file:../../dist/packages/canvas-three",
"@nativescript/core": "file:../../node_modules/@nativescript/core",
"three": "file:../../node_modules/three",
"@nativescript/canvas-chartjs": "file:../../dist/packages/canvas-chartjs"
},
"devDependencies": {
"@nativescript/android": "~8.5.0",
"@nativescript/ios": "8.5.1-dev.0"
}
}
1 change: 1 addition & 0 deletions apps/demo-angular/src/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const routes: Routes = [
{ path: 'home', component: HomeComponent },
{ path: 'canvas', loadChildren: () => import('./plugin-demos/canvas.module').then(m => m.CanvasModule) },
{ path: 'canvas-babylon', loadChildren: () => import('./plugin-demos/canvas-babylon.module').then(m => m.CanvasBabylonModule) },
{ path: 'canvas-chartjs', loadChildren: () => import('./plugin-demos/canvas-chartjs.module').then(m => m.CanvasChartjsModule) },
{ path: 'canvas-media', loadChildren: () => import('./plugin-demos/canvas-media.module').then(m => m.CanvasMediaModule) },
{ path: 'canvas-phaser', loadChildren: () => import('./plugin-demos/canvas-phaser.module').then(m => m.CanvasPhaserModule) },
{ path: 'canvas-phaser-ce', loadChildren: () => import('./plugin-demos/canvas-phaser-ce.module').then(m => m.CanvasPhaserCeModule) },
Expand Down
58 changes: 28 additions & 30 deletions apps/demo-angular/src/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,32 @@ export class HomeComponent {
constructor(private router: RouterExtensions){}

demos = [
{
name: 'canvas',
},
{
name: 'canvas-babylon',
},
{
name: 'canvas-media',
},
{
name: 'canvas-phaser',
},
{
name: 'canvas-phaser-ce',
},
{
name: 'canvas-pixi',
},
{
name: 'canvas-polyfill',
},
{
name: 'canvas-three',
},
];

onTap(event){
const item = this.demos[event.index];
this.router.navigate(['/' + item.name]);
{
name: 'canvas'
},
{
name: 'canvas-babylon'
},
{
name: 'canvas-chartjs'
},
{
name: 'canvas-media'
},
{
name: 'canvas-phaser'
},
{
name: 'canvas-phaser-ce'
},
{
name: 'canvas-pixi'
},
{
name: 'canvas-polyfill'
},
{
name: 'canvas-three'
}
}
];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ActionBar title="canvas-chartjs" class="action-bar"> </ActionBar>
<StackLayout class="p-20">
<ScrollView class="h-full">
<StackLayout>
<Button text="Test canvas-chartjs" (tap)="demoShared.testIt()" class="btn btn-primary"></Button>
</StackLayout>
</ScrollView>
</StackLayout>
19 changes: 19 additions & 0 deletions apps/demo-angular/src/plugin-demos/canvas-chartjs.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Component, NgZone } from '@angular/core';
import { DemoSharedCanvasChartjs } from '@demo/shared';
import { } from '@nativescript/canvas-chartjs';

@Component({
selector: 'demo-canvas-chartjs',
templateUrl: 'canvas-chartjs.component.html',
})
export class CanvasChartjsComponent {

demoShared: DemoSharedCanvasChartjs;

constructor(private _ngZone: NgZone) {}

ngOnInit() {
this.demoShared = new DemoSharedCanvasChartjs();
}

}
10 changes: 10 additions & 0 deletions apps/demo-angular/src/plugin-demos/canvas-chartjs.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
import { CanvasChartjsComponent } from './canvas-chartjs.component';

@NgModule({
imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: CanvasChartjsComponent }])],
declarations: [CanvasChartjsComponent],
schemas: [ NO_ERRORS_SCHEMA]
})
export class CanvasChartjsModule {}
34 changes: 34 additions & 0 deletions apps/demo-vue/app/plugin-demos/canvas-chartjs.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<template>
<Page>
<ActionBar>
<Label text="canvas-chartjs"/>
</ActionBar>

<GridLayout>
<Button class="info" :text="message"/>
</GridLayout>
</Page>
</template>

<script lang="ts">
import Vue from "nativescript-vue";
import { DemoSharedCanvasChartjs } from '@demo/shared';
import { } from '@nativescript/canvas-chartjs';
export default Vue.extend({
computed: {
message() {
return "Test canvas-chartjs";
}
}
});
</script>

<style scoped lang="scss">
.info {
font-size: 20;
horizontal-align: center;
vertical-align: center;
}
</style>
35 changes: 18 additions & 17 deletions apps/demo-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"main": "./app/app.js",
"dependencies": {
"nativescript-vue": "file:../../node_modules/nativescript-vue",
"@nativescript/core": "file:../../node_modules/@nativescript/core",
"@nativescript/canvas-media": "file:../../packages/canvas-media",
"@nativescript/canvas": "file:../../packages/canvas",
"@nativescript/canvas-babylon": "file:../../packages/canvas-babylon",
"@nativescript/canvas-phaser": "file:../../packages/canvas-phaser",
"@nativescript/canvas-phaser-ce": "file:../../packages/canvas-phaser-ce",
"@nativescript/canvas-pixi": "file:../../packages/canvas-pixi",
"@nativescript/canvas-polyfill": "file:../../packages/canvas-polyfill",
"@nativescript/canvas-three": "file:../../packages/canvas-three"
},
"devDependencies": {
"@nativescript/android": "~8.4.0",
"@nativescript/ios": "~8.4.0"
}
"main": "./app/app.ts",
"dependencies": {
"nativescript-vue": "file:../../node_modules/nativescript-vue",
"@nativescript/core": "file:../../node_modules/@nativescript/core",
"@nativescript/canvas-media": "file:../../packages/canvas-media",
"@nativescript/canvas": "file:../../packages/canvas",
"@nativescript/canvas-babylon": "file:../../packages/canvas-babylon",
"@nativescript/canvas-phaser": "file:../../packages/canvas-phaser",
"@nativescript/canvas-phaser-ce": "file:../../packages/canvas-phaser-ce",
"@nativescript/canvas-pixi": "file:../../packages/canvas-pixi",
"@nativescript/canvas-polyfill": "file:../../packages/canvas-polyfill",
"@nativescript/canvas-three": "file:../../packages/canvas-three",
"@nativescript/canvas-chartjs": "file:../../packages/canvas-chartjs"
},
"devDependencies": {
"@nativescript/android": "~8.5.0",
"@nativescript/ios": "8.5.1-dev.0"
}
}
3 changes: 2 additions & 1 deletion apps/demo/nativescript.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ export default {
id: 'org.nativescript.plugindemo',
appResourcesPath: '../../tools/assets/App_Resources',
android: {
v8Flags: '--expose_gc',
v8Flags: '--expose_gc --allow-natives-syntax --turbo-fast-api-calls',
markingMode: 'none',
discardUncaughtJsExceptions: false,
},
appPath: 'src',
ios: {
Expand Down
61 changes: 31 additions & 30 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
{
"main": "./src/app.ts",
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"@nativescript/canvas": "file:../../packages/canvas",
"@nativescript/canvas-babylon": "file:../../packages/canvas-babylon",
"@nativescript/canvas-media": "file:../../packages/canvas-media",
"@nativescript/canvas-phaser": "file:../../packages/canvas-phaser",
"@nativescript/canvas-phaser-ce": "file:../../packages/canvas-phaser-ce",
"@nativescript/canvas-pixi": "file:../../packages/canvas-pixi",
"@nativescript/canvas-polyfill": "file:../../packages/canvas-polyfill",
"@nativescript/canvas-three": "file:../../packages/canvas-three",
"@nativescript/core": "file:../../node_modules/@nativescript/core",
"babylonjs": "file:../../node_modules/babylonjs",
"babylonjs-materials": "file:../../node_modules/babylonjs-materials",
"chart.js": "file:../../node_modules/chart.js",
"d3": "file:../../node_modules/d3",
"matter-js": "file:../../node_modules/matter-js",
"phaser": "file:../../node_modules/phaser",
"phaser-ce": "file:../../node_modules/phaser-ce",
"pixi.js": "file:../../node_modules/pixi.js",
"three": "file:../../node_modules/three",
"vexflow": "file:../../node_modules/vexflow",
"zen-3d": "file:../../node_modules/zen-3d"
},
"devDependencies": {
"@nativescript/android": "~8.4.0",
"@nativescript/ios": "~8.4.0"
}
"main": "./src/app.ts",
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"@nativescript/canvas": "file:../../packages/canvas",
"@nativescript/canvas-babylon": "file:../../packages/canvas-babylon",
"@nativescript/canvas-media": "file:../../packages/canvas-media",
"@nativescript/canvas-phaser": "file:../../packages/canvas-phaser",
"@nativescript/canvas-phaser-ce": "file:../../packages/canvas-phaser-ce",
"@nativescript/canvas-pixi": "file:../../packages/canvas-pixi",
"@nativescript/canvas-polyfill": "file:../../packages/canvas-polyfill",
"@nativescript/canvas-three": "file:../../packages/canvas-three",
"@nativescript/core": "file:../../node_modules/@nativescript/core",
"babylonjs": "file:../../node_modules/babylonjs",
"babylonjs-materials": "file:../../node_modules/babylonjs-materials",
"chart.js": "file:../../node_modules/chart.js",
"d3": "file:../../node_modules/d3",
"matter-js": "file:../../node_modules/matter-js",
"phaser": "file:../../node_modules/phaser",
"phaser-ce": "file:../../node_modules/phaser-ce",
"pixi.js": "file:../../node_modules/pixi.js",
"three": "file:../../node_modules/three",
"vexflow": "file:../../node_modules/vexflow",
"zen-3d": "file:../../node_modules/zen-3d",
"@nativescript/canvas-chartjs": "file:../../packages/canvas-chartjs"
},
"devDependencies": {
"@nativescript/android": "8.6.2",
"@nativescript/ios": "8.6.1"
}
}
5 changes: 3 additions & 2 deletions apps/demo/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"production": true,
"uglify": true,
"release": true,
"forDevice": true
"forDevice": true,
},
"dependsOn": [
{
Expand All @@ -38,7 +38,8 @@
"executor": "@nativescript/nx:build",
"options": {
"platform": "android",
"noHmr": true
"noHmr": true,
"flags": "--env.watchNodeModules"
},
"dependsOn": [
{
Expand Down
Loading

0 comments on commit b23b821

Please sign in to comment.