Comments (29)
@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.
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.
I'm posting a preview in the riot-compiler repo (230-alpha1 branch).
This includes precompiled expressions w/o Function ctor.
from cli.
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.
@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.
@aMarCruz do you have a beta working release of the compiler? So I could start testing it here
from cli.
I'm working in the compiler today, sorry by delay.
from cli.
@aMarCruz No problem I just need an npm release I could include here for testing
from cli.
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.
thanks, make sure to publish them on npm as 2.3.0-beta.whatever
from cli.
@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.
@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.
@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.
@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.
Thanks.
btw, is the browser module, loadAndCompile, needed for the CLI?
and for riot, the public name riot.compile
change to "loadAndCompile"?
from cli.
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.
@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.
@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.
Ok, thanks.
from cli.
@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.
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.
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.
@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.
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.
@aMarCruz please check riot/riot#1272 (comment)
from cli.
@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.
ok, I'm fixing the compiler the browser issues too. Thanks
from cli.
I've sent you a mail with our browserstack credentials to make crossbrowser tests ;)
from cli.
Thanks!
from cli.
Related Issues (20)
- Ubuntu watch issue HOT 3
- riot cli in webstorm not compiling typescript with let or const HOT 8
- Typescript failing due to not using d.ts files. HOT 3
- In 6.x, the babel package has been deprecated in favor of babel-cli HOT 1
- can't compile tags on Windows HOT 5
- Messages with Node v10.0.0 HOT 1
- --watch not working on Windows HOT 4
- Is this cli planned to be compatible with Riot@4? HOT 3
- Watch new files
- Failed to compile multiple riot components to a single js file HOT 4
- cli ralways eturns exitcode 0 on errors HOT 1
- Riot not found on windows 10 HOT 2
- install instructions not working in Windows 10 HOT 2
- Error when trying to watch dir of riot files HOT 1
- Version 5.1.0 breaks riot.config.js HOT 2
- Does cli support typescript syntax in `<script>` tag? HOT 5
- Error: Cannot find module 'babylon'
- Cant use CLI without declaring devDependency HOT 1
- Upgrading from v5 to v6 HOT 1
- riot -w does not show errors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.