Giter VIP home page Giter VIP logo

Comments (7)

GottZ avatar GottZ commented on June 24, 2024

oh.. I've noticed this too and thought it's caused by code on their end.. I'll take a look again!
thanks for reporting.

from obsidian-dataview.

GottZ avatar GottZ commented on June 24, 2024

aparently we have a race condition here..
image
you can clearly see the breakpoint that hit first, so for some reason, the version compare excalibrain is asking for, is called before dataviewjs is initialized.

edit:

oooh.. I see why:

image

I got to find the cause of this.. brb..

from obsidian-dataview.

GottZ avatar GottZ commented on June 24, 2024

there ye go. that pull request should fix it.
@blacksmithgu after this issue is resolved we might need another public release, as this is actually breaking other plugins for an unknown reason.

I really have no clue how this code worked for years and is now breaking due to a change in execution order.
to me, this looks like a change in v8, which we can't do anything about.

from obsidian-dataview.

GottZ avatar GottZ commented on June 24, 2024

I think #2265 caused this.

from obsidian-dataview.

blacksmithgu avatar blacksmithgu commented on June 24, 2024

That seems most likely but very strange that an ES version bump would cause this, since it seems like a breaking change.

from obsidian-dataview.

GottZ avatar GottZ commented on June 24, 2024

That seems most likely but very strange that an ES version bump would cause this, since it seems like a breaking change.

I assume it was poly filling some part of it before.
I'll compare the compiled code later for a in-depth analysis.

right now, the js that is generated pretty much 100% reflects the typescript source.
if it was transpiling even the slightest, it could lead to other behavior.

I also decreased the compatibility boundary.
you could compile modern js to work in Internet Explorer but in this case, I made the lowest boundary also es2022

from obsidian-dataview.

GottZ avatar GottZ commented on June 24, 2024

ok.. found the cause, and as expected, it's precisely due to a compiler change:

this is before the ES2022 change:
image

this is after the ES2022 change:
image

the difference is simple.
we were on ES2018 before.
since ES2019, class members can be defined outside the constructor, thus the compiler moved them all out of the constructor.

anything outside the constructor obviously runs before the constructor is ran, making it a static default of the class. (essentially adding it to the prototype)

to reverse this behavior, it would either have to be inlined into the constructor or kept the way I changed it, so it refers to the current instance, and makes it a true, static member of the class:
image

in essence, for the javascript engine the 2022 spec is causing less in-memory fragmentation, thus the plugin now has a smaller memory footprint than before.
I can go in dept about engine optimizations now but just trust me on that. I know v8 pretty well.

now comparing all of it with the typescript source,
it makes sense, why it now is as it is:
image

from obsidian-dataview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.