-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconsider FluentResource instantiation #400
Comments
I'm fine with a constructor. If we'd make That'd match what I expect to end up doing in python, btw. I'm thinking along the lines of def Resource(content):
return parse(content) to create a |
Good idea with I think I'd prefer to not subclass Let's wait for @zbraniecki to chime in, too. |
yeah, sounds good to me. I'd consider the guts of |
Fixed in #401 on the release branch. |
In
fluent
0.12,FluentResource
is a subclass onMap
. It exposes a staticfromString
method which can be used to parse a new resource from a string. In #380, which will be released the upcomingfluent
0.13, I changedFluentResource
to extendArray
and I keptfromString
.I don't fully remember why there is
fromString
in the first place. I think it's related to how transpilers can't handle extending native constructors back to ES5. But since we don't target ES5 any more (#133), perhaps we don't need a separate static method?The reason why I wonder is that in a few examples of @zbraniecki's WebIDL experiemnts, I noticed he used a different API:
Should we consider switching to it? And related: should we keep
FluentResource
as a subclass ofArray
, or perhaps make it an independent class with a semi-private field called_messages
?CC @Pike.
The text was updated successfully, but these errors were encountered: