Skip to content

Improve type safety #3082

@janbuchar

Description

@janbuchar
  • There are multiple opportunities throughout Crawlee to improve type safety and optionally introduce runtime validation:
    • Dataset items (CrawlingContext.pushData)
    • Key-value store content
    • Request.userData
    • Request routing labels
    • ? possibly somewhere else
  • One option is allowing the user to declare some special types (DatasetItem, RequestLabel, ...) in a .d.ts file and using it for type checking
  • A safer and more versatile approach would be to accept standard-schema models (either via BasicCrawler or Configuration) and infer the types from those
    • this would also add runtime validation (in contrast to the .d.ts approach which is more of a gentleman agreement)

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-toolingIssues with this label are in the ownership of the tooling team.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions