nippur72 / RiotTS

RiotJS for TypeScript
MIT License
101 stars 8 forks source link

i can't get the component to mount #41

Open dharmax opened 7 years ago

dharmax commented 7 years ago

i use jspm. i read the issues people have with riotts and jspm so i added riotts as a git submodule. i built a tiny component and i followed the execution in the debugger:

  1. the registration seems perfectly fine, to the best of my discernment
  2. the mounting, however, doesn't find the component (although it finds another component that was defined normally, using a .tag file) How could that be...?
nippur72 commented 7 years ago

so the problem is that you can't mount an element that was previously registered?

Please keep in mind that in a module-based scenario, the .ts file of an element must be imported before any mount occurs. E.g.

import "./my-tag"; // this registers the component 

riot.mount("*");
dharmax commented 7 years ago

That's what i did. As i said, i followed the execution into your code. It even seems like it executed the following line element.prototype.tagName = registerTag(compiled); correctly.

i followed also the execution of the mount, and there i saw that it simply doesn't recognize the tag...

So i'm at lost..

nippur72 commented 7 years ago

it's difficult to say. The only thing that comes into my mind is having two riot instances, you are registering in one but mounting with the other (just guessing).

If you can/want, setup a repo that I can clone and check.

dharmax commented 7 years ago

It sounds very reasonable...i still don't see where riot was instantiated twice, though.

It is a private repository, but i can send you a tar/zip. it's very small, because it's in a boilerplate status. where can i send it to?

nippur72 commented 7 years ago

@dharmax sent it to nino.porcino@gmail.com

dharmax commented 7 years ago

i sent it to you yesterday

nippur72 commented 7 years ago

yup I'm looking at it, but nothing so far.

Can you please confirm the correct way to build/run the project is:

node server/web-server

?

2016-11-24 12:16 GMT+01:00 avi notifications@github.com:

i sent it to you yesterday

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nippur72/RiotTS/issues/41#issuecomment-262752496, or mute the thread https://github.com/notifications/unsubscribe-auth/ACemK_ue2hdziLIqQz_Bsqy4DlCU-W23ks5rBXH4gaJpZM4K5H7q .

dharmax commented 7 years ago

hi, yes, this is indeed the program to execute, sorry (after you do yarn install, typings install, compile with tsc and lessc)

On Thu, Nov 24, 2016 at 1:19 PM nino-porcino notifications@github.com wrote:

yup I'm looking at it, but nothing so far.

Can you please confirm the correct way to build/run the project is:

node server/web-server

?

2016-11-24 12:16 GMT+01:00 avi notifications@github.com:

i sent it to you yesterday

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nippur72/RiotTS/issues/41#issuecomment-262752496, or mute the thread < https://github.com/notifications/unsubscribe-auth/ACemK_ue2hdziLIqQz_Bsqy4DlCU-W23ks5rBXH4gaJpZM4K5H7q

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nippur72/RiotTS/issues/41#issuecomment-262753051, or mute the thread https://github.com/notifications/unsubscribe-auth/AC-ezkGBcEsB3BVPPOH3XKqoOkBuf6F_ks5rBXKsgaJpZM4K5H7q .

dharmax commented 7 years ago

Any new findings?

foxik0169 commented 7 years ago

Same issue here... I use steal.js as module loader and even if I try to do everything in one file riot doesn't mount. I've looked if it isn't related to template or some issue with requests but everything downloads correctly only (I even tried calling riot.compile() with callback containing riot.mount()) riot.mount() returns empty array and nothing mounts.

Main.ts:

import riot = require('node_modules/riot/riot+compiler');
import './IDE';

riot.compile(() => {
    let tags = riot.mount('*');
    tags;
});

IDE.ts:

import * as Riot from 'riot-typescript';
import 'codemirror/lib/codemirror.css';
import * as CodeMirror from 'codemirror';
import * as EmmetCodemirror from 'emmet-codemirror';

@Riot.template('/_template/Administration/Templates/ACMS_IDE')
class IDE extends Riot.Element {

    attention: string = "yay";

}

ACMS_IDE (twig template rendered from php server with symfony):

{% raw %}
<ide>
    <div class="test">Testing, {{ attention }} please!</div>
</ide>
{% endraw %}

any suggestions? :)