Skip to content
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

build: export Core as Uppy #3981

Merged
merged 5 commits into from
Aug 16, 2022
Merged

build: export Core as Uppy #3981

merged 5 commits into from
Aug 16, 2022

Conversation

arturi
Copy link
Contributor

@arturi arturi commented Aug 15, 2022

No description provided.

@arturi arturi requested a review from aduh95 August 15, 2022 19:46
@arturi
Copy link
Contributor Author

arturi commented Aug 15, 2022

Something is messed up with tests and import/export or config 🤔 @aduh95 do you see what could be the issue?

@arturi
Copy link
Contributor Author

arturi commented Aug 15, 2022

Maybe it’s fixed with updated yarn.lock.

Comment on lines 36 to 40
static COMPANION = 'https://api2.transloadit.com/companion'

// Regex matching acceptable postMessage() origins for authentication feedback from companion.
static ALLOWED_COMPANION_PATTERN = /\.transloadit\.com$/

Copy link
Contributor

Choose a reason for hiding this comment

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

I though we would not do that, and instead define them as static only in the bundle?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔

@arturi arturi requested a review from aduh95 August 16, 2022 12:55
Copy link
Member

@Murderlon Murderlon left a comment

Choose a reason for hiding this comment

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

Can you add this breaking change to #3913?

Comment on lines 28 to 30
const COMPANION = 'https://api2.transloadit.com/companion'
// Regex matching acceptable postMessage() origins for authentication feedback from companion.
const ALLOWED_COMPANION_PATTERN = /\.transloadit\.com$/
Copy link
Member

Choose a reason for hiding this comment

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

Since this is a breaking change already, good opportunity to use more intention revealing names. COMPANION sounds like it contains the instance.

Suggested change
const COMPANION = 'https://api2.transloadit.com/companion'
// Regex matching acceptable postMessage() origins for authentication feedback from companion.
const ALLOWED_COMPANION_PATTERN = /\.transloadit\.com$/
const COMPANION_URL = 'https://api2.transloadit.com/companion'
// Regex matching acceptable postMessage() origins for authentication feedback from companion.
const COMPANION_URL_PATTERN = /\.transloadit\.com$/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not a breaking change now, we decided to just add exports to the CDN bundle.

Comment on lines 53 to 54
export { COMPANION as TRANSLOADIT_COMPANION } from '@uppy/transloadit'
export { ALLOWED_COMPANION_PATTERN as TRANSLOADIT_ALLOWED_COMPANION_PATTERN } from '@uppy/transloadit'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export { COMPANION as TRANSLOADIT_COMPANION } from '@uppy/transloadit'
export { ALLOWED_COMPANION_PATTERN as TRANSLOADIT_ALLOWED_COMPANION_PATTERN } from '@uppy/transloadit'
import { default as Transloadit, COMPANION, ALLOWED_COMPANION_PATTERN } from '@uppy/transloadit'
Transloadit.COMPANION = COMPANION
Transloadit.ALLOWED_COMPANION_PATTERN = ALLOWED_COMPANION_PATTERN

@arturi arturi changed the title build: export Core as Uppy, Transloadit Companion url as static property build: export Core as Uppy Aug 16, 2022
@arturi arturi requested a review from aduh95 August 16, 2022 14:30
@aduh95 aduh95 merged commit 9affb67 into main Aug 16, 2022
@aduh95 aduh95 deleted the improve-exports branch August 16, 2022 15:27
aduh95 pushed a commit that referenced this pull request Aug 16, 2022
aduh95 pushed a commit that referenced this pull request Aug 16, 2022
aduh95 added a commit to aduh95/uppy that referenced this pull request Aug 18, 2022
`Uppy` call is now exported as `Uppy` instead of `Core`.

Refs: transloadit#3981
aduh95 added a commit to aduh95/uppy that referenced this pull request Aug 18, 2022
`Uppy` call is now exported as `Uppy` instead of `Core`.

Refs: transloadit#3981
aduh95 added a commit that referenced this pull request Aug 18, 2022
`Uppy` call is now exported as `Uppy` instead of `Core`.

Refs: #3981
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants