Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

[WIP] Update React Native to 0.57.4 #1210

Closed
wants to merge 24 commits into from
Closed

[WIP] Update React Native to 0.57.4 #1210

wants to merge 24 commits into from

Conversation

orta
Copy link
Contributor

@orta orta commented Oct 30, 2018

Re: LD-22

This is just step 1, the module + types but it's momentum. Will keep working on this branch.
Step 2 is done: having it run.

screen shot 2018-10-31 at 3 28 02 pm

@peril-staging
Copy link
Contributor

peril-staging bot commented Oct 30, 2018

Warnings
⚠️ It looks like code was changed without adding anything to the Changelog.
You can add #trivial in the PR body to skip the check.

New dependencies added: @babel/core, @babel/plugin-proposal-class-properties, @babel/plugin-proposal-decorators, @babel/plugin-transform-runtime, @babel/preset-typescript, @babel/runtime, babel-core and metro-react-native-babel-preset.

@babel/core

Author: Sebastian McKenzie

Description: Babel compiler core.

Homepage: https://babeljs.io/

Createdabout 1 year ago
Last Updated9 days ago
LicenseMIT
Maintainers5
Releases42
Direct Dependencies@babel/code-frame, @babel/generator, @babel/helpers, @babel/parser, @babel/template, @babel/traverse, @babel/types, convert-source-map, debug, json5, lodash, resolve, semver and source-map
Keywords6to5, babel, classes, const, es6, harmony, let, modules, transpile, transpiler, var, babel-core and compiler
README

@babel/core

Babel compiler core.

See our website @babel/core for more information or the issues associated with this package.

Install

Using npm:

npm install --save-dev @babel/core

or using yarn:

yarn add @babel/core --dev

@babel/plugin-proposal-class-properties

Author: Unknown

Description: This plugin transforms static class properties as well as properties declared with the property initializer syntax

Homepage: http://npmjs.com/package/@babel/plugin-proposal-class-properties

Createdabout 1 year ago
Last Updated8 days ago
LicenseMIT
Maintainers5
Releases37
Direct Dependencies@babel/helper-create-class-features-plugin and @babel/helper-plugin-utils
Keywordsbabel-plugin
README

@babel/plugin-proposal-class-properties

This plugin transforms static class properties as well as properties declared with the property initializer syntax

See our website @babel/plugin-proposal-class-properties for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-proposal-class-properties

or using yarn:

yarn add @babel/plugin-proposal-class-properties --dev

@babel/plugin-proposal-decorators

Author: Logan Smyth

Description: Compile class and object decorators to ES5

Homepage: http://npmjs.com/package/@babel/plugin-proposal-decorators

Createdabout 1 year ago
Last Updated9 days ago
LicenseMIT
Maintainers5
Releases39
Direct Dependencies@babel/helper-plugin-utils, @babel/helper-replace-supers, @babel/helper-split-export-declaration and @babel/plugin-syntax-decorators
Keywordsbabel, babel-plugin and decorators
README

@babel/plugin-proposal-decorators

Compile class and object decorators to ES5

See our website @babel/plugin-proposal-decorators for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-proposal-decorators

or using yarn:

yarn add @babel/plugin-proposal-decorators --dev

@babel/plugin-transform-runtime

Author: Unknown

Description: Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals

Homepage: http://npmjs.com/package/@babel/plugin-transform-runtime

Createdabout 1 year ago
Last Updated9 days ago
LicenseMIT
Maintainers5
Releases36
Direct Dependencies@babel/helper-module-imports, @babel/helper-plugin-utils, resolve and semver
Keywordsbabel-plugin
README

@babel/plugin-transform-runtime

Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals

See our website @babel/plugin-transform-runtime for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-transform-runtime

or using yarn:

yarn add @babel/plugin-transform-runtime --dev

@babel/preset-typescript

Author: Unknown

Description: Babel preset for TypeScript.

Homepage: http://npmjs.com/package/@babel/preset-typescript

Createdabout 1 year ago
Last Updated29 days ago
LicenseMIT
Maintainers5
Releases35
Direct Dependencies@babel/helper-plugin-utils and @babel/plugin-transform-typescript
Keywordsbabel-preset and typescript
README

@babel/preset-typescript

Babel preset for TypeScript.

See our website @babel/preset-typescript for more information or the issues associated with this package.

Install

Using npm:

npm install --save-dev @babel/preset-typescript

or using yarn:

yarn add @babel/preset-typescript --dev

@babel/runtime

Author: Sebastian McKenzie

Description: babel's modular runtime helpers

Homepage: http://npmjs.com/package/@babel/runtime

Createdabout 1 year ago
Last Updated9 days ago
LicenseMIT
Maintainers5
Releases38
Direct Dependenciesregenerator-runtime
README

@babel/runtime

babel's modular runtime helpers

See our website @babel/runtime for more information.

Install

Using npm:

npm install --save-dev @babel/runtime

or using yarn:

yarn add @babel/runtime --dev

babel-core

Author: Sebastian McKenzie

Description: Babel compiler core.

Homepage: https://babeljs.io/

Createdalmost 4 years ago
Last Updated2 months ago
LicenseMIT
Maintainers4
Releases257
Direct Dependenciesbabel-code-frame, babel-generator, babel-helpers, babel-messages, babel-register, babel-runtime, babel-template, babel-traverse, babel-types, babylon, convert-source-map, debug, json5, lodash, minimatch, path-is-absolute, private, slash and source-map
Keywords6to5, babel, classes, const, es6, harmony, let, modules, transpile, transpiler, var, babel-core and compiler
README

babel-core

Babel compiler core.

var babel = require("babel-core");
import { transform } from 'babel-core';
import * as babel from 'babel-core';

All transformations will use your local configuration files (.babelrc or in package.json). See options to disable it.

babel.transform(code: string, options?: Object)

Transforms the passed in code. Returning an object with the generated code,
source map, and AST.

babel.transform(code, options) // => { code, map, ast }

Example

var result = babel.transform("code();", options);
result.code;
result.map;
result.ast;

babel.transformFile(filename: string, options?: Object, callback: Function)

Asynchronously transforms the entire contents of a file.

babel.transformFile(filename, options, callback)

Example

babel.transformFile("filename.js", options, function (err, result) {
  result; // => { code, map, ast }
});

babel.transformFileSync(filename: string, options?: Object)

Synchronous version of babel.transformFile. Returns the transformed contents of
the filename.

babel.transformFileSync(filename, options) // => { code, map, ast }

Example

babel.transformFileSync("filename.js", options).code;

babel.transformFromAst(ast: Object, code?: string, options?: Object)

Given, an AST, transform it.

const code = "if (true) return;";
const ast = babylon.parse(code, { allowReturnOutsideFunction: true });
const { code, map, ast } = babel.transformFromAst(ast, code, options);

Options

Babel CLI

You can pass these options from the Babel CLI like so:

babel --name=value

Following is a table of the options you can use:

Option Default Description
ast true Include the AST in the returned object
auxiliaryCommentAfter null Attach a comment after all non-user injected code.
auxiliaryCommentBefore null Attach a comment before all non-user injected code.
babelrc true Specify whether or not to use .babelrc and .babelignore files. Not available when using the CLI, use --no-babelrc instead.
code true Enable code generation
comments true Output comments in generated output.
compact "auto" Do not include superfluous whitespace characters and line terminators. When set to "auto" compact is set to true on input sizes of >500KB.
env {} This is an object of keys that represent different environments. For example, you may have: { env: { production: { /* specific options */ } } } which will use those options when the environment variable BABEL_ENV is set to "production". If BABEL_ENV isn't set then NODE_ENV will be used, if it's not set then it defaults to "development"
extends null A path to an .babelrc file to extend
filename "unknown" Filename for use in errors etc.
filenameRelative (filename) Filename relative to sourceRoot.
generatorOpts {} An object containing the options to be passed down to the babel code generator, babel-generator
getModuleId null Specify a custom callback to generate a module id with. Called as getModuleId(moduleName). If falsy value is returned then the generated module id is used.
highlightCode true ANSI highlight syntax error code frames
ignore null Opposite to the only option. ignore is disregarded if only is specified.
inputSourceMap null A source map object that the output source map will be based on.
minified false Should the output be minified (not printing last semicolons in blocks, printing literal string values instead of escaped ones, stripping () from new when safe)
moduleId null Specify a custom name for module ids.
moduleIds false If truthy, insert an explicit id for modules. By default, all modules are anonymous. (Not available for common modules)
moduleRoot (sourceRoot) Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions.
only null A glob, regex, or mixed array of both, matching paths to only compile. Can also be an array of arrays containing paths to explicitly match. When attempting to compile a non-matching file it's returned verbatim.
parserOpts {} An object containing the options to be passed down to the babel parser, babylon
plugins [] List of plugins to load and use.
presets [] List of presets (a set of plugins) to load and use.
retainLines false Retain line numbers. This will lead to wacky code but is handy for scenarios where you can't use source maps. (NOTE: This will not retain the columns)
resolveModuleSource null Resolve a module source ie. import "SOURCE"; to a custom value. Called as resolveModuleSource(source, filename).
shouldPrintComment null An optional callback that controls whether a comment should be output or not. Called as shouldPrintComment(commentContents). NOTE: This overrides the comment option when used.
sourceFileName (filenameRelative) Set sources[0] on returned source map.
sourceMaps false If truthy, adds a map property to returned output. If set to "inline", a comment with a sourceMappingURL directive is added to the bottom of the returned code. If set to "both" then a map property is returned as well as a source map comment appended. This does not emit sourcemap files by itself! To have sourcemaps emitted using the CLI, you must pass it the --source-maps option.
sourceMapTarget (filenameRelative) Set file on returned source map.
sourceRoot (moduleRoot) The root from which all sources are relative.
sourceType "module" Indicate the mode the code should be parsed in. Can be either "script" or "module".
wrapPluginVisitorMethod null An optional callback that can be used to wrap visitor methods. NOTE: This is useful for things like introspection, and not really needed for implementing anything. Called as wrapPluginVisitorMethod(pluginAlias, visitorType, callback).

metro-react-native-babel-preset

Author: Unknown

Description: Babel preset for React Native applications

Homepage: https://github.com/facebook/metro#readme

Created6 months ago
Last Updatedabout 5 hours ago
LicenseMIT
Maintainers1
Releases31
Direct Dependencies@babel/plugin-proposal-class-properties, @babel/plugin-proposal-export-default-from, @babel/plugin-proposal-nullish-coalescing-operator, @babel/plugin-proposal-object-rest-spread, @babel/plugin-proposal-optional-catch-binding, @babel/plugin-proposal-optional-chaining, @babel/plugin-syntax-dynamic-import, @babel/plugin-syntax-export-default-from, @babel/plugin-transform-arrow-functions, @babel/plugin-transform-block-scoping, @babel/plugin-transform-classes, @babel/plugin-transform-computed-properties, @babel/plugin-transform-destructuring, @babel/plugin-transform-exponentiation-operator, @babel/plugin-transform-flow-strip-types, @babel/plugin-transform-for-of, @babel/plugin-transform-function-name, @babel/plugin-transform-literals, @babel/plugin-transform-modules-commonjs, @babel/plugin-transform-object-assign, @babel/plugin-transform-parameters, @babel/plugin-transform-react-display-name, @babel/plugin-transform-react-jsx, @babel/plugin-transform-react-jsx-source, @babel/plugin-transform-regenerator, @babel/plugin-transform-runtime, @babel/plugin-transform-shorthand-properties, @babel/plugin-transform-spread, @babel/plugin-transform-sticky-regex, @babel/plugin-transform-template-literals, @babel/plugin-transform-typescript, @babel/plugin-transform-unicode-regex, @babel/template, metro-babel7-plugin-react-transform and react-transform-hmr
Keywordsbabel, preset and react-native
README

metro-react-native-babel-preset

Babel presets for React Native applications. React Native itself uses this Babel preset by default when transforming your app's source code.

If you wish to use a custom Babel configuration by writing a .babelrc file in your project's root directory, you must specify all the plugins necessary to transform your code. React Native does not apply its default Babel configuration in this case. So, to make your life easier, you can use this preset to get the default configuration and then specify more plugins that run before it.

Usage

As mentioned above, you only need to use this preset if you are writing a custom .babelrc file.

Installation

Install metro-react-native-babel-preset in your app:

npm i metro-react-native-babel-preset --save-dev

Configuring Babel

Then, create a file called .babelrc in your project's root directory. The existence of this .babelrc file will tell React Native to use your custom Babel configuration instead of its own. Then load this preset:

{
  "presets": ["module:metro-react-native-babel-preset"]
}

You can further customize your Babel configuration by specifying plugins and other options. See Babel's .babelrc documentation to learn more.

Help and Support

If you get stuck configuring Babel, please ask a question on Stack Overflow or find a consultant for help. If you discover a bug, please open up an issue.

Generated by 🚫 dangerJS

@DangerCI
Copy link

DangerCI commented Oct 31, 2018

Fails
🚫

No CHANGELOG added.

🚫

🃏 FAIL in index-tests.tsx

🚫

🃏 FAIL in ActiveBid-tests.tsx

🚫

🃏 FAIL in SelectCountry-tests.tsx

🚫

🃏 FAIL in ZeroStateInbox-tests.tsx

🚫

🃏 FAIL in Notification-tests.tsx

🚫

🃏 FAIL in Biography-tests.tsx

🚫

🃏 FAIL in ArtistShow-tests.tsx

🚫

🃏 FAIL in Input-tests.tsx

🚫

🃏 FAIL in renderUntil-tests.tsx

🚫

🃏 FAIL in SelectMaxBidEdit-tests.tsx

🚫

🃏 FAIL in SaleArtworksGrid-tests.tsx

🚫

🃏 FAIL in ArtworkPreview-tests.tsx

🚫

🃏 FAIL in ImageSelection-tests.tsx

🚫

🃏 FAIL in Overview-analytics-tests.tsx

🚫

🃏 FAIL in MyProfile-tests.tsx

🚫

🃏 FAIL in Location-tests.tsx

🚫

🃏 FAIL in Generic-grid-tests.tsx

🚫

🃏 FAIL in SavedItemRow-tests.tsx

🚫

🃏 FAIL in InvertedButton-tests.tsx

🚫

🃏 FAIL in NavigationButton-tests.tsx

🚫

🃏 FAIL in Carousel-tests.tsx

🚫

🃏 FAIL in ConversationSnippet-tests.tsx

🚫

🃏 FAIL in ImagePreview-tests.tsx

🚫

🃏 FAIL in Provenance-tests.tsx

🚫

🃏 FAIL in SaleListItem-tests.tsx

🚫

🃏 FAIL in BottomAlignedButton-tests.tsx

🚫

🃏 FAIL in MarketingHeader-tests.tsx

🚫

🃏 FAIL in index-tests.tsx

🚫

🃏 FAIL in InvoicePreview-tests.tsx

🚫

🃏 FAIL in Overview-local-storage-tests.tsx

🚫

🃏 FAIL in About-tests.tsx

🚫

🃏 FAIL in SmallList-tests.tsx

🚫

🃏 FAIL in InfiniteScrollGrid-tests.tsx

🚫

🃏 FAIL in Messages-tests.tsx

🚫

🃏 FAIL in TextInput-tests.tsx

🚫

🃏 FAIL in Message-tests.tsx

🚫

🃏 FAIL in CircleImage-tests.tsx

🚫

🃏 FAIL in RegistrationResult-tests.tsx

🚫

🃏 FAIL in ShowPreview-tests.tsx

🚫

🃏 FAIL in index-tests.tsx

🚫

🃏 FAIL in PDFPreview-tests.tsx

🚫

🃏 FAIL in fetchQuery-tests.ts

🚫

🃏 FAIL in PrimaryBlack-tests.tsx

🚫

🃏 FAIL in DarkNavigationButton-tests.tsx

🚫

🃏 FAIL in Article-tests.tsx

🚫

🃏 FAIL in utils-tests.tsx

🚫

🃏 FAIL in Modal-tests.tsx

🚫

🃏 FAIL in Artwork-tests.tsx

🚫

🃏 FAIL in TabBar-tests.tsx

🚫

🃏 FAIL in Edition-tests.tsx

🚫

🃏 FAIL in index-tests.tsx

🚫

🃏 FAIL in MaxBidPicker-tests.tsx

🚫

🃏 FAIL in Layout-tests.tsx

🚫

🃏 FAIL in Artist-tests.tsx

🚫

🃏 FAIL in Button-tests.tsx

🚫

🃏 FAIL in Markdown-tests.tsx

🚫

🃏 FAIL in Metadata-tests.tsx

🚫

🃏 FAIL in index-tests.tsx

🚫

🃏 FAIL in Biography-tests.tsx

🚫

🃏 FAIL in FairsRail-tests.tsx

🚫

🃏 FAIL in CaretButton-tests.tsx

🚫

🃏 FAIL in TimeOffsetProvider-tests.tsx

🚫

🃏 FAIL in index-tests.tsx

🚫

🃏 FAIL in PaymentInfo-tests.tsx

🚫

🃏 FAIL in Chip-tests.tsx

🚫

🃏 FAIL in Confirmation-tests.tsx

🚫

🃏 FAIL in ConsignmentBG-tests.tsx

🚫

🃏 FAIL in BidFlow-tests.tsx

🚫

🃏 FAIL in geminiUploadToS3-tests.ts

🚫

🃏 FAIL in Articles-tests.tsx

🚫

🃏 FAIL in ZeroState-tests.tsx

🚫

🃏 FAIL in LotsByFollowedArtists-tests.tsx

🚫

🃏 FAIL in create-tests.ts

🚫

🃏 FAIL in Metadata-tests.tsx

🚫

🃏 FAIL in Header-tests.tsx

🚫

🃏 FAIL in SelectFromPhotoLibrary-tests.tsx

🚫

🃏 FAIL in TabView-tests.tsx

🚫

🃏 FAIL in Checkbox-tests.tsx

🚫

🃏 FAIL in ConnectivityBanner-tests.tsx

🚫

🃏 FAIL in SearchResults-tests.tsx

🚫

🃏 FAIL in uploadPhotoToGemini-tests.ts

🚫

🃏 FAIL in ArtworkCarouselHeader-tests.tsx

🚫

🃏 FAIL in Avatar-tests.tsx

🚫

🃏 FAIL in Welcome-tests.tsx

🚫

🃏 FAIL in index-tests.tsx

🚫

🃏 FAIL in ArtistCard-tests.tsx

🚫

🃏 FAIL in index-tests.tsx

🚫

🃏 FAIL in Overview-uploading-tests.tsx

🚫

🃏 FAIL in metaphysics-tests.ts

🚫

🃏 FAIL in CreditCardForm-tests.tsx

🚫

🃏 FAIL in ArtistArtworksGrid-tests.tsx

🚫

🃏 FAIL in Artist-tests.tsx

🚫

🃏 FAIL in GeneArtworksGrid-tests.tsx

🚫

🃏 FAIL in VariableSizeShowsList-tests.tsx

🚫

🃏 FAIL in index-tests.tsx

🚫

🃏 FAIL in SelectMaxBid-tests.tsx

🚫

🃏 FAIL in FormElements-tests.tsx

🚫

🃏 FAIL in BidResult-tests.tsx

🚫

🃏 FAIL in Title-tests.tsx

🚫

🃏 FAIL in ArtworkConsignmentTodo-tests.tsx

🚫

🃏 FAIL in objectToGraphQL-tests.ts

🚫

🃏 FAIL in Sale-tests.tsx

🚫

🃏 FAIL in TextArea-tests.tsx

🚫

🃏 FAIL in ArtworkRail-tests.tsx

🚫

🃏 FAIL in Header-tests.tsx

🚫

🃏 FAIL in RegistrationFlow-tests.tsx

🚫

🃏 FAIL in Toggle-tests.tsx

🚫

🃏 FAIL in renderWithLoadProgress-tests.tsx

🚫

🃏 FAIL in Artworks-tests.tsx

🚫

🃏 FAIL in Gene-tests.tsx

🚫

🃏 FAIL in consignmentSetupToSubmission-tests.ts

🚫

🃏 FAIL in BillingAddress-tests.tsx

🚫

🃏 FAIL in About-tests.tsx

🚫

🃏 FAIL in Inquiry-tests.tsx

🚫

🃏 FAIL in index-tests.tsx

🚫

🃏 FAIL in BidFlow-tests.tsx

🚫

🃏 FAIL in update-tests.ts

🚫

🃏 FAIL in index-tests.tsx

🚫

🃏 FAIL in index-tests.ts

🚫

🃏 FAIL in Timer-tests.tsx

🚫

🃏 FAIL in track-tests.ts

🚫

🃏 FAIL in Conversations-tests.tsx

🚫

🃏 FAIL in SaleList-tests.tsx

🚫

🃏 FAIL in Inbox-tests.tsx

🚫

🃏 FAIL in Separator-tests.tsx

🚫

🃏 FAIL in WorksForYou-tests.tsx

🚫

🃏 FAIL in ScrollView-tests.tsx

🚫

🃏 FAIL in index-tests.tsx

🚫

🃏 FAIL in router-tests.ts

🚫

🃏 FAIL in index-tests.tsx

🚫

🃏 FAIL in SectionHeader-tests.tsx

🚫

🃏 FAIL in Conversation-tests.tsx

🚫

🃏 FAIL in Header-tests.tsx

🚫

🃏 FAIL in Registration-tests.tsx

🚫

🃏 FAIL in isCloseToBottom-tests.ts

🚫

🃏 FAIL in renderRelayTree-tests.tsx

🚫

🃏 FAIL in StoryBrowser-tests.tsx

🚫

🃏 FAIL in Overview-tests.tsx

🚫

🃏 FAIL in SectionBrowser-tests.tsx

🚫

🃏 FAIL in ConfirmBid-tests.tsx

🚫

🃏 FAIL in SectionTitle-tests.tsx

🚫

Missing Test Files:

  • src/lib/Components/Home/__tests__/SectionTitle-tests.tsx
  • src/lib/Components/Inbox/Conversations/__tests__/index-tests.tsx
  • src/lib/Components/__tests__/OpaqueImageView-tests.tsx
  • src/lib/utils/track/__tests__/index-tests.ts
  • src/lib/utils/track/__tests__/schema-tests.ts

If these files are supposed to not exist, please update your PR body to include "#skip_new_tests".

🚫

🃏 FAIL in getTestWrapper-tests.tsx

🚫

🃏 FAIL in Composer-tests.tsx

Generated by 🚫 dangerJS

@fbartho
Copy link

fbartho commented Oct 31, 2018

Does this support const enums and TS namespaces?

Copy link
Contributor

@alloy alloy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exciting!

@@ -111,10 +111,13 @@ export class Conversations extends Component<Props, State> {
keyExtractor={(_item, index) => String(index)}
scrollEventThrottle={500}
renderItem={({ item }) => {
// TODO: What is up with this `as any`?
// there's a type mismatch here, as item above is a `ConversationSnippetProps`
// but conversation is a `ConversationSnippet_conversation`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be:

interface State {
  conversations: Array<Props["me"]["conversations"]["edges"][0]["node"]> | null
}

(That could be simplified by making a separate fragment/container for the individual (conversation) nodes, which would give you a new type.)

And me should get typed here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, in that example Props["me"] is equal to Conversations_me, I go back and forth on what way to use 🤔

@orta
Copy link
Contributor Author

orta commented Oct 31, 2018

Does this support const enums and TS namespaces?

No, because it uses Babel for transpiration - see src/lib/utils/track.ts → src/lib/utils/track/index.ts in the diff.

@zephraph
Copy link
Contributor

👋 So, what can I do to help move this along? It's caused an issue where we've had to pin react-spring and that same issue is blocking us from upgrading to styled-components 4.

@orta
Copy link
Contributor Author

orta commented Dec 10, 2018

we got further on this, looking like right now we're somewhat blocked on jest mocking a decorator.

We were seeing "decorator is not a function" from "_applyDecoratedDescriptor" in babel/runtime, which is the tracking function inside a component. Unmocking react-tracking fails the tests but transpires correctly.

To continue, start by looking at either:

  • manually mocking react tracking in some form
  • find another way to "mock" by using a different import or changing something at runtime
  • see if it's a bug in jest

@iskounen
Copy link

iskounen commented Jan 2, 2019

This PR will also fix: https://artsyproduct.atlassian.net/browse/TUDI-16

@peril-staging
Copy link
Contributor

peril-staging bot commented Mar 21, 2019

Warnings
⚠️ It looks like code was changed without adding anything to the Changelog.
You can add #trivial in the PR body to skip the check.

New dependencies added: @babel/core, @babel/plugin-proposal-class-properties, @babel/plugin-proposal-decorators, @babel/plugin-transform-runtime, @babel/preset-typescript, @babel/runtime, @types/chalk, babel-core, chalk, jest-styled-components and metro-react-native-babel-preset.

@babel/plugin-proposal-class-properties

Author: Unknown

Description: This plugin transforms static class properties as well as properties declared with the property initializer syntax

Homepage: http://npmjs.com/package/@babel/plugin-proposal-class-properties

Createdover 1 year ago
Last Updated1 day ago
LicenseMIT
Maintainers5
Releases42
Direct Dependencies@babel/helper-create-class-features-plugin and @babel/helper-plugin-utils
Keywordsbabel-plugin
README

@babel/plugin-proposal-class-properties

This plugin transforms static class properties as well as properties declared with the property initializer syntax

See our website @babel/plugin-proposal-class-properties for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-proposal-class-properties

or using yarn:

yarn add @babel/plugin-proposal-class-properties --dev

@babel/plugin-proposal-decorators

Author: Logan Smyth

Description: Compile class and object decorators to ES5

Homepage: http://npmjs.com/package/@babel/plugin-proposal-decorators

Createdover 1 year ago
Last Updated1 day ago
LicenseMIT
Maintainers5
Releases43
Direct Dependencies@babel/helper-create-class-features-plugin, @babel/helper-plugin-utils and @babel/plugin-syntax-decorators
Keywordsbabel, babel-plugin and decorators
README

@babel/plugin-proposal-decorators

Compile class and object decorators to ES5

See our website @babel/plugin-proposal-decorators for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-proposal-decorators

or using yarn:

yarn add @babel/plugin-proposal-decorators --dev

@babel/plugin-transform-runtime

Author: Unknown

Description: Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals

Homepage: http://npmjs.com/package/@babel/plugin-transform-runtime

Createdover 1 year ago
Last Updated1 day ago
LicenseMIT
Maintainers5
Releases38
Direct Dependencies@babel/helper-module-imports, @babel/helper-plugin-utils, resolve and semver
Keywordsbabel-plugin
README

@babel/plugin-transform-runtime

Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals

See our website @babel/plugin-transform-runtime for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-transform-runtime

or using yarn:

yarn add @babel/plugin-transform-runtime --dev

@babel/preset-typescript

Author: Unknown

Description: Babel preset for TypeScript.

Homepage: http://npmjs.com/package/@babel/preset-typescript

Createdover 1 year ago
Last Updatedabout 1 month ago
LicenseMIT
Maintainers5
Releases36
Direct Dependencies@babel/helper-plugin-utils and @babel/plugin-transform-typescript
Keywordsbabel-preset and typescript
README

@babel/preset-typescript

Babel preset for TypeScript.

See our website @babel/preset-typescript for more information or the issues associated with this package.

Install

Using npm:

npm install --save-dev @babel/preset-typescript

or using yarn:

yarn add @babel/preset-typescript --dev

@babel/core

Author: Sebastian McKenzie

Description: Babel compiler core.

Homepage: https://babeljs.io/

Createdover 1 year ago
Last Updated1 day ago
LicenseMIT
Maintainers5
Releases46
Direct Dependencies@babel/code-frame, @babel/generator, @babel/helpers, @babel/parser, @babel/template, @babel/traverse, @babel/types, convert-source-map, debug, json5, lodash, resolve, semver and source-map
Keywords6to5, babel, classes, const, es6, harmony, let, modules, transpile, transpiler, var, babel-core and compiler
README

@babel/core

Babel compiler core.

See our website @babel/core for more information or the issues associated with this package.

Install

Using npm:

npm install --save-dev @babel/core

or using yarn:

yarn add @babel/core --dev

@types/chalk

Author: Unknown

Description: Stub TypeScript definitions entry for chalk, which provides its own types definitions

Homepage: http://npmjs.com/package/@types/chalk

Createdalmost 3 years ago
Last Updatedover 1 year ago
LicenseMIT
Maintainers1
Releases14
Direct Dependencieschalk
README

This is a stub types definition for chalk (https://github.com/chalk/chalk).
chalk provides its own type definitions, so you don't need @types/chalk installed!

babel-core

Author: Sebastian McKenzie

Description: Babel compiler core.

Homepage: https://babeljs.io/

Createdabout 4 years ago
Last Updated3 months ago
LicenseMIT
Maintainers4
Releases257
Direct Dependenciesbabel-code-frame, babel-generator, babel-helpers, babel-messages, babel-register, babel-runtime, babel-template, babel-traverse, babel-types, babylon, convert-source-map, debug, json5, lodash, minimatch, path-is-absolute, private, slash and source-map
Keywords6to5, babel, classes, const, es6, harmony, let, modules, transpile, transpiler, var, babel-core and compiler
README

babel-core

Babel compiler core.

var babel = require("babel-core");
import { transform } from 'babel-core';
import * as babel from 'babel-core';

All transformations will use your local configuration files (.babelrc or in package.json). See options to disable it.

babel.transform(code: string, options?: Object)

Transforms the passed in code. Returning an object with the generated code,
source map, and AST.

babel.transform(code, options) // => { code, map, ast }

Example

var result = babel.transform("code();", options);
result.code;
result.map;
result.ast;

babel.transformFile(filename: string, options?: Object, callback: Function)

Asynchronously transforms the entire contents of a file.

babel.transformFile(filename, options, callback)

Example

babel.transformFile("filename.js", options, function (err, result) {
  result; // => { code, map, ast }
});

babel.transformFileSync(filename: string, options?: Object)

Synchronous version of babel.transformFile. Returns the transformed contents of
the filename.

babel.transformFileSync(filename, options) // => { code, map, ast }

Example

babel.transformFileSync("filename.js", options).code;

babel.transformFromAst(ast: Object, code?: string, options?: Object)

Given, an AST, transform it.

const code = "if (true) return;";
const ast = babylon.parse(code, { allowReturnOutsideFunction: true });
const { code, map, ast } = babel.transformFromAst(ast, code, options);

Options

Babel CLI

You can pass these options from the Babel CLI like so:

babel --name=value

Following is a table of the options you can use:

Option Default Description
ast true Include the AST in the returned object
auxiliaryCommentAfter null Attach a comment after all non-user injected code.
auxiliaryCommentBefore null Attach a comment before all non-user injected code.
babelrc true Specify whether or not to use .babelrc and .babelignore files. Not available when using the CLI, use --no-babelrc instead.
code true Enable code generation
comments true Output comments in generated output.
compact "auto" Do not include superfluous whitespace characters and line terminators. When set to "auto" compact is set to true on input sizes of >500KB.
env {} This is an object of keys that represent different environments. For example, you may have: { env: { production: { /* specific options */ } } } which will use those options when the environment variable BABEL_ENV is set to "production". If BABEL_ENV isn't set then NODE_ENV will be used, if it's not set then it defaults to "development"
extends null A path to an .babelrc file to extend
filename "unknown" Filename for use in errors etc.
filenameRelative (filename) Filename relative to sourceRoot.
generatorOpts {} An object containing the options to be passed down to the babel code generator, babel-generator
getModuleId null Specify a custom callback to generate a module id with. Called as getModuleId(moduleName). If falsy value is returned then the generated module id is used.
highlightCode true ANSI highlight syntax error code frames
ignore null Opposite to the only option. ignore is disregarded if only is specified.
inputSourceMap null A source map object that the output source map will be based on.
minified false Should the output be minified (not printing last semicolons in blocks, printing literal string values instead of escaped ones, stripping () from new when safe)
moduleId null Specify a custom name for module ids.
moduleIds false If truthy, insert an explicit id for modules. By default, all modules are anonymous. (Not available for common modules)
moduleRoot (sourceRoot) Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions.
only null A glob, regex, or mixed array of both, matching paths to only compile. Can also be an array of arrays containing paths to explicitly match. When attempting to compile a non-matching file it's returned verbatim.
parserOpts {} An object containing the options to be passed down to the babel parser, babylon
plugins [] List of plugins to load and use.
presets [] List of presets (a set of plugins) to load and use.
retainLines false Retain line numbers. This will lead to wacky code but is handy for scenarios where you can't use source maps. (NOTE: This will not retain the columns)
resolveModuleSource null Resolve a module source ie. import "SOURCE"; to a custom value. Called as resolveModuleSource(source, filename).
shouldPrintComment null An optional callback that controls whether a comment should be output or not. Called as shouldPrintComment(commentContents). NOTE: This overrides the comment option when used.
sourceFileName (filenameRelative) Set sources[0] on returned source map.
sourceMaps false If truthy, adds a map property to returned output. If set to "inline", a comment with a sourceMappingURL directive is added to the bottom of the returned code. If set to "both" then a map property is returned as well as a source map comment appended. This does not emit sourcemap files by itself! To have sourcemaps emitted using the CLI, you must pass it the --source-maps option.
sourceMapTarget (filenameRelative) Set file on returned source map.
sourceRoot (moduleRoot) The root from which all sources are relative.
sourceType "module" Indicate the mode the code should be parsed in. Can be either "script" or "module".
wrapPluginVisitorMethod null An optional callback that can be used to wrap visitor methods. NOTE: This is useful for things like introspection, and not really needed for implementing anything. Called as wrapPluginVisitorMethod(pluginAlias, visitorType, callback).

chalk

Author: Unknown

Description: Terminal string styling done right

Homepage: https://github.com/chalk/chalk#readme

Createdover 5 years ago
Last Updated11 days ago
LicenseMIT
Maintainers2
Releases24
Direct Dependenciesansi-styles, escape-string-regexp and supports-color
Keywordscolor, colour, colors, terminal, console, cli, string, str, ansi, style, styles, tty, formatting, rgb, 256, shell, xterm, log, logging, command-line and text
This README is too long to show.

jest-styled-components

Author: Michele Bertoli

Description: Jest utilities for Styled Components

Homepage: https://github.com/styled-components/jest-styled-components#readme

Createdabout 2 years ago
Last Updated3 months ago
LicenseMIT
Maintainers2
Releases86
Direct Dependenciescss
This README is too long to show.

metro-react-native-babel-preset

Author: Unknown

Description: Babel preset for React Native applications

Homepage: https://github.com/facebook/metro#readme

Created9 months ago
Last Updated7 days ago
LicenseMIT
Maintainers1
Releases36
Direct Dependencies@babel/plugin-proposal-class-properties, @babel/plugin-proposal-export-default-from, @babel/plugin-proposal-nullish-coalescing-operator, @babel/plugin-proposal-object-rest-spread, @babel/plugin-proposal-optional-catch-binding, @babel/plugin-proposal-optional-chaining, @babel/plugin-syntax-dynamic-import, @babel/plugin-syntax-export-default-from, @babel/plugin-syntax-flow, @babel/plugin-transform-arrow-functions, @babel/plugin-transform-block-scoping, @babel/plugin-transform-classes, @babel/plugin-transform-computed-properties, @babel/plugin-transform-destructuring, @babel/plugin-transform-exponentiation-operator, @babel/plugin-transform-flow-strip-types, @babel/plugin-transform-for-of, @babel/plugin-transform-function-name, @babel/plugin-transform-literals, @babel/plugin-transform-modules-commonjs, @babel/plugin-transform-object-assign, @babel/plugin-transform-parameters, @babel/plugin-transform-react-display-name, @babel/plugin-transform-react-jsx, @babel/plugin-transform-react-jsx-source, @babel/plugin-transform-regenerator, @babel/plugin-transform-runtime, @babel/plugin-transform-shorthand-properties, @babel/plugin-transform-spread, @babel/plugin-transform-sticky-regex, @babel/plugin-transform-template-literals, @babel/plugin-transform-typescript, @babel/plugin-transform-unicode-regex, @babel/template, metro-babel7-plugin-react-transform and react-transform-hmr
Keywordsbabel, preset and react-native
README

metro-react-native-babel-preset

Babel presets for React Native applications. React Native itself uses this Babel preset by default when transforming your app's source code.

If you wish to use a custom Babel configuration by writing a .babelrc file in your project's root directory, you must specify all the plugins necessary to transform your code. React Native does not apply its default Babel configuration in this case. So, to make your life easier, you can use this preset to get the default configuration and then specify more plugins that run before it.

Usage

As mentioned above, you only need to use this preset if you are writing a custom .babelrc file.

Installation

Install metro-react-native-babel-preset in your app:

npm i metro-react-native-babel-preset --save-dev

Configuring Babel

Then, create a file called .babelrc in your project's root directory. The existence of this .babelrc file will tell React Native to use your custom Babel configuration instead of its own. Then load this preset:

{
  "presets": ["module:metro-react-native-babel-preset"]
}

You can further customize your Babel configuration by specifying plugins and other options. See Babel's .babelrc documentation to learn more.

Help and Support

If you get stuck configuring Babel, please ask a question on Stack Overflow or find a consultant for help. If you discover a bug, please open up an issue.

@babel/runtime

Author: Sebastian McKenzie

Description: babel's modular runtime helpers

Homepage: http://npmjs.com/package/@babel/runtime

Createdover 1 year ago
Last Updatedabout 3 hours ago
LicenseMIT
Maintainers5
Releases43
Direct Dependenciesregenerator-runtime
README

@babel/runtime

babel's modular runtime helpers

See our website @babel/runtime for more information.

Install

Using npm:

npm install --save @babel/runtime

or using yarn:

yarn add @babel/runtime 

Generated by 🚫 dangerJS against c4f3958

@l2succes
Copy link
Contributor

Closing this in favor of #1551

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants