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

donotmerge: various works in progress #80

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions react/javascript/helloworld-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ This example demonstrates a bare bones Looker extension using Javascript.
yarn develop
```

The extension is now running and serving the JavaScript locally at http://localhost:8080/bundle.js.
The extension is now running and serving the JavaScript locally at https://localhost:8080/bundle.js. Note that the
new extension loading mechanism requires that the development server listen on https as browsers do not support
mixed content. When the development extension first loads you may need to authorize the certificate that is generated.
This can easily be done by clicking the link that appears in the displayed development information. This will open
a new browser window which will allow the certificate to be authorized.

5. Log in to Looker and create a new project.

Expand All @@ -46,7 +50,7 @@ This example demonstrates a bare bones Looker extension using Javascript.

application: helloworld-js {
label: "Helloworld (JavaScript)"
url: "http://localhost:8080/bundle.js"
url: "https://localhost:8080/bundle.js"
entitlements: {
core_api_methods: ["me"]
}
Expand Down
8 changes: 8 additions & 0 deletions react/javascript/helloworld-js/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ module.exports = (api) => {
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-transform-runtime',
'babel-plugin-styled-components',
[
'file-loader',
{
publicPath: '/dist',
outputPath: '/dist',
limit: 66666,
},
],
],
}
}
3 changes: 2 additions & 1 deletion react/javascript/helloworld-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"analyze": "export ANALYZE_MODE=static && yarn build",
"build": "export BABEL_ENV=build && webpack --config webpack.prod.js",
"clean": "rm -rf dist && rm -f .eslintcache",
"develop": "webpack serve --hot --port 8080 --config webpack.develop.js",
"develop": "webpack serve --hot --port 8080 --https --config webpack.develop.js",
"prebuild": "yarn clean",
"lint:es": "eslint 'src/**/*.js{,x}' --cache",
"lint:es:fix": "eslint 'src/**/*.js{,x}' --cache --fix",
Expand All @@ -32,6 +32,7 @@
"@styled-icons/material": "^10.28.0",
"@styled-icons/material-outlined": "^10.34.0",
"@styled-icons/material-rounded": "^10.34.0",
"babel-plugin-file-loader": "^2.0.0",
"lodash": "^4.17.21",
"react": "^16.14.0",
"react-dom": "^16.14.0",
Expand Down
2 changes: 2 additions & 0 deletions react/javascript/helloworld-js/src/HelloWorld.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import React, { useEffect, useState, useContext } from 'react'
import { Space, ComponentsProvider, Text } from '@looker/components'
import { ExtensionContext } from '@looker/extension-sdk-react'
import spiral from './images/spirals.png'

export const HelloWorld = () => {
const { core40SDK } = useContext(ExtensionContext)
Expand All @@ -52,6 +53,7 @@ export const HelloWorld = () => {
<Text p="xxxxxlarge" fontSize="xxxxxlarge">
{message}
</Text>
<img src={spiral} height={200} width={200} />
</Space>
</ComponentsProvider>
</>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions react/javascript/helloworld-js/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

const path = require('path')

const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin
const BundleAnalyzerPlugin =
require('webpack-bundle-analyzer').BundleAnalyzerPlugin

const PATHS = {
app: path.join(__dirname, 'src/index.js'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,33 +155,6 @@ const Configure: React.FC<ConfigureProps> = ({

const getValidationMessages = (): ValidationMessages | undefined => {
let validationMessages: ValidationMessages | undefined
if (typeof localConfigurationData.dashboardId === 'string') {
if (!validationMessages) {
validationMessages = {}
}
validationMessages.dashboardId = {
type: 'error',
message: 'dashboard id is not numeric',
}
}
if (localConfigurationData.exploreId === '') {
if (!validationMessages) {
validationMessages = {}
}
validationMessages.exploreId = {
type: 'error',
message: 'explore id is empty',
}
}
if (typeof localConfigurationData.lookId === 'string') {
if (!validationMessages) {
validationMessages = {}
}
validationMessages.lookId = {
type: 'error',
message: 'look id is not numeric',
}
}
return validationMessages
}

Expand Down
3 changes: 2 additions & 1 deletion react/typescript/kitchensink/webpack.develop.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ module.exports = {
],
},
devServer: {
webSocketServer: 'sockjs',
client: false,
webSocketServer: false,
host: 'localhost',
allowedHosts: 'all',
headers: {
Expand Down
32 changes: 31 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3842,6 +3842,15 @@ babel-plugin-dynamic-import-node@^2.3.3:
dependencies:
object.assign "^4.1.0"

babel-plugin-file-loader@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/babel-plugin-file-loader/-/babel-plugin-file-loader-2.0.0.tgz#e9f7ecbd0f1131483f6f06a2a4cbc1574c00534f"
integrity sha512-MgonWXyl/VAMjMCU4YA3m0Zk95jdwLoQ/n8YM+M/CYKNtEfj9nk+bhgLbWKkUY2D9PzjQO8sx93QkOCMAAvn8Q==
dependencies:
big.js "^5.2.2"
fs-extra "^8.1.0"
mime "^2.4.4"

babel-plugin-istanbul@^6.0.0:
version "6.1.1"
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73"
Expand Down Expand Up @@ -6471,6 +6480,15 @@ fresh@0.5.2:
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=

fs-extra@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^4.0.0"
universalify "^0.1.0"

fs-extra@^9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
Expand Down Expand Up @@ -8304,6 +8322,13 @@ json5@^1.0.1:
dependencies:
minimist "^1.2.0"

jsonfile@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=
optionalDependencies:
graceful-fs "^4.1.6"

jsonfile@^6.0.1:
version "6.1.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae"
Expand Down Expand Up @@ -8971,6 +8996,11 @@ mime@1.6.0:
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==

mime@^2.4.4:
version "2.6.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367"
integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==

mimic-fn@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
Expand Down Expand Up @@ -12641,7 +12671,7 @@ universal-user-agent@^6.0.0:
resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee"
integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==

universalify@^0.1.2:
universalify@^0.1.0, universalify@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
Expand Down