Skip to content
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

Migration to Jint v3 #84

Closed
Neshram opened this issue Nov 9, 2022 · 3 comments · Fixed by #89
Closed

Migration to Jint v3 #84

Neshram opened this issue Nov 9, 2022 · 3 comments · Fixed by #89
Milestone

Comments

@Neshram
Copy link

Neshram commented Nov 9, 2022

Greetings,

Have there been any official efforts on migrating Jint v3? Or is that awaiting Jint v3 eventually leaving "beta" state?

I did some quick poking around and it looks like at minimum Jint has made a lot of member access modifiers more restrictive, including changing IConstructor from public to internal.

@FlorianRappl
Copy link
Contributor

Have there been any official efforts on migrating Jint v3?

Not yet.

Or is that awaiting Jint v3 eventually leaving "beta" state?

Yes - this is the case.

@tomvanenckevort
Copy link
Contributor

tomvanenckevort commented Jan 31, 2024

Now that Jint v3 has been released, this might become relevant again.
I understand from another comment that AngleSharp.Js is currently not getting official attention, so I'm not expecting an upgrade anytime soon (completely understandable).

I wouldn't mind having a crack at it myself. But after locally trying to update the Nuget reference to Jint in the project, I can see there are a lot of breaking changes that need fixing.

I'm not that familiar with the Jint and AngleSharp.Js codebases, so it might be useful to give some pointers on what needs to be done?

@FlorianRappl
Copy link
Contributor

Actually it might be better to essentially start from scratch.

I think a good roadmap / development agenda would be:

  1. Have a plain integration of Jint (i.e., just create a context, evaluate things, ...)
  2. Have it integrated in a way that scripts are evaluated / run in Jint
  3. Have the actual DOM coupled / exposed within the context / Jint

Usually, (3) is where it gets difficult. AngleSharp itself provides helpers for this (and depending on the approach the current code base still has / uses all these helpers): Attributes that indicate what and if so, how certain things should be used, e.g., that InnerHtml on IDocument is innerHTML in JavaScript or how constructors (e.g., of CustomEvent) should be delegated.

There are two approaches to bring the two together:

  1. Dynamically, i.e., at runtime read out the available / integrated AngleSharp libraries, get their attributes and do everything (potentially creating a cache / map of items to speed up this process for other contexts)
  2. Statically, i.e., already at build-time figure out these things and have it pre-wired.

Right now the codebase uses (1) as (2) might be problematic regarding updates and maintainability.

I also have Jint v3 on the radar and I am happy that finally v3 was released. I would be super happy to spend some time on this; but right now I focus the little time I have for AngleSharp on making AngleSharp.Css a 1.0.0. More contributors or sponsors would certainly help to either get more work done quickly or have more time for this project.

@tomvanenckevort tomvanenckevort mentioned this issue Feb 28, 2024
9 tasks
@FlorianRappl FlorianRappl linked a pull request Feb 28, 2024 that will close this issue
9 tasks
@FlorianRappl FlorianRappl added this to the v1.0 milestone Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants