Git Product home page Git Product logo

Comments (29)

aMarCruz avatar aMarCruz commented on June 7, 2024

@GianlucaGuarini , sure.
I'm having problems right now with pre-compiled expression for the yield feature and the each attribute, so I'm back to the old way with Function() to not to delay the pr

from cli.

tipiirai avatar tipiirai commented on June 7, 2024

I'm eagerly waiting for the Content-Security-Policy version, but totally cool with Function() at this point. I'm respecting the Riot release cycle mastered by @GianlucaGuarini.

from cli.

aMarCruz avatar aMarCruz commented on June 7, 2024

I'm posting a preview in the riot-compiler repo (230-alpha1 branch).
This includes precompiled expressions w/o Function ctor.

from cli.

GianlucaGuarini avatar GianlucaGuarini commented on June 7, 2024

thank you @aMarCruz I will publish it on npm if you haven't done it yet and I will use it here in this repo as dependency

from cli.

aMarCruz avatar aMarCruz commented on June 7, 2024

@GianlucaGuarini , thanks, this is a preview, pass the test but is not fully working right now, I'm writing a fixed version and one PR with minor tweaks for integrate it in riot.

from cli.

GianlucaGuarini avatar GianlucaGuarini commented on June 7, 2024

@aMarCruz do you have a beta working release of the compiler? So I could start testing it here

from cli.

aMarCruz avatar aMarCruz commented on June 7, 2024

I'm working in the compiler today, sorry by delay.

from cli.

GianlucaGuarini avatar GianlucaGuarini commented on June 7, 2024

@aMarCruz No problem I just need an npm release I could include here for testing

from cli.

aMarCruz avatar aMarCruz commented on June 7, 2024

Yes, I have to do a regression to non-precompiled expression, it is too complex determine at compile-time the difference of template vs expression only :(
Working in compatibility issues, too. Today I will push both.

from cli.

GianlucaGuarini avatar GianlucaGuarini commented on June 7, 2024

thanks, make sure to publish them on npm as 2.3.0-beta.whatever

from cli.

aMarCruz avatar aMarCruz commented on June 7, 2024

@GianlucaGuarini hi,
I push new versions in the dev branch for compiler & tmpl.
both will not work with riot cause tmpl is using internal fixed brackets now {# #}, so any code using tmpl() need call tmpl.parse() before, e.g. tmpl(tmpl.parse(expr), {})
the compiler call to riot.tag2 instead riot.tag.
I will write tomorrow the pr for riot, with minor changes. Anyway, compiler tests is passing, I tested locally the various parser, please see at tmpl/test/server-specs/parsers/js/ for the output.

There's many changes, but this is important:

  • the internal {# #}, allow using different brackets at run-time, the compiler supports this feature too, but needs rewrite test in riot.
  • there's no support for comment (js or html) in expressions for both, compiler and tmpl.

I publish tmpl in npm with the minimum required files, because the compiler relies in this. You need clone the repo for run tests.
See you.

from cli.

GianlucaGuarini avatar GianlucaGuarini commented on June 7, 2024

@aMarCruz wow it seems you have already done a great job. I will test the new compiler in riot-cli waiting your pull request on riot to integrate the new beta version.
Thank you!

from cli.

aMarCruz avatar aMarCruz commented on June 7, 2024

@GianlucaGuarini , wonderful work! 👍

but I can not get it to run in my Windows 7 + node 0.12.4
There's error with const, it can be use with "strict mode", I remove the strict directives and having errors with es6:

alberto@amarcruz ~/cli
$ make test
# check code style
mkdir -p test/fixtures/logs
./lib/index.js > test/fixtures/logs/empty.log
C:\MinGW\msys\1.0\home\alberto\cli\lib\index.js:27
    help() {
        ^
SyntaxError: Unexpected token (
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3
make: *** [test-cli] Error 1

from cli.

GianlucaGuarini avatar GianlucaGuarini commented on June 7, 2024

@aMarCruz you should upgrade your nodejs version https://github.com/riot/cli/blob/master/package.json#L7
The new cli and all the riot modules running only on node can be written using es6 syntax

from cli.

aMarCruz avatar aMarCruz commented on June 7, 2024

Thanks.
btw, is the browser module, loadAndCompile, needed for the CLI?
and for riot, the public name riot.compile change to "loadAndCompile"?

from cli.

GianlucaGuarini avatar GianlucaGuarini commented on June 7, 2024

btw, is the browser module, loadAndCompile, needed for the CLI?

no I just need the compile method, but it would be nice to have a way to compile and merge also just the css via cli

and for riot, the public name riot.compile change to "loadAndCompile"?

no it remains riot.compile

I think we should avoid having references to riot in your new compiler because otherwise we will have circular dependencies: the compiler depends on riot that depends on the compiler
The new riot-compiler should be a standalone module that we could easily include in the riot main repo. Maybe we could also remove the browser.js script from riot-compiler handling the compiler public methods directly in the main riot repo

from cli.

aMarCruz avatar aMarCruz commented on June 7, 2024

@GianlucaGuarini thanks.
I will push 2 versions in the dist/ folder.
compiler.js as a module for node, not including the browser.js file, with the usual methods for compile css, js and html, mainly for tests.

riot.compiler.js including the riot.compile function, only for inclussion on riot through mash, in IIFEs for parsers, compiler, and the public riot.compile (browser.js), whitout methods for css and js. You decide about browser.js, I'm not testing this yet 'cause needs browser environment, only small corrections.

from cli.

GianlucaGuarini avatar GianlucaGuarini commented on June 7, 2024

@aMarCruz ok thank you I will test everything this weekend and update your repos whether is needed. Make sure to close the bugs you have fixed in the main riot repo

from cli.

aMarCruz avatar aMarCruz commented on June 7, 2024

Ok, thanks.

from cli.

GianlucaGuarini avatar GianlucaGuarini commented on June 7, 2024

@aMarCruz I have included the new riot-tmpl in riot and I it works without any problem, could you please publish the new riot-compiler on npm as well?

from cli.

aMarCruz avatar aMarCruz commented on June 7, 2024

Yes sure, the 2.3.0-beta.4 versions of the compiler and tmpl are already in npm, these has some fixes.

The compiler has a new feature, javascript files inclusion for from the file system, but I need the url in the call to compile(). This is implemented here: https://github.com/riot/compiler/blob/master/lib/core.js#L414-L420

compiler.parsers has flexible module detection, in the parsers test you can see its use. If you have installed a module (e.g. babel-core) the test will use it.

compiler and tmpl, both are using new versions of devDependecies, please npm update if you test locally.

The compiler expect a tag2 function in riot, I'm preparing the PR.
You are right with the browser part, It must live in the riot main code, this module is not tested.

from cli.

aMarCruz avatar aMarCruz commented on June 7, 2024

I'm reviewing the docs for the compiler.
...make perf is showing me high memory utilisation of the compiler, I'm working on these tonigh.

from cli.

GianlucaGuarini avatar GianlucaGuarini commented on June 7, 2024

@aMarCruz great work! I think once you will be ready with your new compiler pull request we could roll out riot 2.3.0 beta and let our users test the new features as well
I have updated the riot-tmpl and it seems to be a bit faster than the old version

from cli.

aMarCruz avatar aMarCruz commented on June 7, 2024

yes, is faster, and is working ok.
I have problems with the compiler:
The parsers implementation is depending on require, and not working in browser. I made a hack to make run this, but now with riot.compile the 'use strict' flag don't let me enclose this in a IIFE.
In 5 or 10 mins. I will push to comp-2.3 the code, can you can revise it?

from cli.

GianlucaGuarini avatar GianlucaGuarini commented on June 7, 2024

@aMarCruz please check riot/riot#1272 (comment)

from cli.

GianlucaGuarini avatar GianlucaGuarini commented on June 7, 2024

@aMarCruz I will check your stuff tomorrow... I need to check whether the failing tests on ie are related to the new riot.tmpl.js or simply because I have upgraded the saucelab dependencies

from cli.

aMarCruz avatar aMarCruz commented on June 7, 2024

ok, I'm fixing the compiler the browser issues too. Thanks

from cli.

GianlucaGuarini avatar GianlucaGuarini commented on June 7, 2024

I've sent you a mail with our browserstack credentials to make crossbrowser tests ;)

from cli.

aMarCruz avatar aMarCruz commented on June 7, 2024

Thanks!

from cli.

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.