Git Product home page Git Product logo

Comments (7)

stevenklar avatar stevenklar commented on May 25, 2024 2

Works like a charm! Thank you for working on this. I love to develop outside of greyhack as it's much more convenient and greybel is an insane improvement on that.

Closing this issue now. Fixed and better than before. 👍🏼

from greybel-js.

stevenklar avatar stevenklar commented on May 25, 2024

After some investigation and debugging there is a finding.

The transpiler does not forward the options to the parser.
https://github.com/ayecue/greybel-transpiler/blob/master/src/transpiler.ts#L86
Fixed it by replacing

		const targetParseResult: TargetParseResult = await target.parse({
			disableLiteralsOptimization: me.disableLiteralsOptimization,
			disableNamespacesOptimization: me.disableNamespacesOptimization
		});

with

		const targetParseResult: TargetParseResult = await target.parse(me);

Prepared an PR: ayecue/greybel-transpiler@master...stevenklar:greybel-transpiler:patch-1
If you can confirm that i'm not missing something here, this can be closed and fixed in the transpiler itself. :-)

from greybel-js.

ayecue avatar ayecue commented on May 25, 2024

You are right. Looks like I've missed that.

Your patch looks alright at first glance. I'll have deeper look tomorrow.

from greybel-js.

stevenklar avatar stevenklar commented on May 25, 2024

Awesome thanks, looking forward to the fix. :-)

from greybel-js.

ayecue avatar ayecue commented on May 25, 2024

Okay the issue should be fixed with e47e653.

Turns out that the envars map wasn't just passed to the target class incorrectly but also to the parser instance from greybel-core. To prevent future mistakes I've also added a test case for it.

Thanks for reporting. :)

I'll keep the issue open for now until you have also checked it on your side.

from greybel-js.

stevenklar avatar stevenklar commented on May 25, 2024

Hey ayecue, checked out the new version and it works!

There is one more thing I noticed.
I don't know if we could fix that within this issue or should create a new one for it.

Right now I got the ENV implementation in my actual entry src file. Which works now.
Example:

cmd.src (which is build target)

Framework.ENV.Mode = #envar MODE; // local or remote

When I put that in any file which will be merged ob build time. Meaning #include env;
Having the same line in there produces

Framework.ENV.Mode = null;

Any idea if that could be an easy fix or does that need more brain being able to make that recursive.
I don't think it's really a deal breaker with that feature. But having all env related stuff injected in another file would be nice. :-)

from greybel-js.

ayecue avatar ayecue commented on May 25, 2024

Nice good to hear.

Thanks for reporting. I thought I've added support for it at some point. Seems like I didn't. The passing of the environment variables map right now is a little bit dirty in the transpiler. Something I have to clean up in the future when there is time.

Anyway I've did a few changes to the code in the transpiler. (5d21257) Greybel should now support #envar somevar; in includes and imports. I've also added a test case to make sure this works in the future as well.

Please give it a try if it works for you as well.

I'll keep the issue open until you've checked it on your side as well.

from greybel-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.