Skip to content

Disable PhantomJS HTML parser by default #143

@robhrt7

Description

@robhrt7

In SourceJS 0.4 we introduced HTML API, that allows to cache the results of all code examples from the specs (.source_example blocks). Using this API via REST, engine allows to cover custom usage scenarios like testing code in environments where it's not possible to dynamically render HTML or using tools like Lego.

But since these scenarios are not that popular, we decided to turn off HTML parser by default, and in 0.6.0 transfer it to separate plugin (removing only parser part from core). REST API and HTML storage will be always available in the core, but to use PhantomJS parser, which allows to re-cache all the examples with the start of the app, or using cron, you will need to install separate SourceJS plugin.

In 0.5.3 feature will be still left in the core, but to enable it, you will need to define this option:

source/options.js

module.exports = {
    plugins: {
        htmlParser: {
            enabled: true,
            onStart: true
        }
    },
};

We still have big plans for HTML API in SourceJS, especially in combination with tools like Lego and others for designing in the browser, but to keep core clean we will be separating specific features to external plugins (with official support).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions