-
Notifications
You must be signed in to change notification settings - Fork 23
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 ViewModel to modern JavaScript #297
Comments
We can offer a small bounty of say $200 for this for anyone who wants to tackle this and performance improvements. Goal would be to have a drop-in replacement that performs better than the current version, but priority is in performance improvements first. We have a complex app that is mostly on Blaze VM that can be used as a test bed. |
@ManuelDeLeon We're also fine tossing some cash your way if you want to take a weekend to look at any performance improvements you can think of for the current version. I know Blaze VM isn't your priority right now, but it would be really helpful for us in the coming months - we might transition over to React as well next year but getting stuff to perform better for now is also a nice thing. :) |
I'll create a new GitHub repo for ViewModel projects and put in the effort of making it easier for people to contribute. That means converting VM-Blaze to JS and make tests for VM-React accessible to anyone. Part of the work would involve creating detailed instructions on how to download, modify, and test the project, submit a PR, etc. I don't use VM-Blaze anymore so I don't have the motivation to work on it (sorry, it's sad but true) but I can definitely help and guide anyone who wants to contribute to it. Right now I'm in the process of rewriting VM-React with performance in mind. See this thread for more info. As for money, Once I get the ball rolling with the contributor friendly setup, I'll probably use CodeSponsor or maybe even Patreon. |
Hey @ManuelDeLeon, any updates on getting the ball rolling with this one? Is there something you could use help with? |
I'm soon trying to find the time to study the codebase, convert ViewModel from CoffeeScript to JavaScript and get started with fixing the bugs. @ManuelDeLeon , if you had any work done on this conversion, please do share as it would make life a lot easier :) |
Check out the react version for inspiration since it's done in JS and many cases you'll be able to find the methods or functionality of one in the other. |
I noticed ReactiveArray recently lost some weight in the form of |
Not really. With the Coffeescript changes I don't even know how to run the
tests anymore (I used mocha).
…On Mon, Jun 4, 2018, 12:10 AM arggh ***@***.***> wrote:
I noticed ReactiveArray recently lost some weight in the form of
coffeescript dependency, are you by any chance planning on still giving
ViewModel the same treatment?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#297 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AED31kpYqt9P40ZJwZaQbJ0pNKqzLNuSks5t5M9DgaJpZM4PzbaG>
.
|
I believe |
I'll give it another try then.
…On Mon, Jun 4, 2018, 1:48 AM arggh ***@***.***> wrote:
I believe diaconutheodor, whom was just speaking at Meteor night, has
published a compatible version at
https://github.com/cult-of-coders/meteor-mocha. At least I got ViewModel
tests running with that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#297 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AED31oK3mciwcavwPg7uVTe-AvIJxnoPks5t5OZpgaJpZM4PzbaG>
.
|
I was trying to convert ViewModel to JS myself, but it turned out to be a bit more difficult than I expected, since I don't really know Coffeescript and I certainly don't know ViewModel and Blaze. So I've been (not so) secretly wishing that you would find it worthy of your time to finish the goal stated earlier in this issue, and my hope for that to happen got some spark when I noticed ReactiveArray was now JS :) |
Can you make a repo that's able to run the viewmodel tests? I keep getting coffeescript errors even with cult-of-coders' mocha =( |
I just checked out a fresh copy of ViewModel, changed Package.onTest(function(api) {
api.use(
[
"coffeescript",
"ecmascript",
"blaze",
"templating",
"jquery",
"underscore",
"tracker",
"reload",
"sha",
"reactive-dict",
"manuel:reactivearray",
"cultofcoders:mocha",
"practicalmeteor:sinon",
"practicalmeteor:chai",
"manuel:isdev"
],
CLIENT
); and...
|
I didn't remember I had switched to a commit somewhere around Running tests with 6.3.7~/Development/viewmodel$ cat package.js; meteor test-packages ./ --driver-package cultofcoders:mocha --port 4000
Package.describe({
name: "manuel:viewmodel",
summary:
"MVVM, two-way data binding, and components for Meteor. Similar to Angular and Knockout.",
version: "6.3.7",
git: "https://github.com/ManuelDeLeon/viewmodel"
});
var CLIENT = "client";
Package.onUse(function(api) {
api.use(
[
"[email protected]_4",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]_2",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"manuel:[email protected]",
"manuel:[email protected]",
"manuel:[email protected]"
],
CLIENT
);
api.addFiles(
[
"lib/viewmodel.coffee",
"lib/viewmodel-parseBind.coffee",
"lib/bindings.coffee",
"lib/template.coffee",
"lib/migration.coffee",
"lib/viewmodel-onUrl.coffee",
"lib/viewmodel-property.js",
"lib/lzstring.js"
],
CLIENT
);
api.export(["ViewModel"], CLIENT);
});
Package.onTest(function(api) {
api.use(
[
"coffeescript",
"ecmascript",
"blaze",
"templating",
"jquery",
"underscore",
"tracker",
"reload",
"sha",
"reactive-dict",
"cultofcoders:mocha",
"practicalmeteor:sinon",
"practicalmeteor:chai",
"manuel:reactivearray",
"manuel:isdev"
],
CLIENT
);
api.addFiles(
[
"lib/viewmodel.coffee",
"lib/viewmodel-parseBind.coffee",
"lib/viewmodel-property.js",
"lib/bindings.coffee",
"lib/template.coffee",
"lib/migration.coffee",
"tests/jquery-patch.js",
"tests/sinon-restore.js",
"tests/bindings.coffee",
"tests/viewmodel.coffee",
"tests/viewmodel-instance.coffee",
"tests/viewmodel-check.coffee",
"tests/viewmodel-parseBind.coffee",
"tests/viewmodel-property.coffee",
"tests/template.coffee"
],
CLIENT
);
api.export(["ViewModel"], CLIENT);
});
[[[[[ Tests ]]]]]
=> Started proxy.
=> Started your app.
=> App running at: http://localhost:4000/
I20180606-20:33:47.597(3)? MochaRunner.runServerTests: Starting server side tests with run id 2ZfcryYMCKYerxWt7
W20180606-20:33:47.706(3)? (STDERR) MochaRunner.runServerTests: failures: 0 |
Cool. It works for me now =) |
I haven't given up on you! |
Would be awesome, if ViewModel was just JavaScript instead of CoffeeScript.
Depending on the targeted browsers, this might even have nice performance benefits in both execution and weight.
The most important benefit would be more contributors and increased confidence on using the library (it's just JavaScript vs. I need to learn CoffeeScript to fix this simple bug).
I already tried to achieve this using Decaffeinate and Prettier, but gave up for now.
The text was updated successfully, but these errors were encountered: