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

Convert component names to camelCase #2

Closed
Ni55aN opened this issue Oct 30, 2018 · 20 comments
Closed

Convert component names to camelCase #2

Ni55aN opened this issue Oct 30, 2018 · 20 comments
Labels
bug Something isn't working

Comments

@Ni55aN
Copy link
Member

Ni55aN commented Oct 30, 2018

No description provided.

@Ni55aN Ni55aN added the bug Something isn't working label Oct 30, 2018
@Ni55aN
Copy link
Member Author

Ni55aN commented Oct 30, 2018

fixed in v0.1.1

@Ni55aN Ni55aN closed this as completed Oct 30, 2018
@JMidd91
Copy link

JMidd91 commented Dec 13, 2018

Hi,

Just thought id give this plugin a go again see how i got on.

i am getting this error -
image

its coming from this component if its something I have done, not sure really!

    class NumComponent extends Rete.Component {

        constructor() {
            super("Number");
            this.allocation = ['Math'];
            this.task = {
                outputs: {num: "output" }
            }
        }

        builder(node) {
            var out1 = new Rete.Output('num', "Number", numSocket);
            var ctrl = new TextControl(this.editor, 'num', false, 'number');

            return node.addControl(ctrl).addOutput(out1);
        }

        worker(node, inputs, outputs) {
            return {num: node.data.num};
        }

        code(node, inputs, add){
            console.log("add - \nnode", node, "\ninputs", inputs, "\nadd", add);
            add('num', node.data.num);
        }
    }

@Ni55aN
Copy link
Member Author

Ni55aN commented Dec 13, 2018

@trsh how do you building your app? I guess you haven't added the case dependency, if you add all dependences via <script>

@JMidd91
Copy link

JMidd91 commented Dec 13, 2018

ok so yea i did wonder that, I havnt done a search for case.js or what ever it would be. will do that now.

if you have a link to where i can find case i would appreciate it! :)

EDIT: is this it? -https://www.npmjs.com/package/case

@trsh
Copy link

trsh commented Dec 13, 2018

@Ni55aN no idea what are u talking about

@JMidd91
Copy link

JMidd91 commented Dec 13, 2018

its interesting, I added case.js to my project and now i get an error pointing to
editor.use(AlightRenderPlugin);

image

do you think the error is related?

EDIT1: so if i remove case.js or editor.use(AlightRenderPlugin); from my project i get rid of the error.

i know editor.use(AlightRenderPlugin); is deprecated, but I thought I could still use it?

EDIT2: ok so im just talking out loud here, so please tell me if i am talking rubbish -

when I use case.js, it causes the error with alight render plugin at this line -
https://github.com/retejs/alight-render-plugin/blob/b436fc83c2e09ad82f8f9bb454acf11f6734d0f3/src/index.js#L11

when I remove case.js and console log out alight of the above line, it no longer comes back as undefined and i dont get the error.

so am i right in thinking something in either case.js or code plugin is blocking the alight var being populated?

EDIT3: ok so i moved the script tag for case.js and moved it below rete.min.js and below alight.min.js and this fixed the issue.

I dont think Case uses alight but I guess it must be to do with some sort of loading order?

getting the camel undefined error with this now. really confused. its prob a case of late in the week, brain is dead haha

@Ni55aN
Copy link
Member Author

Ni55aN commented Dec 13, 2018

Now you need to include Angular light script. I propose you use build tools (webpack, parcel, rollup) to get rid of headaches when including dependencies.

@JMidd91
Copy link

JMidd91 commented Dec 13, 2018

Now you need to include Angular light script.

alight.min.js is this not what you speak of? as I already include it, it is loaded after rete.min.js but before alight-render-plugin

@Ni55aN
Copy link
Member Author

Ni55aN commented Dec 13, 2018

that's exactly what I'm talking about

@Ni55aN
Copy link
Member Author

Ni55aN commented Dec 13, 2018

Place it before rete.js

@JMidd91
Copy link

JMidd91 commented Dec 13, 2018

hmm doesnt seem to fix the issue

@Ni55aN
Copy link
Member Author

Ni55aN commented Dec 13, 2018

How do you build your app?

@JMidd91
Copy link

JMidd91 commented Dec 13, 2018

old fashioned way. I dont use npm etc to build it.

@JMidd91
Copy link

JMidd91 commented Dec 13, 2018

I think Case.js isnt included correctly because if i try to search / invoke anything to do it via console it is undefined or unexpected token. unless i am missunderstanding the docs for case

image;

its definitely there though -
image

@Ni55aN
Copy link
Member Author

Ni55aN commented Dec 13, 2018

old fashioned way. I dont use npm etc to build it.

Stop doing it :)

@JMidd91
Copy link

JMidd91 commented Dec 13, 2018

Stop doing it :)

I know but i am in too deep to convert!

@Ni55aN
Copy link
Member Author

Ni55aN commented Dec 13, 2018

The further, the harder it will be.

Case.min.js should have a global Case. It seems that script does not have it. What's inside? Did you take it from the CDN?

@JMidd91
Copy link

JMidd91 commented Dec 13, 2018

yea from the CDN.

yea so thats what I have found out. it doesnt expose Case for some reason. trying to find the best way to expose its Case variable in the correct way without taking it out of its function, otherwise id have to rename its _ variable as I am using lodash which would collide

@Ni55aN
Copy link
Member Author

Ni55aN commented Dec 13, 2018

Just migrate to Webpack 🥇

@JMidd91
Copy link

JMidd91 commented Dec 13, 2018

maybe one day when I get bored 🤣 I fixed it for now by removing it from an anonymous function and renaming the _ variable... dirty but will make it better later haha. thanks for your assistance 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants