-
Notifications
You must be signed in to change notification settings - Fork 25
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
Define project structure #1
Comments
hey @Viatorus what you have there is good. I'm thinking that (to answer your last question) the project will be entirely es6 transpiled for browser environments, with only partial transpilation for node (e.g. i work a lot on lambdas which run on node 4.3.2 so transpilation is only partial, eg. import syntax if you use commonjs, some features like destructuring which are not supported in 4.3.2). As far as files structure i don't have strong preferences but obviously each component would have its own file. |
I tried to add istanbul.js (code coverage) to the project. It does work if the coverage is 100%, else it returns an interal error that I currently cannot handle... Well, for me OOP seems cleaner than FP and also prefer to put different functionalities in different files but I am also open for everything else. Just find a solid and uniform way. ;) |
Okay, I got istanbul working with commit 44b0a1c. :) |
With webpack we have the possibility to define multiple entry points to split the library into independent build targets ( from here). So the user can select/load options what he really needs (like plugins). We could split lokijs into core, adapters and inverted index (e.g.). Now to the hurdle: Splitting the source code into files. Currently the source code dependencie looks like this: Its not to easy to understand the dependencies. o.O
|
I updated the structure. Now benchmarking is possible. Still investigate on how to create optional dependencies in webpack.... |
Now unit tests in node are possible. But I couldn't get coverage to work inside node... |
I still investigate in analyzing the code structure. I created an UML for that. The dependencies of each class is resolved (to other classes and functions). The functions dependencies are not resolved. The other adapters (crypto, angular, jquery-sync) have only external dependencies. Edit: It is not completely without missing dependencies as I see know. @techfort Could you explain to me what ExactIndex really is or should be? I don't see any useful code usage. Inside the source code it looks like it is never really used besides of collection creation. |
hey @Viatorus , I just made a commit in which I added a unit test for and noticed that it was using lokicore instead of src. I tried doing an npm run build but errors abounded. Are we in a state where we can manually run unit tests on lokijs2 and what would the process be? I went ahead and checked in since I already tested on lokijs project but would be good if I could test locally at least. Let me know if someone else set that up, thanks! |
Hey @obeliskos,
|
Ah thanks, I think I get how this is set up now... nice! thanks for moving those changes. |
A couple of notes, I removed eslint erroring on crlf as that is what I often use. If there is a way to have it convert that to common lf that's would be fine to add back. I also renamed the two specs in /spec root so they do not cause errors when running unit tests I did an npm run build and it did rebuild the minified version and map in lib but not the unminified version. Shouldn't it rebuild the unminified version too? |
With I removed the 2 specs because this was the rest of my template project. There is currently a problem with UglifyJS (it does not support ES6). If you run |
@obeliskos @techfort
How can I solve this? |
Hey, this week I want to start with porting LokiJS to LokiJS 2 and refactor the source code.
I think, these changes should not alter the behavior of LokiJS. |
Hey Viatorus, sorry I was tweaking one last 'stability bug fix' since it was so small a change... but I just now made that final lokijs.js commit to complete stability fixes refactoring. I only foresee sandbox webpage, examples, and wiki updates from now on to document these changes. |
No problem. :) |
So I have done some refactor things I mention here #1 (comment). My current problem is the renaming of variables, which should be used only internal and not by the user. Using getter/setter symantic is extremly slow compared to single value assign... @techfort |
Sounds great :) Are you able to run the old benchmark to guage effects of any single refactoring? If they are not used in critical paths it might not effect performance too much... It might also be good a time for gauging any changes to performance that the new node 8.0.0 version might offer or carry.... |
@Viatorus @obeliskos great to see you guys hard at work with this. How do i give you the right to enable services? i made you repository admins so i thought you would be able to do it. Alternatively let me know what services you need and i'll enable them. |
@obeliskos @techfort |
@Viatorus ah - ok, you requested access at org level. Didn't notice that.
Feel free to ping me when you need access approved as i have not received
notifications for those requests
…On Wed, May 31, 2017 at 11:49 AM, Viatorus ***@***.***> wrote:
@obeliskos <https://github.com/obeliskos>
I didn't benchmark LokiJS 1/2 yet, I just had a look at stackoverflow.com
and JSPerf. The node v8 hint is a good idea.
@techfort <https://github.com/techfort>
Please check out the pending permissions for LokiJS-Forge.
[image: image]
<https://cloud.githubusercontent.com/assets/3637911/26628705/689ad832-45ff-11e7-87ce-540dfd4f83a1.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD8FfauL_uNGlq2KCFfM887I41AlMlKpks5r_UW0gaJpZM4LqMmA>
.
|
Thank you! @obeliskos |
I would like to split LokiJS2 into single packages (but still located in this repository) using npm scoping. So my first idea is ((at) --> @): (at)lokijs/core Please have a look at https://github.com/angular/angular and https://www.npmjs.com/~angular. What do you guys think? |
Interesting... i wasn't aware of that option. @techfort has done all the npm publishing so i will let him weigh in on that but that sounds like it could have been useful for some of our persistence adapters for 1.4 branch. As for benchmarks, the logistics for timing aren't that difficult and no added (dev) dependencies was nice and i believe the timer resolution was more than sufficient, but if you would like to re-engineer some benchmarks for 2.0 and you think it would help feel free to use best in class libraries if they are accurate enough (repeatable with minor variance between runs). |
Looks like you are laying major groundwork to build this new foundation 🚀 Maybe once things settle down I can start figuring out what's going on... I can see I have a lot of new things to learn. |
Hey guys,
I just started defining the project structure of LokiJS2. Its the first time I am doing this, so maybe someone can help me out.
What I used so far:
What is missing:
For me open questions:
Please feel free to give helpful hints/commits for the initial project structure. ;)
Started with: techfort/LokiJS/issues/525
The text was updated successfully, but these errors were encountered: