question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[discuss] docs/on-boarding/ux

See original GitHub issue

After evaluating mikro-orm (MO) yesterday, I wanted to toy a bit around with MO but the actual experience of getting started was rocky. So, it’s an issue about your docs and how to get started and maybe a reason why MO doesn’t take off despite having the best architecture.

First I couldn’t get passed this:

7:19:59 AM - File change detected. Starting incremental compilation...
api    |
api    | node_modules/mikro-orm/dist/connections/AbstractSqlConnection.d.ts(1,8): error TS1259: Module '"/app/node_modules/knex/types/index"' can only be default-imported using the 'esModuleInterop' flag
api    | node_modules/mikro-orm/dist/query/QueryBuilderHelper.d.ts(1,8): error TS1259: Module '"/app/node_modules/knex/types/index"' can only be default-imported using the 'esModuleInterop' flag
api    |
api    | 7:19:59 AM - Found 2 errors. Watching for file changes.

My code:

import { MikroORM } from 'mikro-orm'
import { MongoDriver } from 'mikro-orm/dist/drivers/MongoDriver'

const main = async () => {
  const orm = await MikroORM.init({
    entitiesDirs: ['./build/**/entities'],
    driver: MongoDriver,
    driverOptions: {
      host: 'db',
      user: 'root',
      password: '<mypass>',
    },
  })
}

main()
  • So, the reason I opted for MO was that the Mongo implementation should be better than the one from TypeORM (in particular relations) but when I see that the systems tries to get abstract SQL drivers and Knex => why all this baggage if I just want Mongo? Besides, I know that I have to set the esModuleInterop now but I would have be nice to have a note about this because every error early on just increases the risk that people bail out

Then:

  • The docs have to clearly state how to import MikroORM. On the node server side people are still used to const/require and a default import; no big thing but still; you want to sell your lib, you want to get people into the funnel but if I have to ‘think’ to just get started I will opt out; it took me some time because your docs state nowhere how to import MikroORM

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
B4nancommented, Mar 17, 2020

I guess we can close this, added the note about esModuleInterop and type in the docs. Feel free to send more suggestions, ideally as concrete as possible.

1reaction
B4nancommented, Mar 17, 2020

Besides, do you think that supporting SQL is important? I mean, TypeORM excels in SQL-land, is still a bit maintained and supporting many different DBs is challenging (even Knex is full of inconsistencies).

Yes it is, I am sure there are more SQL users currently. Also I would not say that TypeORM excels in SQL land, I feel like the problems with TypeORM are pretty much driver independent. The point is that MikroORM gives you different approach (UoW), that is even more important for SQL than for mongo (although now we have transactions support in mongo too).

Really? It would be a breaking change then (just added type: ‘mongo’ 😉

Yes, that is why I said it will change in v4 and not in v3.5. Its a breaking change, therefore it will be part of major release. Having default value for this was a wrong decision.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Onboarding UX: Ultimate guide to designing for user experience
This user onboarding UX design prompts users to self-segment by selecting their own course of action, with each option leading to different first...
Read more >
First Impressions - a Guide to Onboarding UX - Toptal
User onboarding is a process of using onboarding UX patterns to introduce users to new apps, products, or features. By providing a good...
Read more >
What Is Onboarding UX? 9 Types of UX/UI Patterns - Whatfix
Onboarding UX is the design framework that guides new users through a product, reducing time-to-value. Learn about onboarding UX patterns ...
Read more >
Onboarding UX: Ultimate Guide to Designing for ... - Loop11
The user onboarding UX contains a guided introduction to the product, a guide on how they can set up some initial preferences, and...
Read more >
User Onboarding UX: A Comprehensive Guide | Userpeek.com
In this article, User Onboarding UX: A Comprehensive Guide, we will discuss making your users stay with you and continue using your product...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found