Skip to content

❤️ Replace the Rhino based JavaScript engine ❤️ #755

Open

Description

@rbri

HtmlUnit uses a slightly modified version of the latest code of the Rhino (https://github.com/mozilla/rhino) js engine. During the years we also provide many fixes and improvements to the project (https://github.com/mozilla/rhino/commits/master/?author=rbri). Adding support for more modern js syntax is really hard, because Rhino tries to be backward compatible (for good reasons) (eg. mozilla/rhino#1431).

Therefore i like to try to switch to another javascript engine.

This will require time and effort - you can support this via

Will use this issue to inform about the progress.

Activity

  1. self-assigned this
    on Mar 27, 2024
  2. changed the title [-]Replace the Rhino based JavaScript engine[/-] [+]❤️ Replace the Rhino based JavaScript engine ❤️[/+] on Apr 28, 2024
  3. skyhirider commented on May 4, 2024

    @skyhirider
    Contributor

    Which engine(s) are you considering?

    And will you implement via ports & adapters where users will be able to choose which engine to use, or will you completely switch to a new one?

    Would be interesting to be able to hot swap the engine.

    For example, if I know a page is not working correctly with Rhino (live scrolling for example), I could hot swap to the other js engine before loading the page, do what I need to do and then hot swap back.

    Would allow for slow rollout as people would start using the new engine more and more as you work to refactor and integrate it while adding more js features and fixing issues.

  4. arjantijms commented on Jun 18, 2025

    @arjantijms

    Would it be an option to add a transpiler of some sort, to support newer js syntax?

  5. kincsescsaba commented on Jun 22, 2025

    @kincsescsaba

    Would it be an option to add a transpiler of some sort, to support newer js syntax?

    You can add a ScriptPreProcessor to do the transpilation to ES5: https://gist.github.com/kincsescsaba/a7f1b236c1be91e1529a9af8e31e4357

  6. rbri commented on Jun 24, 2025

    @rbri
    MemberAuthor

    This transpiler idea was suggested already in another issue, maybe i can add that feature based on the gist. There is also a special babel configuration for Rhino, this might also be helpful for that.

    At the moment i more focused on Rhino because so many things are going on, the project really moves forward and there is some hope to get more major features done soon.

  7. rbri commented on Sep 16, 2025

    @rbri
    MemberAuthor

    At the moment the rhino project moves really fast - there is hope for spread and also class support. Therefore i like to stay with rhino and see how it processes during the next months.
    Check the release notes to get an idea what has changed during the last months.

  8. ptrthomas commented on Sep 18, 2025

    @ptrthomas

    @rbri just curious if you have looked at https://github.com/roastedroot/quickjs4j
    also out of academic interest when you say spread support, can you point me to a discussion etc. to get an idea of what the current gaps are

  9. rbri commented on Sep 18, 2025

    @rbri
    MemberAuthor

    @ptrthomas currently on vacation, will come back to this in a week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions