Skip to content

Commit

Permalink
add opera to browser feature table
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Feb 2, 2022
1 parent 8e81f43 commit fdb3e9d
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/esbuild/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var helpText = func(colors logger.Colors) string {
--sourcemap Emit a source map
--splitting Enable code splitting (currently only for esm)
--target=... Environment target (e.g. es2017, chrome58, firefox57,
safari11, edge16, node10, default esnext)
safari11, edge16, node10, opera45, default esnext)
--watch Watch mode: rebuild on file system changes
` + colors.Bold + `Advanced options:` + colors.Reset + `
Expand Down
39 changes: 39 additions & 0 deletions internal/compat/js_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const (
Firefox
IOS
Node
Opera
Safari
)

Expand All @@ -28,6 +29,8 @@ func (e Engine) String() string {
return "ios"
case Node:
return "node"
case Opera:
return "opera"
case Safari:
return "safari"
}
Expand Down Expand Up @@ -101,6 +104,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{36, 0, 0}}},
IOS: {{start: v{10, 0, 0}}},
Node: {{start: v{5, 0, 0}}},
Opera: {{start: v{33, 0, 0}}},
Safari: {{start: v{10, 0, 0}}},
},
Arrow: {
Expand All @@ -110,6 +114,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{45, 0, 0}}},
IOS: {{start: v{10, 0, 0}}},
Node: {{start: v{6, 0, 0}}},
Opera: {{start: v{36, 0, 0}}},
Safari: {{start: v{10, 0, 0}}},
},
AsyncAwait: {
Expand All @@ -119,6 +124,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{52, 0, 0}}},
IOS: {{start: v{11, 0, 0}}},
Node: {{start: v{7, 6, 0}}},
Opera: {{start: v{42, 0, 0}}},
Safari: {{start: v{11, 0, 0}}},
},
AsyncGenerator: {
Expand All @@ -128,6 +134,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{57, 0, 0}}},
IOS: {{start: v{12, 0, 0}}},
Node: {{start: v{10, 0, 0}}},
Opera: {{start: v{50, 0, 0}}},
Safari: {{start: v{12, 0, 0}}},
},
BigInt: {
Expand All @@ -137,6 +144,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{68, 0, 0}}},
IOS: {{start: v{14, 0, 0}}},
Node: {{start: v{10, 4, 0}}},
Opera: {{start: v{54, 0, 0}}},
Safari: {{start: v{14, 0, 0}}},
},
Class: {
Expand All @@ -146,6 +154,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{45, 0, 0}}},
IOS: {{start: v{10, 0, 0}}},
Node: {{start: v{6, 0, 0}}},
Opera: {{start: v{36, 0, 0}}},
Safari: {{start: v{10, 0, 0}}},
},
ClassField: {
Expand All @@ -154,6 +163,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{69, 0, 0}}},
IOS: {{start: v{14, 0, 0}}},
Node: {{start: v{12, 0, 0}}},
Opera: {{start: v{60, 0, 0}}},
Safari: {{start: v{14, 0, 0}}},
},
ClassPrivateAccessor: {
Expand All @@ -162,6 +172,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{90, 0, 0}}},
IOS: {{start: v{15, 0, 0}}},
Node: {{start: v{14, 6, 0}}},
Opera: {{start: v{70, 0, 0}}},
Safari: {{start: v{15, 0, 0}}},
},
ClassPrivateBrandCheck: {
Expand All @@ -170,6 +181,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{90, 0, 0}}},
IOS: {{start: v{15, 0, 0}}},
Node: {{start: v{16, 9, 0}}},
Opera: {{start: v{77, 0, 0}}},
Safari: {{start: v{15, 0, 0}}},
},
ClassPrivateField: {
Expand All @@ -178,6 +190,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{90, 0, 0}}},
IOS: {{start: v{15, 0, 0}}},
Node: {{start: v{14, 6, 0}}},
Opera: {{start: v{70, 0, 0}}},
Safari: {{start: v{14, 1, 0}}},
},
ClassPrivateMethod: {
Expand All @@ -186,6 +199,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{90, 0, 0}}},
IOS: {{start: v{15, 0, 0}}},
Node: {{start: v{14, 6, 0}}},
Opera: {{start: v{70, 0, 0}}},
Safari: {{start: v{15, 0, 0}}},
},
ClassPrivateStaticAccessor: {
Expand All @@ -194,6 +208,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{90, 0, 0}}},
IOS: {{start: v{15, 0, 0}}},
Node: {{start: v{14, 6, 0}}},
Opera: {{start: v{70, 0, 0}}},
Safari: {{start: v{15, 0, 0}}},
},
ClassPrivateStaticField: {
Expand All @@ -202,6 +217,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{90, 0, 0}}},
IOS: {{start: v{15, 0, 0}}},
Node: {{start: v{12, 0, 0}}},
Opera: {{start: v{62, 0, 0}}},
Safari: {{start: v{14, 1, 0}}},
},
ClassPrivateStaticMethod: {
Expand All @@ -210,6 +226,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{90, 0, 0}}},
IOS: {{start: v{15, 0, 0}}},
Node: {{start: v{14, 6, 0}}},
Opera: {{start: v{70, 0, 0}}},
Safari: {{start: v{15, 0, 0}}},
},
ClassStaticBlocks: {
Expand All @@ -222,6 +239,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{75, 0, 0}}},
IOS: {{start: v{15, 0, 0}}},
Node: {{start: v{12, 0, 0}}},
Opera: {{start: v{60, 0, 0}}},
Safari: {{start: v{14, 1, 0}}},
},
Const: {
Expand All @@ -231,6 +249,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{51, 0, 0}}},
IOS: {{start: v{11, 0, 0}}},
Node: {{start: v{6, 0, 0}}},
Opera: {{start: v{36, 0, 0}}},
Safari: {{start: v{11, 0, 0}}},
},
DefaultArgument: {
Expand All @@ -240,6 +259,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{53, 0, 0}}},
IOS: {{start: v{10, 0, 0}}},
Node: {{start: v{6, 0, 0}}},
Opera: {{start: v{36, 0, 0}}},
Safari: {{start: v{10, 0, 0}}},
},
Destructuring: {
Expand All @@ -249,6 +269,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{53, 0, 0}}},
IOS: {{start: v{10, 0, 0}}},
Node: {{start: v{6, 5, 0}}},
Opera: {{start: v{38, 0, 0}}},
Safari: {{start: v{10, 0, 0}}},
},
DynamicImport: {
Expand All @@ -267,6 +288,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{52, 0, 0}}},
IOS: {{start: v{10, 3, 0}}},
Node: {{start: v{7, 0, 0}}},
Opera: {{start: v{39, 0, 0}}},
Safari: {{start: v{10, 1, 0}}},
},
ExportStarAs: {
Expand All @@ -283,6 +305,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{57, 0, 0}}},
IOS: {{start: v{12, 0, 0}}},
Node: {{start: v{10, 0, 0}}},
Opera: {{start: v{50, 0, 0}}},
Safari: {{start: v{12, 0, 0}}},
},
ForOf: {
Expand All @@ -292,6 +315,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{53, 0, 0}}},
IOS: {{start: v{10, 0, 0}}},
Node: {{start: v{6, 5, 0}}},
Opera: {{start: v{38, 0, 0}}},
Safari: {{start: v{10, 0, 0}}},
},
Generator: {
Expand All @@ -301,6 +325,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{53, 0, 0}}},
IOS: {{start: v{10, 0, 0}}},
Node: {{start: v{6, 0, 0}}},
Opera: {{start: v{37, 0, 0}}},
Safari: {{start: v{10, 0, 0}}},
},
Hashbang: {
Expand All @@ -309,6 +334,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{67, 0, 0}}},
IOS: {{start: v{13, 4, 0}}},
Node: {{start: v{12, 0, 0}}},
Opera: {{start: v{62, 0, 0}}},
Safari: {{start: v{13, 1, 0}}},
},
ImportAssertions: {
Expand All @@ -330,6 +356,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{51, 0, 0}}},
IOS: {{start: v{11, 0, 0}}},
Node: {{start: v{6, 0, 0}}},
Opera: {{start: v{36, 0, 0}}},
Safari: {{start: v{11, 0, 0}}},
},
LogicalAssignment: {
Expand All @@ -339,6 +366,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{79, 0, 0}}},
IOS: {{start: v{14, 0, 0}}},
Node: {{start: v{15, 0, 0}}},
Opera: {{start: v{71, 0, 0}}},
Safari: {{start: v{14, 0, 0}}},
},
NestedRestBinding: {
Expand All @@ -348,6 +376,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{47, 0, 0}}},
IOS: {{start: v{10, 3, 0}}},
Node: {{start: v{6, 0, 0}}},
Opera: {{start: v{36, 0, 0}}},
Safari: {{start: v{10, 1, 0}}},
},
NewTarget: {
Expand All @@ -357,6 +386,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{41, 0, 0}}},
IOS: {{start: v{10, 0, 0}}},
Node: {{start: v{5, 0, 0}}},
Opera: {{start: v{33, 0, 0}}},
Safari: {{start: v{10, 0, 0}}},
},
NodeColonPrefixImport: {
Expand All @@ -372,6 +402,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{72, 0, 0}}},
IOS: {{start: v{13, 4, 0}}},
Node: {{start: v{14, 0, 0}}},
Opera: {{start: v{67, 0, 0}}},
Safari: {{start: v{13, 1, 0}}},
},
ObjectAccessors: {
Expand All @@ -381,6 +412,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{2, 0, 0}}},
IOS: {{start: v{6, 0, 0}}},
Node: {{start: v{0, 10, 0}}},
Opera: {{start: v{10, 10, 0}}},
Safari: {{start: v{3, 1, 0}}},
},
ObjectExtensions: {
Expand All @@ -390,12 +422,14 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{34, 0, 0}}},
IOS: {{start: v{10, 0, 0}}},
Node: {{start: v{4, 0, 0}}},
Opera: {{start: v{31, 0, 0}}},
Safari: {{start: v{10, 0, 0}}},
},
ObjectRestSpread: {
ES: {{start: v{2018, 0, 0}}},
Firefox: {{start: v{55, 0, 0}}},
IOS: {{start: v{11, 3, 0}}},
Opera: {{start: v{47, 0, 0}}},
Safari: {{start: v{11, 1, 0}}},
},
OptionalCatchBinding: {
Expand All @@ -405,6 +439,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{58, 0, 0}}},
IOS: {{start: v{11, 3, 0}}},
Node: {{start: v{10, 0, 0}}},
Opera: {{start: v{53, 0, 0}}},
Safari: {{start: v{11, 1, 0}}},
},
OptionalChain: {
Expand All @@ -414,6 +449,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{74, 0, 0}}},
IOS: {{start: v{13, 4, 0}}},
Node: {{start: v{16, 9, 0}}},
Opera: {{start: v{77, 0, 0}}},
Safari: {{start: v{13, 1, 0}}},
},
RestArgument: {
Expand All @@ -423,6 +459,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{43, 0, 0}}},
IOS: {{start: v{10, 0, 0}}},
Node: {{start: v{6, 0, 0}}},
Opera: {{start: v{34, 0, 0}}},
Safari: {{start: v{10, 0, 0}}},
},
TemplateLiteral: {
Expand All @@ -432,6 +469,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{34, 0, 0}}},
IOS: {{start: v{9, 0, 0}}},
Node: {{start: v{4, 0, 0}}},
Opera: {{start: v{28, 0, 0}}},
Safari: {{start: v{9, 0, 0}}},
},
TopLevelAwait: {
Expand All @@ -448,6 +486,7 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{
Firefox: {{start: v{53, 0, 0}}},
IOS: {{start: v{9, 0, 0}}},
Node: {{start: v{4, 0, 0}}},
Opera: {{start: v{31, 0, 0}}},
Safari: {{start: v{9, 0, 0}}},
},
}
Expand Down
1 change: 1 addition & 0 deletions pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ const (
EngineFirefox
EngineIOS
EngineNode
EngineOpera
EngineSafari
)

Expand Down
2 changes: 2 additions & 0 deletions pkg/api/api_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ func validateFeatures(log logger.Log, target Target, engines []Engine) (config.T
constraints[compat.IOS] = version
case EngineNode:
constraints[compat.Node] = version
case EngineOpera:
constraints[compat.Opera] = version
case EngineSafari:
constraints[compat.Safari] = version
default:
Expand Down
7 changes: 4 additions & 3 deletions pkg/cli/cli_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -777,11 +777,12 @@ func parseTargets(targets []string, arg string) (target api.Target, engines []ap

validEngines := map[string]api.EngineName{
"chrome": api.EngineChrome,
"firefox": api.EngineFirefox,
"safari": api.EngineSafari,
"edge": api.EngineEdge,
"node": api.EngineNode,
"firefox": api.EngineFirefox,
"ios": api.EngineIOS,
"node": api.EngineNode,
"opera": api.EngineOpera,
"safari": api.EngineSafari,
}

outer:
Expand Down
1 change: 1 addition & 0 deletions scripts/compat-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const engines = [
'firefox',
'ios',
'node',
'opera',
'safari',
]

Expand Down

0 comments on commit fdb3e9d

Please sign in to comment.