For me, my approach is a hybrid of both, but usually starting with (2). There’s no substitute for just getting something to just ‘work’, as your starting point, even if you don’t fully understand it.
You can then peel it apart little by little to see what’s going on under-the-hood.
That’s part of the magic of open source, and I’ve learned so much by building simple things, and then using step-by-step debugging to break ‘in’ to the framework to see what it’s doing.