less / less/less.js

[To Do] Scope visitors added by `@plugin`

Open
#3,243 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

medium priority up-for-grabs
Dominant language
JavaScript
Stars
17k
Forks
3.4k
Avg merge
7h 42m
Merged PRs (30d)
26

Description

One thing the @plugin feature (plugins added/called from Less code) added was scoped functions. However, that scoping doesn't apply to visitors. So, if a plugin adds a visitor for nodes, those will apply to all subsequently visited nodes. A more library- / component-friendly approach would be to scope any "effects" of @plugin, including visitors and functions, to the @plugin scope.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue concerns the @plugin entry point and visitor handling; begin by tracing how plugins register visitors and how those visitors are applied to later nodes. Compare this with the existing function scoping, then establish tests showing visitor effects remain within the @plugin scope rather than affecting subsequently visited nodes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.