Skip to content

Refactor #1

@robocoder

Description

@robocoder

Copied from: scssphp/scssphp#2

Rationale:

  • the Server class is getting bloated
  • the Server class has too many public functions:
    • compileFile() - always recompiles
    • checkedCompile() - compiles scss if cache doesn't exist
    • checkCachedCompile() - recompiles if necessary
    • serve() - the original purpose of this class

Identified candidate cache implementations:

  • never - no caching; always (re)compiles
  • read - read only if cache exists; doesn't create
  • once - compiles only if cache doesn't exist
  • surface/shallow - recompile if main .scss file changes (note: this has no current API equivalent)
  • deep - recompile if main .scss file or any of its imports changes

Technical considerations:

  • bust up the Server class
  • Cache/*.php implementations
  • "deep" should detect changes in setVariables() and setImportPaths()

Other changes:

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