-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace webpacker with esbuild (#1128)
# What it does This replaces the use of webpacker for bundling JavaScript and CSS with a combination of esbuild for JS and DartSass for CSS. # Why it is important * The current webpacker config means that rebuilding the JS is pretty slow. * Rails has deprecated webpacker and future energy is directed in other directions. This change aligns the project with upstream efforts. # Implementation notes * We were previously using browserlist's `defaults` to translate new JS features into backward-compatible forms. With `esbuild`, the options are more limited. Using `--target=chrome58,firefox57,safari11` to restrict what JS features are used should be OK for now and is more conservative than what we were shipping before. # Your bandwidth for additional changes to this PR _Please choose one of the following to help the project maintainers provide the appropriate level of support:_ - [x] I have the time and interest to make additional changes to this PR based on feedback. - [ ] I am interested in feedback but don't need to make the changes myself. - [ ] I don't have time or interest in making additional changes to this work. - [ ] Other or not sure (please describe):
- Loading branch information
Showing
73 changed files
with
398 additions
and
7,089 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
ruby 3.1.4 | ||
nodejs 14.17.0 | ||
nodejs 20.6.1 | ||
yarn 1.22.4 |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
web: env RUBY_DEBUG_OPEN=true bin/rails server | ||
js: yarn build-dev --watch | ||
css: yarn build:css --watch |
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//= link_tree ../images | ||
//= link_tree ../builds |
Empty file.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@import './styles.scss'; | ||
@import "awesomplete/awesomplete"; | ||
@import "selectize/dist/css/selectize.default"; | ||
@import './overrides.scss'; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
File renamed without changes.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import Rails from "@rails/ujs" | ||
Rails.start() | ||
|
||
import Turbolinks from "turbolinks" | ||
Turbolinks.start() | ||
|
||
import * as ActiveStorage from "@rails/activestorage" | ||
ActiveStorage.start() | ||
|
||
import "./controllers" | ||
|
||
import "trix" | ||
import "@rails/actiontext" | ||
|
||
import feather from "feather-icons/dist/feather" | ||
document.addEventListener("turbolinks:load", function() { | ||
feather.replace({ | ||
width: 20, | ||
height: 20, | ||
class: "feather-icon", | ||
}); | ||
}) | ||
|
||
import scrollIntoView from 'smooth-scroll-into-view-if-needed'; | ||
|
||
Turbolinks.ScrollManager.prototype.scrollToElement = function(element) { | ||
let classes = element.classList; | ||
if (classes.contains("highlightable")) { | ||
classes.add("highlight"); | ||
} | ||
scrollIntoView(element, { | ||
behavior: 'smooth', | ||
scrollMode: 'if-needed', | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,57 @@ | ||
// Load all the controllers within this directory and all subdirectories. | ||
// Controller files must be named *_controller.js. | ||
|
||
import { Application } from "stimulus" | ||
import { definitionsFromContext } from "stimulus/webpack-helpers" | ||
|
||
const application = Application.start() | ||
const context = require.context("controllers", true, /_controller\.js$/) | ||
application.load(definitionsFromContext(context)) | ||
window.Stimulus = Application.start() | ||
|
||
import AlertController from './alert_controller' | ||
Stimulus.register('alert', AlertController) | ||
|
||
import AppointmentDateController from './appointment_date_controller' | ||
Stimulus.register('appointment-date', AppointmentDateController) | ||
|
||
import AppointmentsIndexController from './appointments_index_controller' | ||
Stimulus.register('appointments-indes', AppointmentsIndexController) | ||
|
||
import AutocompleteController from './autocomplete_controller' | ||
Stimulus.register('autocomplete', AutocompleteController) | ||
|
||
import CollapseController from './collapse_controller' | ||
Stimulus.register('collapse', CollapseController) | ||
|
||
import ConditionalFieldController from './conditional_field_controller' | ||
Stimulus.register('conditional-field', ConditionalFieldController) | ||
|
||
import EmailSettingsEditorController from './email_settings_editor_controller' | ||
Stimulus.register('email-settings-editor', EmailSettingsEditorController) | ||
|
||
import FindToolController from './find_tool_controller' | ||
Stimulus.register('find-tool', FindToolController) | ||
|
||
import ImageEditorController from './image_editor_controller' | ||
Stimulus.register('image-editor', ImageEditorController) | ||
|
||
import ModalController from './modal_controller' | ||
Stimulus.register('modal', ModalController) | ||
|
||
import MultiSelectController from './multi_select_controller' | ||
Stimulus.register('multi-select', MultiSelectController) | ||
|
||
import NotesController from './notes_controller' | ||
Stimulus.register('notes', NotesController) | ||
|
||
import PortalController from './portal_controller' | ||
Stimulus.register('portal', PortalController) | ||
|
||
import RequestItemController from './request_item_controller' | ||
Stimulus.register('request-item', RequestItemController) | ||
|
||
import SidebarController from './sidebar_controller' | ||
Stimulus.register('sidebar', SidebarController) | ||
|
||
import TagEditorController from './tag_editor_controller' | ||
Stimulus.register('tag-editor', TagEditorController) | ||
|
||
import ToggleController from './toggle_controller' | ||
Stimulus.register('toggle', ToggleController) | ||
|
||
import TreeNavController from './tree_nav_controller' | ||
Stimulus.register('tree-nav', TreeNavController) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Oops, something went wrong.