Skip to content

Feat: ST support for .ejs (Embedded JavaScript templates) #2511

Open

Description

@matheusopessoa

Context

Running graphify update . on a Node/Express monorepo reports:

41 file(s) are classified as code but graphify has no AST extractor for their language, so they contributed nothing to the graph: .ejs (41). Please open an issue to request support for these (#1689).

All 41 files are server-rendered views in an Express app using EJS (res.render('dashboard', locals)).

Why it matters

In this stack, .ejs files are not “dumb HTML” — they often contain:

  • Embedded JavaScript logic (<% ... %>)
  • Inline <script> blocks with page-specific behavior
  • <%- include('partials/_page-header') %> composition
  • Route ↔ view coupling that is invisible to the graph when only .js route handlers are indexed

Without an extractor, queries like “what views does the inbox flow use?” or “where is _page-header included?” return incomplete subgraphs.

Example files

Typical patterns in our codebase:

Partial with locals + HTML output

<%
const _title = typeof title === 'string' && title ? title : ''
%>
<header class="page-header">
  <h1><%= _title %></h1>
  <% if (_subtitle) { %><p><%= _subtitle %></p><% } %>
</header>

Activity

  1. omsenjalia commented on Oct 18, 2026

    @omsenjalia
    Contributor

    This looks fixed on the v8 branch by 28938a47 (feat(extract): add EJS (.ejs) template extractor (#3811)). Could a maintainer confirm and close?

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

Metadata

Metadata

Assignees

No one assigned

    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