browserify / browserify/static-module

Transform which ran with v1 not working with v3

Offen
#48 16 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
75
Forks
22
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi! [cwise](https://github.com/scijs/cwise) has had some long-running issues/PRs to upgrade its usage of static-module and get rid of some security warnings, but it seems that the particular usage static-module is no longer functioning under static-module 3.*.

The [cwise transform](https://github.com/scijs/cwise/blob/master/lib/cwise-transform.js) finds references to `var cwise = require('cwise'); cwise({...})` and replaces them with evaluated code.

I'm guessing a bit, but it seems like maybe the usage as a bare function require as opposed to properties on the require (i.e. `require('cwise')(...)` as opposed to `require('fs).readFileSync(...)`) are not working.

FWIW, the transform has not changed and so _does_ still function and get triggered correctly.

I've detailed a test case [here](https://github.com/scijs/cwise/pull/25#issuecomment-442942342).

Glad to debug a bit further, but I'd thought I'd check to see if this might just need a small API usage update instead of involved debugging. Thanks!

/cc @archmoj @etpinard

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne mit lib/cwise-transform.js und dem in cwise pull request #25 beschriebenen Testfall und vergleiche anschließend, wie der Transform den bloßen Funktionsaufruf require unter static-module 3 behandelt. Bestätige, ob der Transform weiterhin ausgelöst wird, und identifiziere das relevante Verhalten der static-module-API. Erledigt ist die Aufgabe, wenn der verknüpfte cwise-Fall mit static-module 3 ohne Sicherheitswarnungen funktioniert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.