Skip to content

Commit

Permalink
Merge branch 'main' into @tjzel/version-checker
Browse files Browse the repository at this point in the history
  • Loading branch information
tjzel committed Aug 24, 2023
2 parents 4a107e0 + 27d54cf commit 4a86f30
Show file tree
Hide file tree
Showing 18 changed files with 447 additions and 313 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: software-mansion
2 changes: 2 additions & 0 deletions MacOSExample/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

ENV['REANIMATED_EXAMPLE_APP_NAME'] = 'MacOSExample-ios'

platform :ios, min_ios_version_supported
prepare_react_native_project!

Expand Down
2 changes: 2 additions & 0 deletions MacOSExample/macos/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require_relative '../node_modules/react-native-macos/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

ENV['REANIMATED_EXAMPLE_APP_NAME'] = 'MacOSExample-macos'

prepare_react_native_project!

target 'MacOSExample-macOS' do
Expand Down
113 changes: 67 additions & 46 deletions __tests__/__snapshots__/plugin.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,50 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`babel plugin doesn't capture arguments 1`] = `
"var _worklet_17093819837059_init_data = {
code: "function f(a,b,c){console.log(arguments);}",
location: "/dev/null",
sourceMap: "\\"mock source map\\"",
version: "x.y.z"
};
var f = function () {
var _e = [new global.Error(), 1, -27];
var f = function f(a, b, c) {
console.log(arguments);
};
f.__closure = {};
f.__initData = _worklet_17093819837059_init_data;
f.__workletHash = 17093819837059;
f.__stackDetails = _e;
return f;
}();"
`;

exports[`babel plugin doesn't capture objects' properties 1`] = `
"var foo = {
bar: 42
};
var _worklet_3750134465664_init_data = {
code: "function f(){const{foo}=this.__closure;console.log(foo.bar);}",
location: "/dev/null",
sourceMap: "\\"mock source map\\"",
version: "x.y.z"
};
var f = function () {
var _e = [new global.Error(), -2, -27];
var f = function f() {
console.log(foo.bar);
};
f.__closure = {
foo: foo
};
f.__initData = _worklet_3750134465664_init_data;
f.__workletHash = 3750134465664;
f.__stackDetails = _e;
return f;
}();"
`;

exports[`babel plugin for DirectiveLiterals doesn't bother other Directive Literals 1`] = `
"function foo() {
'foobar';
Expand Down Expand Up @@ -619,7 +574,48 @@ var f = function () {
}();"
`;

exports[`babel plugin for closure capturing doesn't capture globals 1`] = `
exports[`babel plugin for closure capturing doesn't capture arguments 1`] = `
"var _worklet_17093819837059_init_data = {
code: "function f(a,b,c){console.log(arguments);}",
location: "/dev/null",
sourceMap: "\\"mock source map\\"",
version: "x.y.z"
};
var f = function () {
var _e = [new global.Error(), 1, -27];
var f = function f(a, b, c) {
console.log(arguments);
};
f.__closure = {};
f.__initData = _worklet_17093819837059_init_data;
f.__workletHash = 17093819837059;
f.__stackDetails = _e;
return f;
}();"
`;

exports[`babel plugin for closure capturing doesn't capture custom globals 1`] = `
"var foo = 42;
var _worklet_7141086932261_init_data = {
code: "function f(){console.log(foo);}",
location: "/dev/null",
sourceMap: "\\"mock source map\\"",
version: "x.y.z"
};
var f = function () {
var _e = [new global.Error(), 1, -27];
var f = function f() {
console.log(foo);
};
f.__closure = {};
f.__initData = _worklet_7141086932261_init_data;
f.__workletHash = 7141086932261;
f.__stackDetails = _e;
return f;
}();"
`;

exports[`babel plugin for closure capturing doesn't capture default globals 1`] = `
"var _worklet_13298016111221_init_data = {
code: "function f(){console.log('test');}",
location: "/dev/null",
Expand All @@ -639,6 +635,31 @@ var f = function () {
}();"
`;

exports[`babel plugin for closure capturing doesn't capture objects' properties 1`] = `
"var foo = {
bar: 42
};
var _worklet_3750134465664_init_data = {
code: "function f(){const{foo}=this.__closure;console.log(foo.bar);}",
location: "/dev/null",
sourceMap: "\\"mock source map\\"",
version: "x.y.z"
};
var f = function () {
var _e = [new global.Error(), -2, -27];
var f = function f() {
console.log(foo.bar);
};
f.__closure = {
foo: foo
};
f.__initData = _worklet_3750134465664_init_data;
f.__workletHash = 3750134465664;
f.__stackDetails = _e;
return f;
}();"
`;

exports[`babel plugin for debugging does inject location for worklets in dev builds 1`] = `
"var _worklet_1852213185147_init_data = {
code: "function anonymous(){const x=1;}",
Expand Down
Loading

0 comments on commit 4a86f30

Please sign in to comment.