Problem 1: Using parse5 in browsers, ReactNative, etc.
According to recent reports (#225, #220, #234, #226, #202, #213) people try to use parse5 in various environments that are distinct from Node.js. parse5 core functionality doesn't use any platform-specific API, however some advanced features like streaming support depend on Node.js API which renders parse5 unusable in other environments.
Problem 2: TypeScript typings
The other problem is the immaturity of TypeScript type dependencies distribution system, starting from vague semi-official recommendations from development team of how such dependencies should be managed and ending with the mutually exclusive issues that this suggested approach causes: #212, #232.
The Big Plan
- Transform parse5 into set of packages. Core parsing functionality will remain in parse5 package. Any advanced functionality will be distributed in separate packages (e.g.
parse5-sax, parse5-parse-stream) with a peer dependency on core package.
- Each package will have it's own TypeScript typings.
- Move Node.js typings dependency to
devDependencies and document that in order to use parse5 typing one need to install Node.js typings.
- Raise issue regarding types distribution in TypeScript repo
Ad-hoc solution for now
Unfortunately, there are several blockers that prevent us from implementing The Big Plan at the moment:
So suggested solution for now is:
If everyone involved in aforementioned conversations is fine with the proposed solutions then I can roll out ad-hoc solution somewhere on weekend.
Milestones
Problem 1: Using parse5 in browsers, ReactNative, etc.
According to recent reports (#225, #220, #234, #226, #202, #213) people try to use parse5 in various environments that are distinct from Node.js. parse5 core functionality doesn't use any platform-specific API, however some advanced features like streaming support depend on Node.js API which renders parse5 unusable in other environments.
Problem 2: TypeScript typings
The other problem is the immaturity of TypeScript type dependencies distribution system, starting from vague semi-official recommendations from development team of how such dependencies should be managed and ending with the mutually exclusive issues that this suggested approach causes: #212, #232.
The Big Plan
parse5-sax,parse5-parse-stream) with a peer dependency on core package.devDependenciesand document that in order to use parse5 typing one need to install Node.js typings.Ad-hoc solution for now
Unfortunately, there are several blockers that prevent us from implementing The Big Plan at the moment:
So suggested solution for now is:
typesfield frompackage.json, but still distribute typings within the package but suggest approach recommended by @fictitious in Move @types/node from runtime deps to dev deps #226 (comment) to enable them.If everyone involved in aforementioned conversations is fine with the proposed solutions then I can roll out ad-hoc solution somewhere on weekend.
Milestones
-instead of-.@typesrepostartCol,endCol,startLine,endLinescriptingEnabledflag #192