You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
TextMate grammars are really great. And it was a pity Highlights can't be used in browsers, as oniguruma native regex library is being used. So I decided, to invest some time to implement oniguruma compatible javascript regex engine - Regex. It uses JavaScript's RegExp, and not supported features are then handled seperatly. Afterwards, I have created node-oniguruma-compatible module - oniguruma-js. All the unit tests from the node-oniguruma are being passed. And as the final point, a fork of first-mate, which uses the oniguruma-js as the dependency, passes also all the tests. The benchmark/large.js and benchmark/bootstrap.css are tokenized the same - as with node-oniguruma.
Performance
As for know, it is slower then node-oniguruma. But node-oniguruma should not be completely replaced with the javascript implementation, only in environments, where native modules can't be used - like browsers
The performance for the minified code is absolutely bad, as the lines are extremely long in that case. It will be much better, when browers support sticky flags natively. oniguruma-js is the first draft - there are a lot of things to optimize, fix and re-factor.
If you are interested to bring highlights and first-mate to browsers some code refactors are then also required. For example, the IO things should be encapsulated into a Grammar Manager - to support bundling and different data transports. Dependencies should be reduced. And so on.
What do you think all about this?
Cheers, Alex
The text was updated successfully, but these errors were encountered:
Hi Team,
what do you think about browser compatibility?
TextMate grammars are really great. And it was a pity
Highlights
can't be used in browsers, asoniguruma
native regex library is being used. So I decided, to invest some time to implement oniguruma compatible javascript regex engine - Regex. It uses JavaScript'sRegExp
, and not supported features are then handled seperatly. Afterwards, I have created node-oniguruma-compatible module - oniguruma-js. All the unit tests from thenode-oniguruma
are being passed. And as the final point, a fork of first-mate, which uses theoniguruma-js
as the dependency, passes also all the tests. Thebenchmark/large.js
andbenchmark/bootstrap.css
are tokenized the same - as withnode-oniguruma
.Performance
As for know, it is slower then node-oniguruma. But node-oniguruma should not be completely replaced with the javascript implementation, only in environments, where native modules can't be used - like browsers
with
oniguruma-js
with
node-oniguruma
The performance for the minified code is absolutely bad, as the lines are extremely long in that case. It will be much better, when browers support
sticky
flags natively. oniguruma-js is the first draft - there are a lot of things to optimize, fix and re-factor.If you are interested to bring
highlights
andfirst-mate
to browsers some code refactors are then also required. For example, the IO things should be encapsulated into a Grammar Manager - to support bundling and different data transports. Dependencies should be reduced. And so on.What do you think all about this?
Cheers, Alex
The text was updated successfully, but these errors were encountered: