You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By contrast, SourceMapBuilder has a bunch of of get and set methods. Unfortunately the "flow" style won't work for e.g. add_source because it needs to return the source ID.
I would advocate for getting rid at least of the following methods:
get_file
get_source_root
get_source, set_source
get_source_contents
strip_prefixes (just do that before adding the sources)
I'm not entirely sure about set_source_contents and load_local_source_contents. Being able to set source contents after the fact might come in handy. But there's also something to be said for only setting everything once.
add/add_with_id/add_raw/add_token should probably condensed and/or cleaned up—it's not easy to understand the difference between them and why e.g. add takes both a source and a source_id parameter.
The text was updated successfully, but these errors were encountered:
This is part of #71.
In general I think the "nice" style of builder API is along the lines of
By contrast,
SourceMapBuilder
has a bunch of ofget
andset
methods. Unfortunately the "flow" style won't work for e.g.add_source
because it needs to return the source ID.I would advocate for getting rid at least of the following methods:
get_file
get_source_root
get_source
,set_source
get_source_contents
strip_prefixes
(just do that before adding the sources)I'm not entirely sure about
set_source_contents
andload_local_source_contents
. Being able to set source contents after the fact might come in handy. But there's also something to be said for only setting everything once.add
/add_with_id
/add_raw
/add_token
should probably condensed and/or cleaned up—it's not easy to understand the difference between them and why e.g.add
takes both asource
and asource_id
parameter.The text was updated successfully, but these errors were encountered: