-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4be8ba
commit cceab7d
Showing
10 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
"@marko/translator-default": patch | ||
"@marko/compiler": patch | ||
"marko": patch | ||
--- | ||
|
||
Reduce script parsing restrictions added by Babel. | ||
This was causing Babel to error when parsing partion scripts. | ||
|
||
```marko | ||
static const x = 1; | ||
export { x }; | ||
``` | ||
|
||
Before this change in the above code Babel would error when parsing `export { x }` saying `x` was not previously defined. This is because Marko parses these statements in isolation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/translator-default/test/fixtures/exports/snapshots/cjs-expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"use strict"; | ||
|
||
exports.__esModule = true; | ||
exports.y = exports.x = exports.default = void 0; | ||
exports.z = z; | ||
var _index = require("marko/src/runtime/html/index.js"); | ||
var _renderer = _interopRequireDefault(require("marko/src/runtime/components/renderer.js")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const _marko_componentType = "packages/translator-default/test/fixtures/exports/template.marko", | ||
_marko_template = (0, _index.t)(_marko_componentType); | ||
var _default = _marko_template; | ||
exports.default = _default; | ||
const x = 1; | ||
exports.x = x; | ||
const y = 2; | ||
exports.y = y; | ||
function z() {} | ||
const _marko_component = {}; | ||
_marko_template._ = (0, _renderer.default)(function (input, out, _componentDef, _component, state, $global) {}, { | ||
t: _marko_componentType, | ||
i: true, | ||
d: true | ||
}, _marko_component); |
4 changes: 4 additions & 0 deletions
4
packages/translator-default/test/fixtures/exports/snapshots/generated-expected.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const x = 1; | ||
static const y = 2; | ||
export { y }; | ||
export function z() {} |
15 changes: 15 additions & 0 deletions
15
packages/translator-default/test/fixtures/exports/snapshots/html-expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { t as _t } from "marko/src/runtime/html/index.js"; | ||
const _marko_componentType = "packages/translator-default/test/fixtures/exports/template.marko", | ||
_marko_template = _t(_marko_componentType); | ||
export default _marko_template; | ||
export const x = 1; | ||
const y = 2; | ||
export { y }; | ||
export function z() {} | ||
import _marko_renderer from "marko/src/runtime/components/renderer.js"; | ||
const _marko_component = {}; | ||
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state, $global) {}, { | ||
t: _marko_componentType, | ||
i: true, | ||
d: true | ||
}, _marko_component); |
14 changes: 14 additions & 0 deletions
14
packages/translator-default/test/fixtures/exports/snapshots/htmlProduction-expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { t as _t } from "marko/dist/runtime/html/index.js"; | ||
const _marko_componentType = "NPJMtzPP", | ||
_marko_template = _t(_marko_componentType); | ||
export default _marko_template; | ||
export const x = 1; | ||
const y = 2; | ||
export { y }; | ||
export function z() {} | ||
import _marko_renderer from "marko/dist/runtime/components/renderer.js"; | ||
const _marko_component = {}; | ||
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state, $global) {}, { | ||
t: _marko_componentType, | ||
i: true | ||
}, _marko_component); |
Empty file.
19 changes: 19 additions & 0 deletions
19
packages/translator-default/test/fixtures/exports/snapshots/vdom-expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { t as _t } from "marko/src/runtime/vdom/index.js"; | ||
const _marko_componentType = "packages/translator-default/test/fixtures/exports/template.marko", | ||
_marko_template = _t(_marko_componentType); | ||
export default _marko_template; | ||
export const x = 1; | ||
const y = 2; | ||
export { y }; | ||
export function z() {} | ||
import _marko_renderer from "marko/src/runtime/components/renderer.js"; | ||
import { r as _marko_registerComponent } from "marko/src/runtime/components/registry"; | ||
_marko_registerComponent(_marko_componentType, () => _marko_template); | ||
const _marko_component = {}; | ||
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state, $global) {}, { | ||
t: _marko_componentType, | ||
i: true, | ||
d: true | ||
}, _marko_component); | ||
import _marko_defineComponent from "marko/src/runtime/components/defineComponent.js"; | ||
_marko_template.Component = _marko_defineComponent(_marko_component, _marko_template._); |
18 changes: 18 additions & 0 deletions
18
packages/translator-default/test/fixtures/exports/snapshots/vdomProduction-expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { t as _t } from "marko/dist/runtime/vdom/index.js"; | ||
const _marko_componentType = "NPJMtzPP", | ||
_marko_template = _t(_marko_componentType); | ||
export default _marko_template; | ||
export const x = 1; | ||
const y = 2; | ||
export { y }; | ||
export function z() {} | ||
import _marko_renderer from "marko/dist/runtime/components/renderer.js"; | ||
import { r as _marko_registerComponent } from "marko/dist/runtime/components/registry"; | ||
_marko_registerComponent(_marko_componentType, () => _marko_template); | ||
const _marko_component = {}; | ||
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state, $global) {}, { | ||
t: _marko_componentType, | ||
i: true | ||
}, _marko_component); | ||
import _marko_defineComponent from "marko/dist/runtime/components/defineComponent.js"; | ||
_marko_template.Component = _marko_defineComponent(_marko_component, _marko_template._); |
8 changes: 8 additions & 0 deletions
8
packages/translator-default/test/fixtures/exports/template.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const x = 1; | ||
|
||
static const y = 2; | ||
export { y }; | ||
|
||
export function z() { | ||
} |