This repository was archived by the owner on Jan 22, 2019. It is now read-only.
fix: prevent transitive importing of entrypoints#184
Merged
chrismwendt merged 1 commit intomasterfrom Sep 18, 2018
Merged
Conversation
f883cdd to
8c9c2af
Compare
ijsnow
approved these changes
Sep 18, 2018
| @@ -1,10 +1,10 @@ | |||
| // We want to polyfill first. | |||
There was a problem hiding this comment.
Ah, was this the entry point for the extensions page? Just confused about the name change and don't remember this file before.
Author
There was a problem hiding this comment.
It might have been the entrypoint a while back, but currently the extensions page is part of the options page, so this entrypoint is unnecessary.
| import { createExtensionsContextController } from '../../../shared/backend/extensions' | ||
| import { GQL } from '../../../types/gqlschema' | ||
| import { sourcegraphUrl } from '../../util/context' | ||
| import { BrowserSettingsEditor } from './browserSettingsEditor' |
There was a problem hiding this comment.
Should the file name in this import be UpperCamelCase?
| export const onFirstMessage = (port: chrome.runtime.Port, callback: (message: any) => void) => { | ||
| const cb = message => { | ||
| port.onMessage.removeListener(cb) | ||
| callback(message) |
There was a problem hiding this comment.
Nifty logic. Wouldn't have thought of that.
8c9c2af to
ef47228
Compare
|
🎉 This PR is included in version 1.15.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This prevents accidentally importing one entrypoint in another, which was the root cause of #175
This works by tagging each entrypoint in webpack with
window.EXTENSION_ENV = <name of entrypoint>, having each entrypoint callassertEnv(<name of entrypoint>), and throwing an error ifwindow.EXTENSION_ENV !== <name of entrypoint>.This also removes existing violations of these assertions ✨