Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 13 23:50
    ChrML commented #4048
  • Nov 13 23:49
    ChrML commented #4048
  • Nov 13 23:48
    ChrML commented #4048
  • Nov 12 21:44
    ChrML opened #4090
  • Nov 12 03:24
    samuelGrahame commented #4062
  • Nov 12 03:21
    samuelGrahame commented #4062
  • Nov 11 16:49
    fabriciomurta commented #4082
  • Nov 11 14:02
    ChrML commented #4082
  • Nov 09 03:24

    fabriciomurta on master

    Switches Bridge version to 17.1… Refreshes output files with Bri… [4082] Bridge 17.10.0 changes m… and 6 more (compare)

  • Nov 09 00:34

    fabriciomurta on v17.10.1

    (compare)

  • Nov 09 00:09
    fabriciomurta milestoned #4089
  • Nov 08 23:51
    fabriciomurta unlabeled #4082
  • Nov 08 23:51
    fabriciomurta closed #4082
  • Nov 08 23:51
    fabriciomurta commented #4082
  • Nov 08 23:49
    fabriciomurta closed #4083
  • Nov 08 23:49
    fabriciomurta commented #4083
  • Nov 08 23:48
    fabriciomurta unlabeled #4083
  • Nov 08 23:48
    fabriciomurta demilestoned #4083
  • Nov 08 23:48
    fabriciomurta milestoned #4083
  • Nov 08 23:48

    fabriciomurta on Issue4082

    (compare)

Maurycy Zarzycki
@EvidentlyCube
Hi, is it normal that when I have a single CSS resource in my bridge.json with extract set to true the resulting HTML does not include the core JS files?
That's the full extent of my configuration file, I've even resorted to scourging through the code of Bridge.net to see what I might be doing wrong but to no avail:
{
  "resources": [{
    "name": "style.css",
    "extract": true,
    "files": ["style.css"]
  }]
}
Maurycy Zarzycki
@EvidentlyCube
Fabrício Zimmerer Murta
@fabriciomurta
I tried setting up a Bridge project here with a simple CSS and specifying it alone in the bridge.json file. The result is I get bridge.js -and- the styles.css files out. So there might be something else in your project that's making the files not be output... or maybe you looking to the wrong output folder, by any chance?
Fabrício Zimmerer Murta
@fabriciomurta
okay, reading again, you are not stating at any point that the output files are missing, just the inclusion from the html file.
The thing is, once you specify the resources, it overrides its default, which is including all resources, so once you want to specify one, you should specify all you actually need.
Geoffrey McGill
@geoffreymcgill
I believe the .css is not added to the index.html by Bridge. I think you need to manually create your own .html file and add the .css link.
Fabrício Zimmerer Murta
@fabriciomurta
Yes, I just tested this, the CSS only goes to index.html when specified by the resources config; but not at all if nothing specified. But again, if not specified in the resources config, it won't get dumped when the project is built.
Maurycy Zarzycki
@EvidentlyCube
Yes, sorry for not being clear enough
My problem really boiled down to "if I specify custom resources how do I write the core files there?"
As in, how do I prepare the configuration so that the same files are included as if the resources were not set
Fabrício Zimmerer Murta
@fabriciomurta
Yes, this is not right, we've logged an issue and updated the thread you opened in the forums. For now, you can just either use the index.html lines you get when you remove the resources block, or add the ones you need (just name:, extract:true should do).
Harry
@cra0zy
wiki page does not mention "usetypedarrays" option
Fabrício Zimmerer Murta
@fabriciomurta
Yes, the option still seems to be valid in Bridge.
Fabrício Zimmerer Murta
@fabriciomurta
Okay, it should no longer be missing. Let us know if there's still something off.
Harry
@cra0zy
:+1:
Geoffrey McGill
@geoffreymcgill
Feel free to edit the wiki documents to add or revise details.
Harry
@cra0zy
I was not sure the status of it so I refrained from doing so
as there are no PRs for wiki
don't want to accidentally spread misinformation
wilari932
@wilari932

how can i make this on brige.net i can only create a defualt clicklistner
i want to send a html object insted of a event
area id="nose" oclick="Test(this);" />

<script>
function zoom(ele) {
var id = ele.id;

console.log('area element id = ' + id);
}
</script>

wilari932
@wilari932
never mind :) i found it
Geoffrey McGill
@geoffreymcgill
Hi @wilari932 – The following Deck sample might be able to help, see https://deck.net/welcome
SirUppyPancakes
@SirUppyPancakes

Hey guys, running into an issue where when using a type exposed through a Retyped library, the type isn't written into Bridge.global which my code attempts to reference when calling a generic function, resulting in a "no property <PROPERTY> on undefined" error. Here's a rough example showing what I mean:

using System;
using Node = Retyped.node;
using Electron = Retyped.electron.Electron;

namespace TestRetyped
{
    public class Program
    {
        private static void Test<T>(T value)
        {
            Console.WriteLine("inside test<T>");
        }

        public static void Main()
        {
            var x = new Node.Buffer("wow");
            var y = new Electron.BrowserWindow(new Electron.BrowserWindowConstructorOptions());

            Test(x);
            Test(y);
        }
    }
}

which outputs:

Bridge.assembly("Retyped_Generics_Example", function ($asm, globals) {
    "use strict";

    var Electron = require("electron");

    Bridge.define("TestRetyped.Program", {
        main: function Main () {
            var x = new Buffer("wow");
            var y = new Electron.BrowserWindow({ });

            // Bridge.global.Buffer exists...
            TestRetyped.Program.Test(Bridge.global.Buffer, x);

            // But Bridge.global.Electron does not...
            TestRetyped.Program.Test(Bridge.global.Electron.BrowserWindow, y);
        },
        statics: {
            methods: {
                Test: function (T, value) {
                    System.Console.WriteLine("inside test<T>");
                }
            }
        }
    });
});

The example isn't quite runnable out of the box since it has to integrate with a full NodeJS/Electron setup in order to run it properly, but any idea what would cause Bridge.global to be missing something? I noticed that my types all end up in there as well, so would this be a problem with the Retyped.electron package maybe? Another relevant bit of info is that I use the the loader type in bridge.json to be CommonJS to play nice with NodeJS.

SirUppyPancakes
@SirUppyPancakes
Alright so it looks like this issue has nothing to do with Electron necessarily, and instead there are some shenanigans happening with generic functions being used in a static context. The issue is a bit more contrived than I expected it would be, so I will be posting on the forums or github instead.
Fabrício Zimmerer Murta
@fabriciomurta
Just a guess, but I believe the problem may be because you are using Electron = ... instead of using static Electron = ...
I remember this static bit was required for retyped due to some limitations in the way the transformation from .d.ts to .cs worked.
CastleSoft
@CastleSoft
Any idea when Retyped will reparse the Typescript definitions ? Looking forward to tjhe new Syncfusion 16.3 being parsed. Thanks.
andrewm1986
@andrewm1986
Hey, anyone ever used bridge with nuxt? I am getting an error because bridge.js has require("fs") in it and nuxt is trying to interpret it, and also I can't seem to turn systemjs off and so getting things like TypeError: System.Decimal is not a function
Fabrício Zimmerer Murta
@fabriciomurta
I don't know nuxt but, the require() calls should only take place if running under node
This is the first time I ever heard about nuxt so, probably Bridge has not really been mixed up with it in the past.
In the other hand, Vue.JS should work via retyped: https://forums.bridge.net/forum/community/retyped/4972-closed-16-vue-js-support
andrewm1986
@andrewm1986
Oh, i know why. It's got a serverside component to it, I think
It must be the server side that's making it run the require
nuxt does SSR
it's amazing what walking away from the problem can make you think about. I went for a walk :)
andrewm1986
@andrewm1986
I just need
config.node = { fs: 'empty', };
Fabrício Zimmerer Murta
@fabriciomurta
Glad it helped (well, the walk, at least!), don't forget to let us know if you make an awesome open project using Bridge! (via a pull request listing it under https://github.com/bridgedotnet/Awesome)
colderlord
@colderlord
hello
I have some questions:
is Bridge.Newtonsoft.Json alive?
  1. i wrote some issues with no reaction
  2. i did PR, when bridge-team views pull requests?
Fabrício Zimmerer Murta
@fabriciomurta
Hello, it is alive. I'll take a look on the issues and pull request and adjust them. Sorry, and thanks for the heads up!
Merak
@merakmarey
Hi everyone, my question is...is possible to use Bridge translated code as a function library instead the main app?

Let say I have
Bridge.assembly("Demo", function ($asm, globals) {
"use strict";

Bridge.define("Demo.Program", {
    methods: {
        AskMe: function (name) {
            return "Hello " + (name || "");
        }
    }
});

});

How do I use AskMe outside Bridge?
Merak
@merakmarey
Never mind...
Fabrício Zimmerer Murta
@fabriciomurta
:)
iwknow
@iwknow
Hi all. I am trying to reference an exciting .NET standard project in a bridge.net project. the goal is to have a shared code base between the bridge.net project and my exciting C# project. i've read https://forums.bridge.net/forum/community/help/2408-code-sharing-between-bridge-net-and-pure-c-projects and https://forums.bridge.net/forum/community/help/4680-reference-to-pure-c-shared-library . It has been a year since the last update of these tickets. is it still true that the only way i can refer code from other projects is "link a file"?
Thanks!
Fabrício Zimmerer Murta
@fabriciomurta
yes, you can't reference non-bridge binaries from bridge binaries, their mscorlib would simply not match each other.
the code can be reused, yes, as the syntax is the same. And that's why the "link a file" approach works. The .NET std compiler will compile its own binaries, and the Bridge project will compile its own binaries.
Fabrício Zimmerer Murta
@fabriciomurta
The ultimate goal towards mscorlib, is to be able to just build the very .NET sources from bridge, so having a 100% matching interface. Even if so, the builds and symbols would still be likely different for what should be wrapped out for browser/os/platform-dependent code, so can't guarantee the IL of mscorlib will match even if the whole mscorlib is built from the same sources base.
iwknow
@iwknow
Hi Fabrício, thank you very much for your reply. It is very helpful. As mentioned in your last comment, bridge.net has its own mscorlib . Could you please provide more explanation on what this library plays in bridge.net and why the bridge.net has its own? thanks!