Skip to content

Convert to CSS modules #701

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

Merged
merged 37 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4608c9b
Add a tag to allow ignoring the CORS test
shepmaster Mar 28, 2021
9bd7e04
Remove dead CSS
shepmaster Mar 24, 2021
4c17dcf
Enable webpack persistent caching
shepmaster Mar 25, 2021
44d4ba8
Use Webpack 5 asset modules for SVGs
shepmaster Mar 24, 2021
946471c
Install and configure CSS modules
shepmaster Mar 24, 2021
5cc46c1
Use Prettier for CSS files
shepmaster Mar 27, 2021
9293047
Use stylelint for CSS files
shepmaster Mar 27, 2021
4741a66
Support simple build-time variables with PostCSS
shepmaster Mar 25, 2021
119da78
Support nesting rules with PostCSS
shepmaster Mar 27, 2021
3210420
Convert HelpExample to CSS modules
shepmaster Mar 24, 2021
f533a18
Convert Help to CSS modules
shepmaster Mar 24, 2021
1978719
Use the shadow DOM to scope Prism themes to specific components
shepmaster Mar 24, 2021
1d8e948
Convert BuildMenu to CSS modules
shepmaster Mar 24, 2021
47d061e
DRY up menu asides
shepmaster Mar 24, 2021
9bb9b81
Convert ChannelMenu to CSS modules
shepmaster Mar 24, 2021
092ed8a
Convert HeaderButton to CSS modules
shepmaster Mar 25, 2021
bb3f0f5
Convert Icon to CSS modules
shepmaster Mar 25, 2021
fd6b67a
Convert Notifications to CSS modules
shepmaster Mar 25, 2021
f8f0bc1
Convert Playground to CSS modules
shepmaster Mar 25, 2021
d407d59
Allow the editor/output panels to be resized
shepmaster Mar 27, 2021
2a2fc96
Convert Header to CSS modules
shepmaster Mar 27, 2021
19b117f
Convert MenuItem to CSS modules
shepmaster Mar 27, 2021
d5b8177
Convert MenuGroup to CSS modules
shepmaster Mar 27, 2021
c06f375
Convert ButtonMenuItem to CSS modules
shepmaster Mar 28, 2021
15e5399
Convert SelectableMenuItem to CSS modules
shepmaster Mar 28, 2021
08e263e
Convert Loader to CSS modules
shepmaster Mar 28, 2021
4697dfb
Convert PopButton to CSS modules
shepmaster Mar 28, 2021
0d2b0f8
Convert Editor to CSS modules
shepmaster Mar 28, 2021
9d718ba
Convert ConfigElement to CSS modules
shepmaster Mar 28, 2021
cae3d96
Convert SegmentedButton to CSS modules
shepmaster Mar 28, 2021
14f150e
Convert Output to CSS modules
shepmaster Mar 28, 2021
706e822
Discontinue usage of Sass
shepmaster Mar 29, 2021
3ff37e8
Upgrade ui frontend semver dependencies
shepmaster Mar 29, 2021
8c4cf13
Upgrade copy-webpack-plugin to 8.0
shepmaster Mar 29, 2021
b2ea88a
Upgrade test semver dependencies
shepmaster Mar 29, 2021
20f3033
Use new React transform
shepmaster Mar 29, 2021
138d28a
Move TypeScript types to dev-dependencies
shepmaster Mar 29, 2021
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
4 changes: 4 additions & 0 deletions ci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ workflows:
run: >-
yarn --cwd ui/frontend/ test:lint

- name: "Style"
run: >-
yarn --cwd ui/frontend/ test:style

- name: "Build frontend"
run: >-
yarn --cwd ui/frontend/ run build:production
Expand Down
4 changes: 2 additions & 2 deletions tests/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ GEM
diff-lcs (1.4.4)
launchy (2.5.0)
addressable (~> 2.7)
mini_mime (1.0.2)
mini_mime (1.0.3)
mini_portile2 (2.5.0)
nokogiri (1.11.1)
nokogiri (1.11.2)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
public_suffix (4.0.6)
Expand Down
22 changes: 8 additions & 14 deletions tests/spec/features/assistance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
EOF
click_on("Build")

within('.output-warning') do
within(:output, :warning) do
click_on("add a main function")
end

within('.editor') do
expect(editor).to have_line 'println!("Hello, world!")'
end
expect(editor).to have_line 'println!("Hello, world!")'
end

scenario "using an unstable feature offers adding the feature flag" do
Expand All @@ -29,13 +27,11 @@
EOF
click_on("Build")

within('.output-stderr') do
within(:output, :stderr) do
click_on("add `#![feature(abi_avr_interrupt)]`")
end

within('.editor') do
expect(editor).to have_line '#![feature(abi_avr_interrupt)]'
end
expect(editor).to have_line '#![feature(abi_avr_interrupt)]'
end

scenario "using a type that hasn't been imported offers importing it" do
Expand All @@ -44,13 +40,11 @@
EOF
click_on("Build")

within('.output-stderr') do
within(:output, :stderr) do
click_on("use std::collections::HashMap;")
end

within('.editor') do
expect(editor).to have_line 'use std::collections::HashMap;'
end
expect(editor).to have_line 'use std::collections::HashMap;'
end

scenario "triggering a panic offers enabling backtraces" do
Expand All @@ -61,11 +55,11 @@
EOF
click_on("Run")

within('.output-stderr') do
within(:output, :stderr) do
click_on("run with `RUST_BACKTRACE=1` environment variable to display a backtrace")
end

within('.output-stderr') do
within(:output, :stderr) do
expect(page).to have_content("stack backtrace:")
end
end
Expand Down
14 changes: 7 additions & 7 deletions tests/spec/features/automatic_primary_action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
EOF
click_on("Run")

within('.output-stdout') do
within(:output, :stdout) do
expect(page).to have_content 'Hello, world'
end
end
Expand All @@ -27,7 +27,7 @@
EOF
click_on("Build")

within('.output-stderr') do
within(:output, :stderr) do
expect(page).to have_content 'function is never used: `main`'
end
end
Expand All @@ -47,7 +47,7 @@
EOF
click_on("Build")

within('.output-stderr') do
within(:output, :stderr) do
expect(page).to have_content 'function is never used: `main`'
end
end
Expand All @@ -59,7 +59,7 @@
EOF
click_on("Test")

within('.output-stdout') do
within(:output, :stdout) do
expect(page).to have_content 'running 1 test'
expect(page).to have_content 'test awesome ... ok'
expect(page).to have_content 'test result: ok'
Expand All @@ -79,7 +79,7 @@
EOF
click_on("Test")

within('.output-stdout') do
within(:output, :stdout) do
expect(page).to have_content 'running 1 test'
expect(page).to_not have_content 'Running in main'
end
Expand All @@ -93,7 +93,7 @@
EOF
click_on("Run")

within('.output-stdout') do
within(:output, :stdout) do
expect(page).to have_content 'Running in main'
end
end
Expand All @@ -106,7 +106,7 @@
EOF
click_on("Build")

within('.output-stderr') do
within(:output, :stderr) do
expect(page).to have_content 'function is never used: `arbitrary_code`'
end
end
Expand Down
10 changes: 5 additions & 5 deletions tests/spec/features/backtrace_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
context "backtraces are enabled" do
before do
in_advanced_options_menu { choose 'enabled' }
within('.header') { click_on("Run") }
within(:header) { click_on("Run") }
end

scenario "a backtrace is shown" do
within('.output-stderr') do
within(:output, :stderr) do
expect(page).to have_content 'stack backtrace:'
expect(page).to have_content 'rust_begin_unwind'
end
end

scenario "filenames link to that line of code" do
within('.output-stderr') do
within(:output, :stderr) do
expect(page).to have_link('main.rs:2')
expect(page).to have_link('main.rs:6')
end
Expand All @@ -33,11 +33,11 @@

context "backtraces are disabled" do
before do
within('.header') { click_on("Run") }
within(:header) { click_on("Run") }
end

scenario "the backtrace suggestion is a link" do
within('.output-stderr') do
within(:output, :stderr) do
expect(page).to have_link(text: /Run with .* a backtrace/i)
end
end
Expand Down
4 changes: 2 additions & 2 deletions tests/spec/features/compilation_modes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
in_mode_menu { click_on("Debug") }
click_on("Run")

within('.output-stdout') do
within(:output, :stdout) do
expect(page).to have_content 'Compiling in debug mode'
expect(page).to_not have_content 'Compiling in release mode'
end
Expand All @@ -24,7 +24,7 @@
in_mode_menu { click_on("Release") }
click_on("Run")

within('.output-stdout') do
within(:output, :stdout) do
expect(page).to_not have_content 'Compiling in debug mode'
expect(page).to have_content 'Compiling in release mode'
end
Expand Down
20 changes: 10 additions & 10 deletions tests/spec/features/compilation_targets_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@

scenario "choosing to run the code" do
in_build_menu { click_on(build_button: "Run") }
within('.output-stdout') do
within(:output, :stdout) do
expect(page).to have_content 'Hello, world!'
end
end

scenario "choosing to build the code" do
in_build_menu { click_on(build_button: "Build") }
within('.output-stderr') do
within(:output, :stderr) do
expect(page).to have_content 'function is never used: `main`'
end
end

scenario "choosing to test the code" do
in_build_menu { click_on(build_button: "Test") }
within('.output-stdout') do
within(:output, :stdout) do
expect(page).to have_content "panicked at 'assertion failed: false'"
end
end
Expand All @@ -50,7 +50,7 @@
scenario "compiling to assembly" do
in_build_menu { click_on("assembly") }

within('.output-code') do
within(:output, :code) do
# We demangle the symbols
expect(page).to have_content 'playground::main:'

Expand All @@ -67,7 +67,7 @@
scenario "compiling to assembly" do
in_build_menu { click_on("assembly") }

within('.output-code') do
within(:output, :code) do
# We demangle the symbols
expect(page).to have_content 'playground::main:'

Expand All @@ -79,7 +79,7 @@
scenario "compiling to LLVM IR" do
in_build_menu { click_on("LLVM IR") }

within('.output-code') do
within(:output, :code) do
expect(page).to have_content 'ModuleID'
expect(page).to have_content 'target datalayout'
expect(page).to have_content 'target triple'
Expand All @@ -89,7 +89,7 @@
scenario "compiling to MIR" do
in_build_menu { click_on("MIR") }

within('.output-result') do
within(:output, :result) do
expect(page).to have_content 'StorageLive'
expect(page).to have_content 'StorageDead'
end
Expand All @@ -102,15 +102,15 @@

in_build_menu { click_on("HIR") }

within('.output-result') do
within(:output, :result) do
expect(page).to have_content 'fn demo() -> /*impl Trait*/ { 42 }'
end
end

scenario "compiling to WebAssembly" do
in_build_menu { click_on("WASM") }

within('.output-code') do
within(:output, :code) do
expect(page).to have_content '(module'
expect(page).to have_content '(block'
end
Expand All @@ -122,7 +122,7 @@
scenario "it shows the compilation error" do
in_build_menu { click_on("MIR") }

within('.output-stderr') do
within(:output, :stderr) do
expect(page).to have_content 'an unclosed delimiter'
end
end
Expand Down
4 changes: 2 additions & 2 deletions tests/spec/features/editions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
in_advanced_options_menu { choose '2015' }
click_on("Run")

within('.output-stderr') do
within(:output, :stderr) do
expect(page).to have_content 'unused variable: `async`'
expect(page).to_not have_content 'expected identifier, found keyword `async`'
end
Expand All @@ -24,7 +24,7 @@
in_advanced_options_menu { choose '2018' }
click_on("Run")

within('.output-stderr') do
within(:output, :stderr) do
expect(page).to have_content 'expected identifier, found keyword `async`'
expect(page).to_not have_content 'unused variable: `async`'
end
Expand Down
2 changes: 1 addition & 1 deletion tests/spec/features/editor_types_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

click_on("Run")

within('.output-stdout') do
within(:output, :stdout) do
expect(page).to have_content 'simple editor'
end
end
Expand Down
10 changes: 5 additions & 5 deletions tests/spec/features/highlighting_error_output_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@
before do
visit '/'
editor.set(code)
within('.header') { click_on("Run") }
within(:header) { click_on("Run") }
end

scenario "errors are highlighted" do
within('.output-stderr') do
within(:output, :stderr) do
expect(page).to have_css '.error', text: '1 type argument but 2 type arguments were supplied'
expect(page).to have_css '.error', text: 'aborting due to 2 previous errors'
expect(page).to have_css '.error', text: /Could not compile `playground`/i
end
end

scenario "error locations are links" do
within('.output-stderr') do
within(:output, :stderr) do
expect(page).to have_link('src/main.rs')
end
end

scenario "github see-issues are links" do
within('.output-stderr') do
within(:output, :stderr) do
expect(page).to have_link('see issue #23416 <https://github.com/rust-lang/rust/issues/23416>', href: 'https://github.com/rust-lang/rust/issues/23416')
end
end

scenario "error codes link to the error page" do
within('.output-stderr') do
within(:output, :stderr) do
expect(page).to have_link('E0107', href: /error-index.html#E0107/)
end
end
Expand Down
2 changes: 1 addition & 1 deletion tests/spec/features/highlighting_mir_output_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
end

scenario "error locations are links" do
within('.output-mir') do
within(:output, :mir) do
click_link('src/main.rs:4:14: 4:19', match: :first)
end
expect(editor).to have_highlighted_text('a + b')
Expand Down
6 changes: 3 additions & 3 deletions tests/spec/features/multiple_channels_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
in_channel_menu { click_on("Stable") }
click_on("Run")

within('.output-stdout') do
within(:output, :stdout) do
expect(page).to have_content 'rustc'
expect(page).to_not have_content 'beta'
expect(page).to_not have_content 'nightly'
Expand All @@ -25,7 +25,7 @@
in_channel_menu { click_on("Beta") }
click_on("Run")

within('.output-stdout') do
within(:output, :stdout) do
expect(page).to have_content 'rustc'
expect(page).to have_content 'beta'
expect(page).to_not have_content 'nightly'
Expand All @@ -36,7 +36,7 @@
in_channel_menu { click_on("Nightly") }
click_on("Run")

within('.output-stdout') do
within(:output, :stdout) do
expect(page).to have_content 'rustc'
expect(page).to_not have_content 'beta'
expect(page).to have_content 'nightly'
Expand Down
2 changes: 1 addition & 1 deletion tests/spec/features/sharing_with_others_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
in_mode_menu { click_on("Release") }
in_advanced_options_menu { choose("2018") }

within('.header') { click_on 'Share' }
within(:header) { click_on 'Share' }

# Save the links before we navigate away
perma_link = find_link("Permalink to the playground")[:href]
Expand Down
Loading